-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
35 lines (30 loc) · 1.17 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
default_target: all
# get a list of subdirs to build by reading tobuild.txt
SUBDIRS:=$(shell grep -v "^\#" tobuild.txt)
# Figure out where to build the software.
# Use BUILD_PREFIX if it was passed in.
# If not, search up to three 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
# 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
clean:
@for subdir in $(SUBDIRS); do \
echo "\n-------------------------------------------"; \
echo "-- $$subdir"; \
echo "-------------------------------------------"; \
$(MAKE) -C $$subdir clean; \
done
@# Place additional commands here if you have any