On May 30, 2010, at 6:30 PM, Erik Rull wrote:
> Per Jessen wrote:
>>
>> clean1:
>> make -C mod1 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.
I think he was implying something like this:
MODULE_LIST:=one two three
.PHONY: all
all:
@echo $(MODULE_LIST)
define clean_module
.PHONY: clean_$(1)
clean_$(1):
@echo "Clean: $(1)"
CLEAN_EXTRA+= clean_$(1)
endef
$(foreach MODULE,$(MODULE_LIST),$(eval $(call clean_module,$(MODULE))))
.PHONY: clean
clean: $(CLEAN_EXTRA)
@echo "Clean: main"
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make