LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 11-20-2007, 02:52 PM   #1
c0uchm0nster
Member
 
Registered: Nov 2003
Distribution: gentoo, fedora
Posts: 60

Rep: Reputation: 15
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.
 
Old 11-21-2007, 12:28 PM   #2
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 70
Quote:
Originally Posted by c0uchm0nster View Post
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.
 
Old 11-21-2007, 12:31 PM   #3
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 70
Also, a good source of information about this stuff is Autobook.
 
Old 11-21-2007, 06:59 PM   #4
c0uchm0nster
Member
 
Registered: Nov 2003
Distribution: gentoo, fedora
Posts: 60

Original Poster
Rep: Reputation: 15
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
 
Old 11-21-2007, 10:58 PM   #5
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
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
 
  


Reply

Tags
automake, autotools


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
autotools sergio21 Programming 1 01-16-2007 01:53 AM
makefile woes SongJiang Linux - Software 1 10-08-2005 08:36 AM
beginners problem: autotools' generated makefile not doing anything sterrenkijker Programming 2 03-31-2005 02:14 PM
how to get (makefile -f makefile )output into the textview widget in Pygtk sailu_mvn Programming 3 02-28-2005 03:57 AM
generate Makefile from Makefile.in without calling ./configure ? chris78 Programming 2 05-02-2004 12:23 PM


All times are GMT -5. The time now is 11:56 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration