LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   autotools / makefile.in woes (https://www.linuxquestions.org/questions/programming-9/autotools-makefile-in-woes-601212/)

c0uchm0nster 11-20-2007 02:52 PM

autotools / makefile.in woes
 
I'm struggling through learning autotools to convert my project from static makefiles and I'm almost there.

I've got everything working except for a proper makefile.in
right now it's just a copy of my original makefile.
My issue now is i have no clue what variables from autotools i'm supposed to use (such as where to put the binary or project assets, or what variables are called for the ldflags or cflags etc made by ./configure.

I've looked at roughly 10 sites and they all either seem to be out of date or go into way too much detail and I get lost.

I guess i'm looking for either a basic tutorial (but not excessively so - most of the tutorials i've found dont even mention the makefile.in) or a function-list style thing for the standard vars created by autotools for use in the makefile.

Thank you.

osor 11-21-2007 12:28 PM

Quote:

Originally Posted by c0uchm0nster (Post 2965685)
I've got everything working except for a proper makefile.in

Generally, you don’t hand-write Makefile.in. Usually, you hand-write Makefile.am (or sometimes Makefile.in.in). This is translated into Makefile.in by automake.

osor 11-21-2007 12:31 PM

Also, a good source of information about this stuff is Autobook.

c0uchm0nster 11-21-2007 06:59 PM

thanks for the replies. and sorry about the typo on makefile.in - i did mean .am

I'll take a look at the book, but as I mentioned in my original post I'm really looking for something that's not amazingly basic, but also not an entire books worth of information

I want something that says "hey, with a mostly basic configure.ac that just checks for the necessary libraries and names the project here are the vars you use in makefile.am for compiler, linker flags, what directories to install in, etc"

hopefully something along these lines exists

thanks

ta0kira 11-21-2007 10:58 PM

Makefile.am is actually the simple part and configure.ac is the more complex one. Really all a Makefile.am is a list of what to build, what files it needs, what compile and link options it takes, what (in addition to dependencies) it should include in a distro package, and what subdirectories to go into. info automake should help out, as well as libtool and autoconf. It took me forever just to be patient enough to learn them (because the docs all reference each other) but it's fairly simple once you get the basics. There are also a few make rules you can define to be executed at (un)install time.

Automake will generate a Makefile.in, which is a template makefile, from your Makefile.am. Autoconf will make a ./configure based on your configure.ac, which tells it which options to build that script with. When ./configure is run, it inserts the results of its tests into the generated Makefile.in to create a real makefile.
ta0kira


All times are GMT -5. The time now is 12:21 PM.