bug-make
[Top][All Lists]
Advanced

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

Re: Dynamic adjustments of build dependencies for the number of availabl


From: SF Markus Elfring
Subject: Re: Dynamic adjustments of build dependencies for the number of available processors
Date: Mon, 05 Jan 2015 20:06:01 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0

> So you have in your toolbox $(shell) and $(eval).

I am not familiar enough with the second make function.
http://www.gnu.org/software/make/manual/html_node/Eval-Function.html


> $(eval) lets you generate rules dynamically.

Does it really support the generation of completely new build rules
(instead of adjusting only recipes)?


> NPROC:=$(shell grep "processor" /proc/cpuinfo  | cut -b12- )
> # this returns "0 1 2 3" etc
> 
> # Then you might use eval to generate rules dynamically:
> 
> $(foreach N,$(NPROC),$(eval
>    # YOUR DYNAMIC RULE
>   MYTARGET_$(N):
> <TAB>mytool --dosomething -o$@
>   )
> )

Would it make sense to stress such functionality a bit more
in the documentation?


> I am probably guessing wrong but perhaps this gives you some ideas.

I thank you very much for your constructive feedback.

Regards,
Markus



reply via email to

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