[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: makefile used by the sub-make makefile!
From: |
Paul Smith |
Subject: |
Re: makefile used by the sub-make makefile! |
Date: |
Wed, 10 Nov 2010 01:42:01 -0500 |
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 <address@hidden> 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