autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: problem to use autoconf/automake


From: Keith MARSHALL
Subject: Re: problem to use autoconf/automake
Date: Tue, 26 Apr 2005 13:18:41 +0100

Nicolas Haller wrote:
>>> If I understand, Makefile.in are generated with informations enclosed 
in
>>> Makefile.am. But I have no Makefile.am in subdirs of src/. I have only
>>> sources files (.hh and .cc), and nothing to do with these (but object
>>> file to build the program define in src/Makefile.am).
>
>> Well, if you don't need any more Makefile.am files in subdirectories of
>> src/, then don't specify SUBDIRS.  Please read
>>   info Automake Subdirectories
>
>>> So, what can I do, can I create empty Makefile.am in all subdirs of 
src/
>>> or must I do anything else?
>
>> Either that, or just don't mention the directories in SUBDIRS.
>> I don't know why you wanted them there in the first place(?).
>
> You said before:
>>>> Well, put
>>>>   SUBDIRS = whatever_dirs_live_under_src
>>>> into src/Makefile.am.  Don't forget to mention all to-be-generated
>>>> Makefiles in the AC_CONFIG_FILES macro in configure.ac.
>
> So when I do what you said, automake said he can't find Makefile.in
> I try to make empty Makefile.am and it's work, autotools generates
> Makefile.in and Makefile. But I donc really know if it's good to make
> empty Automake.am, what is your opinion? 

I'm no automake expert, but AIUI you should only set SUBDIRS to the subset
of subdirectories in which you actually intend to run make.  If you are
putting empty `Makefile.am's in subdirectories, that suggests you have
nothing to make there, so why name them in SUBDIRS?

The usual plan is that, in your generated top level `Makefile' you will 
want
rules which say, for some subsystem target:

    subsystem:
        $(MAKE) -C subdir ...

or

    subsystem:
        cd subdir && $(MAKE)

which cause make to run recursively in the subdirectory, reading its 
_local_
Makefile.  You use a local `Makefile.am' in each such subdirectory, to 
specify the the automake rules, _and_ specify that subdirectory in 
SUBDIRS,
so that automake will transform it into a local `Makefile.in', which is 
then
used by autoconf, to write the local `Makefile' for the subdirectory.  If
you find yourself putting an empty `Makefile.am' in any subdirectory, then
that subdirectory probably shouldn't be specified in SUBDIRS.

HTH.

Keith.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]