bug-make
[Top][All Lists]
Advanced

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

Re: Dynamic evaluation of build scripts


From: Paul Smith
Subject: Re: Dynamic evaluation of build scripts
Date: Sun, 11 Jan 2015 22:11:24 -0500

On Sun, 2015-01-11 at 10:00 +0100, SF Markus Elfring wrote:
> > http://make.mad-scientist.net/category/metaprogramming/
> 
> How many software implementations support the eval function in make
> files?

I'm not quite sure what you mean by "software implementations"... you
mean different implementation of the "make" program itself?  GNU make is
the only implementation of make that supports any GNU make functions,
including $(eval ...), if that's what you mean.  In fact, recursive
variable expansion is about the only one of the techniques I discuss
above which is widely implemented in other versions of make.

Solaris make or BSD make, I forget which, has, I believe, some form of
secondary expansion although it's quite not the same.

No other make, that I know of, supports regenerating makefiles and
re-exec'ing.  And definitely no other make supports $(eval ...).

> >>> # Then you might use eval to generate rules dynamically:
> >>>
> >>> $(foreach N,$(NPROC),$(eval
> >>>    # YOUR DYNAMIC RULE
> >>>   MYTARGET_$(N):
> >>> <TAB>mytool --dosomething -o$@
> >>>   )
> >>> )
> 
> How do you think about to mention in the manual how several parameters
> can be passed?
> When should parameters be used as further function arguments?

Once again I don't clearly understand your question.  The $(call ...)
function is what's normally used to create a user-defined function that
takes multiple arguments in GNU make... it's described in the manual.




reply via email to

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