On Wed, 2010-11-10 at 09:35 +0330, ali hagigat wrote:
> 5.7.2 Communicating Variables to a Sub-make
> These variables are defined in the sub-make as defaults, but do not
> override what is specified in the makefile used by the sub-make makefile
> unless you use the
> ‘-e’ switch (see Section 9.7 [Summary of Options], page 96).
> -------------------------------------------------------------------
> Would you please clarify this sentence more? It is confusing. Sub-make
> means when we have a command, 'make' inside a makefile, isn't it?

It means that make processes a recipe and inside that recipe is another
invocation of make, yes.  Something like this:

        install:
                $(MAKE) local-install

> What is 'makefile used by the sub-make makefile'?!

It depends on how the sub-make is invoked; the sub-make chooses its
makefile using exactly the same algorithm as the parent make.  In my
example above, presumably the sub-make will use the same makefile as the
parent make (but it runs a different target: "local-install").

Alternatively you might see something like:

        install:
                cd subdir && $(MAKE)

Now the sub-make uses a makefile obtained from the subdirectory
"subdir".

Or you  might have:

        install:
                $(MAKE) -f install.mk

etc. etc.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <[email protected]>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.mad-scientist.net
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist


_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to