On Sun, May 30, 2010 at 3:30 PM, Erik Rull <[email protected]> wrote:
> Per Jessen wrote:
...
>> clean1:
>>         make -C mod1 clean
>> clean2:
>>         make -C mod2 clean
...
>> clean: clean1 clean2 clean3 clean4 clean5
>
> Hm, well, yes - this could be possbile - but quite brute-force ;-)
> If I add a new module, just the list of targets gets extended and I've
> nothing to change in the makefile - with your approach a new clean rule must
> be added manually.

If only there was some way to express a set of rules that all followed
a pattern.  We could even call them "pattern rules"...

clean-%:
        ${MAKE} -C ${@:clean-%=%} clean

clean: $(foreach mod,${MODULE_LIST},clean-${mod})


Philip Guenther

_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to