-
Notifications
You must be signed in to change notification settings - Fork 48
/
Makefile.subdir
61 lines (52 loc) · 1.67 KB
/
Makefile.subdir
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
58
59
60
# Copyright 2015 EMC Corporation
# All Rights Reserved
#
# Copyright (c) 2012 EMC Corporation
# All Rights Reserved
#
# This software contains the intellectual property of EMC Corporation
# or is licensed to EMC Corporation from third parties. Use of this
# software and the intellectual property contained therein is expressly
# limited to the terms and conditions of the License Agreement under which
# it is provided by or on behalf of EMC.
#
# Makefile.subdir
#
SHELL = /bin/bash
# These variables make things verbose or not
#
ifeq ($(VERBOSE), 1)
ATECHO := @true \#
ATSIGN :=
TEEOUT := \#
MAKEFLAGS = -r -R
else
ATECHO := @echo
ATSIGN := @
TEEOUT := &>
MAKEFLAGS = -r -R --no-print-directory
endif
ifeq ($(strip $(MAKE_CURRENT_DIR)),)
MAKE_CURRENT_DIR = .
endif
.DEFAULT: all
# Iterate through all the subdirectories
all::
@for dir in $(SUBDIRS); do \
echo "===> $(MAKE_CURRENT_DIR)/$$dir"; \
$(MAKE) -C $$dir MAKE_CURRENT_DIR="$(MAKE_CURRENT_DIR)/$$dir" $(@) || exit 1; \
done
# The same but with a single colon
#%:
# @for dir in $(SUBDIRS); do \
# echo "===> $(MAKE_CURRENT_DIR)/$$dir"; \
# $(MAKE) -C $$dir MAKE_CURRENT_DIR="$(MAKE_CURRENT_DIR)/$$dir" $(@) || exit 1; \
# done
# Iterate through all the subdirectories in the reverse order
clean clobber::
@for dir in `rev=""; for s in $(SUBDIRS); do rev="$$s $$rev"; done; echo $$rev`; do \
echo "===> $(MAKE_CURRENT_DIR)/$$dir"; \
$(MAKE) -C $$dir MAKE_CURRENT_DIR="$(MAKE_CURRENT_DIR)/$$dir" $(@) || exit 1; \
done
#
# END $Rev: XXX $