summaryrefslogtreecommitdiffstats
path: root/make/directory.cfg
blob: 68b68d79e004e6e152d204b9386b7ed541ab6355 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#
#  $Id$
#
# make/directory.cfg
#
#   Make(1) configuration file include'd by all directory-level Makefile's.
#
#   See also make/main.cfg
#

# include $(RTEMS_ROOT)/make/main.cfg

# 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)
$(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