Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

GNU make define MAKEFLAGS

9 views
Skip to first unread message

James

unread,
Sep 28, 2017, 10:48:16 PM9/28/17
to
define func
...
export MAKEFLAGS=-j1
...
endef

$(eval $(call func,...))

In the above case, MAKEFLAGS=-j1 is effective only inside the define/endef and others are not affected if "make -j5" is issued?

TIA
James

Kaz Kylheku

unread,
Sep 28, 2017, 11:31:15 PM9/28/17
to
In the above, "export MAKEFLAGS=-j1" is just a piece of text
inside a variable definition, and not a directive.

The $(eval ...) causes that text to be evaluated as GNU Make syntax;
then that export takes effect. Its effect is global. After that,
make will pass that variable down as an environment variable.

The GNU Make manual also says this:

The special variable MAKEFLAGS is always exported (unless you unexport
it). MAKEFILES is exported if you set it to anything.

So "export MAKEFLAGS" is a useless use of export.

--
TXR Programming Lanuage: http://nongnu.org/txr
Music DIY Mailing List: http://www.kylheku.com/diy
ADA MP-1 Mailing List: http://www.kylheku.com/mp1
0 new messages