help-make
[Top][All Lists]
Advanced

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

RE: eval: logic behind when to escape


From: Warlich, Christof
Subject: RE: eval: logic behind when to escape
Date: Fri, 29 Jul 2011 08:04:06 +0200

> Maybe the following link will help you.
> http://lists.gnu.org/archive/html/help-make/2007-07/msg00050.html
Thanks for the link, the description from Philip w.r.t. variable expansion and 
evaluation
is very worthwhile to read and helped me to understand what's going on:

First, here is my (slightly modified) example, together with its output:

ifeq (0,$(MAKELEVEL))
    @echo $(MAKEFLAGS)
    all: ; $(MAKE) --no-print-dir
else
$(foreach i,all,\
    $(info $(i): ; @echo $(MAKEFLAGS))\
    $(info $(i): ; @echo $$(MAKEFLAGS))\
    $(eval $(i): ; @echo $$(MAKEFLAGS))\
)
endif

$ make -j
j
make --no-print-dir
all: ; @echo  --no-print-directory
all: ; @echo $(MAKEFLAGS)
--no-print-directory -j


Flags like --no-print-dir or -j seem to be added to $(MAKEFLAGS) only when make 
starts
evaluation its reciepes. In the case above, a reciepe has already been run with 
the --no-print-dir
flag when the eval is performed, which is why this flag is printed.

Furthermore, flags that are passed through the command line do _not_ seem to be 
passed
to submakes through $(MAKEFLAGS), but (maybe) again as a command line parameter.

This at least would explain the unexpected behaviour.

Cheers,

Chris


reply via email to

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