summaryrefslogtreecommitdiff
path: root/apps/graphics
diff options
context:
space:
mode:
Diffstat (limited to 'apps/graphics')
-rw-r--r--apps/graphics/Makefile30
1 files changed, 14 insertions, 16 deletions
diff --git a/apps/graphics/Makefile b/apps/graphics/Makefile
index ddd26e536..bebb31b5a 100644
--- a/apps/graphics/Makefile
+++ b/apps/graphics/Makefile
@@ -46,27 +46,25 @@ CNTXTDIRS =
all: nothing
.PHONY: nothing context depend clean distclean
+define SDIR_template
+$(1)_$(2):
+ $(MAKE) -C $(1) TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)"
+endef
+
+$(foreach SDIR, $(CNTXTDIRS), $(eval $(call SDIR_template,$(SDIR),context)))
+$(foreach SDIR, $(SUBDIRS), $(eval $(call SDIR_template,$(SDIR),depend)))
+$(foreach SDIR, $(SUBDIRS), $(eval $(call SDIR_template,$(SDIR),clean)))
+$(foreach SDIR, $(SUBDIRS), $(eval $(call SDIR_template,$(SDIR),disclean)))
+
nothing:
-context:
- @for dir in $(CNTXTDIRS) ; do \
- $(MAKE) -C $$dir context TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)"; \
- done
+context: $(foreach SDIR, $(CNTXTDIRS), $(SDIR)_context)
-depend:
- @for dir in $(SUBDIRS) ; do \
- $(MAKE) -C $$dir depend TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)"; \
- done
+depend: $(foreach SDIR, $(SUBDIRS), $(SDIR)_depend)
-clean:
- @for dir in $(SUBDIRS) ; do \
- $(MAKE) -C $$dir clean TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)"; \
- done
+clean: $(foreach SDIR, $(SUBDIRS), $(SDIR)_clean)
-distclean: clean
- @for dir in $(SUBDIRS) ; do \
- $(MAKE) -C $$dir distclean TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)"; \
- done
+distclean: clean $(foreach SDIR, $(SUBDIRS), $(SDIR)_distclean)
-include Make.dep