This repository has been archived by the owner on Jun 9, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 71
/
Makefile
48 lines (40 loc) · 1.5 KB
/
Makefile
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
default_target: all
# get a list of subdirs to build by reading tobuild.txt
SUBDIRS:=$(shell grep -v "^\#" tobuild.txt)
TESTDIRS:=$(shell grep -v "^\#" totest.txt)
# Figure out where to build the software.
# Use BUILD_PREFIX if it was passed in.
# If not, search up to two parent directories for a 'build' directory.
# Otherwise, use ./build.
ifeq "$(BUILD_PREFIX)" ""
BUILD_PREFIX=$(shell for pfx in ./ .. ../..; do d=`pwd`/$$pfx/build; \
if [ -d $$d ]; then echo $$d; exit 0; fi; done; echo `pwd`/build)
endif
export BUILD_PREFIX
# build quietly by default. For a verbose build, run "make VERBOSE=1"
$(VERBOSE).SILENT:
all:
@[ -d $(BUILD_PREFIX) ] || mkdir -p $(BUILD_PREFIX) || exit 1
@for subdir in $(SUBDIRS); do \
echo "\n-------------------------------------------"; \
echo "-- $$subdir"; \
echo "-------------------------------------------"; \
$(MAKE) -C $$subdir all || exit 2; \
done
@# Place additional commands here if you have any
test: all
@for subdir in $(TESTDIRS); do \
echo "\n-------------------------------------------"; \
echo "-- $$subdir"; \
echo "-------------------------------------------"; \
$(MAKE) -C $$subdir test || exit 2; \
done
@# Place additional commands here if you have any
clean:
@for subdir in $(SUBDIRS); do \
echo "\n-------------------------------------------"; \
echo "-- $$subdir"; \
echo "-------------------------------------------"; \
$(MAKE) -C $$subdir clean; \
done
@# Place additional commands here if you have any