From f71e71f36c8de3e2222c4137e546a91525bd5076 Mon Sep 17 00:00:00 2001 From: Andrew Dennison Date: Thu, 27 Sep 2007 10:18:16 +1000 Subject: [PATCH] prex: recurse subdirectories with make instead of using the shell --- mk/Makefile.inc | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/mk/Makefile.inc b/mk/Makefile.inc index 33410bf..3812e48 100755 --- a/mk/Makefile.inc +++ b/mk/Makefile.inc @@ -157,11 +157,9 @@ endif # # Rules to process sub-directory # -ifdef SUBDIRS .PHONY: $(SUBDIRS) -$(SUBDIRS): dummy - $(MAKE) -C $@ -endif +$(SUBDIRS): + $(MAKE) -C $@ $(MAKECMDGOALS) # # Rules to link a set of .o files into one .o file @@ -316,12 +314,7 @@ C_SRCS = $(wildcard *.c) $(wildcard *.S) # Depend # .PHONY: depend dep -depend dep: -ifdef SUBDIRS - @(for d in $(SUBDIRS) _ ; do \ - if [ "$$d" != "_" ] ; then $(MAKE) -C $$d depend; fi; \ - done); -endif +depend dep: $(SUBDIRS) $(RM) -f Makefile.dep @(for d in $(C_SRCS) _ ; do \ if [ "$$d" != "_" ] ; then \ @@ -341,12 +334,7 @@ lint: # Clean up # .PHONY: clean -clean: -ifdef SUBDIRS - @(for d in $(SUBDIRS) _ ; do \ - if [ "$$d" != "_" ] ; then $(MAKE) -C $$d clean; fi; \ - done); -endif +clean: $(SUBDIRS) $(RM) -f Makefile.dep $(TARGET) $(DISASM) $(MAP) $(SYMBOL) $(CLEANS) ifneq (,$(strip $(OBJS) $(OBJS-y) $(OBJS-m) $(OBJS-))) $(RM) -f $(sort $(OBJS) $(OBJS-y) $(OBJS-m) $(OBJS-)) -- 2.11.4.GIT