help-make
[Top][All Lists]
Advanced

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

MAKEFLAGS


From: Warlich, Christof
Subject: MAKEFLAGS
Date: Wed, 21 Nov 2012 09:50:36 +0100

Hi,

I'd like to check for the existence of some .mk files from my Makefile. As Make 
may find these .mk files
through --include-dir=... flags, I'd also like to search these directories. The 
documentation says that
this should be possible through the variable MAFEFLAGS:

5.7.3 Communicating Options to a Sub-make

Flags such as '-s' and '-k' are passed automatically to the sub-make through 
the variable MAKEFLAGS. This variable is set up automatically by make to 
contain the flag letters that make received. Thus, if you do 'make -ks' then 
MAKEFLAGS gets the value 'ks'.

As a consequence, every sub-make gets a value for MAKEFLAGS in its environment. 
In response, it takes the flags from that value and processes them as if they 
had been given as arguments. See Summary of 
Options<http://www.gnu.org/software/make/manual/make.html#Options-Summary>.

Likewise variables defined on the command line are passed to the sub-make 
through MAKEFLAGS. Words in the value of MAKEFLAGS that contain '=', make 
treats as variable definitions just as if they appeared on the command line. 
See Overriding 
Variables<http://www.gnu.org/software/make/manual/make.html#Overriding>.

The options '-C', '-f', '-o', and '-W' are not put into MAKEFLAGS; these 
options are not passed down.

...

But with the following Makefile, the --include-dir or -I flags are ignored in 
MAKEFLAGS (and in MFLAGS):

$(info MAKEFLAGS=$(MAKEFLAGS))
$(info MLAGS=$(MFLAGS))
all: ;

$ make --include-dir=/home -ks -I /
MAKEFLAGS=sk
MLAGS=-sk

Is there any way to get access to the include path from within my Makefile?

Thanks for any help,

Chris


reply via email to

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