[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: determining targets with recursive makefiles
From: |
Paul D. Smith |
Subject: |
Re: determining targets with recursive makefiles |
Date: |
Wed, 20 Jul 2005 10:41:01 -0400 |
%% "Jan M" <address@hidden> writes:
jm> The GNU make manual reference to recursion doesnt provide a hint
jm> as to how, with this method of recursion, make is finding the
jm> sub-makefiles
It uses exactly the same method as the top-level makefile: a -f
argument, or the default names for makefiles, or MAKEFILES variable.
jm> BUILT_SOURCES = stamp-gc-h #note: not glibconfig.h
jm> RECURSIVE_TARGETS = ... all-recursive ...
jm> all: $(BUILT_SOURCES) config.h
jm> $(MAKE) $(AM_MAKEFLAGS) all-recursive
jm> Exactly what is happening here?
I'm not sure what you're question is... this invokes sub-makes, but in
the same directory. So, it reads all the same makefiles as below.
But, since you explicitly invoked the "all-recursive" target it will run
that target instead of the "all" target.
jm> By what mechanism is make locating the other makefiles (cd
jm> <subdirectory> appears not to be used as in the example of
jm> recursion in the manual)?
THIS invocation is NOT locating "the other makefiles"; it's re-reading
the same makefiles. The cd to the subdirectory and the read of those
makefiles will happen in the command script for the -recursive targets.
jm> What is the significance of all-recursive, which is declared but
jm> appears not to be defined?
It is defined. Look more closely at your makefile.
If it weren't defined you'd get an error "don't know how to make target"
or similar.
--
-------------------------------------------------------------------------------
Paul D. Smith <address@hidden> Find some GNU make tips at:
http://www.gnu.org http://make.paulandlesley.org
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist