1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
DIRS=externals Utils Engine Lua Loader Database all: $(DIRS) clean: clean-dirs clean-dirs: for i in $(DIRS) ; do $(MAKE) -C $$i clean ; done .PHONY: $(DIRS) define DIR_template $(1): $$(MAKE) -C $$@ endef $(foreach dir, $(DIRS), $(eval $(call DIR_template, $(dir))))