summaryrefslogtreecommitdiffstats
path: root/c/src/make/directory.cfg
diff options
context:
space:
mode:
Diffstat (limited to 'c/src/make/directory.cfg')
-rw-r--r--c/src/make/directory.cfg57
1 files changed, 12 insertions, 45 deletions
diff --git a/c/src/make/directory.cfg b/c/src/make/directory.cfg
index 68b68d79e0..1714204318 100644
--- a/c/src/make/directory.cfg
+++ b/c/src/make/directory.cfg
@@ -8,50 +8,17 @@
# See also make/main.cfg
#
-# include $(RTEMS_ROOT)/make/main.cfg
+# RULE=$(shell echo $@ | $(SED) -e s/debug_// -e s/profile_//)
-# on a 'make -k' we don't want to bomb out of directory list
-EXIT_CMD=exit 1
-ifeq (k, $(findstring k, $(MAKEFLAGS)))
-EXIT_CMD=true
-endif
-
-RULE=$(shell echo $@ | $(SED) -e s/debug_// -e s/profile_//)
-
-ifeq ($(RTEMS_USE_OWN_PDIR),yes)
+# This is a simplified variant of automake-1.4's rule for handling
+# subdirectories
$(RECURSE_TARGETS):
- @$(ECHO); \
- BASEDIR=`pwd`; \
- test -d $$BASEDIR || $(EXIT_CMD) ; \
- for subd in $(SUB_DIRS) xxx; \
- do if [ $$subd != xxx ] ; then \
- cd $$BASEDIR; \
- if [ ! -d $$subd ] ; then \
- $(ECHO) "*** ERROR -- Directory ($$subd) does not exist!!!"; \
- $(EXIT_CMD) ; \
- fi ; \
- $(ECHO); \
- $(ECHO) "*** $$BASEDIR/$$subd ($@)" ; \
- cmd="cd $$subd; $(MAKE) $(RULE)"; \
- $(ECHO) $$cmd; \
- eval $$cmd || $(EXIT_CMD); \
- fi; done; \
- $(ECHO); \
- $(ECHO) "*** $$BASEDIR/$@ ($@) Finished."; \
- $(ECHO)
- $($@_WRAPUP)
-else
-ifdef RECURSE_TARGETS
-$(RECURSE_TARGETS):
- @$(ECHO) ; set -e ; \
- if [ "$(SUB_DIRS)" != "" ] ; then \
- sdirs="$(SUB_DIRS)" ; \
- else \
- sdirs="xxx" ; \
- fi ; \
- if [ "$$sdirs" != "xxx" ] ; then \
- for subd in $$sdirs; do $(MAKE) -w -C $$subd $(RULE); done ;\
- fi
-endif
-endif
-
+ @set fnord $(MAKEFLAGS); amf=$$2; \
+ dot_seen=no; \
+ target=`echo $@ | sed -e s/-recursive// -e s/debug_// -e s/profile_// `; \
+ list='$(SUB_DIRS)'; for subdir in $$list; do \
+ echo "Making $$target RTEMS_BSP=${RTEMS_BSP} in $$subdir"; \
+ local_target="$$target"; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+ done && test -z "$$fail"