help-make
[Top][All Lists]
Advanced

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

eval: logic behind when to escape


From: Warlich, Christof
Subject: eval: logic behind when to escape
Date: Wed, 27 Jul 2011 08:03:21 +0200

Hi,

please consider the following makefile:

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

If this is called with e.g.

make -j

$(MAKEFLAGS) _does_ contain the --no-print-dir flag, but it seems that it 
doesn't contain the -j flag.
But this may be fixed by putting an additional $ in front of $(MAKEFLAGS).

I could have lived with the insight that the additional $ is generally 
necessary due to the eval,
but why then was it _not_ necessary to print the --no-print-dir?

Thanks for any clues on when escaping is required,

Chris

P.S.: I'm still using V3.81


reply via email to

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