-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.subdir
58 lines (55 loc) · 1.41 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
# -*-makefile-*-
#
# This makefile is included from source directories in order to
# trigger a build in the corresponding build directory.
#
# See src/Makefile for an example.
#
include $(topdir)/builds/current
builddir = $(topdir)/builds/$(CURRENT_BUILD)/$(srcdir)
unittestdir = $(topdir)/builds/$(CURRENT_BUILD)/test/unit
unittestprefix = $(srcdir:src/%=%)
.PHONY: all
all .DEFAULT:
@if test -e $(builddir); then \
echo cd $(builddir); \
cd $(builddir); \
echo $(MAKE) $@; \
$(MAKE) $@; \
else \
echo; \
echo 'Run configure first, or type "make" in a configured build directory.'; \
echo; \
fi
.PHONY: check units
ifeq ($(srcdir:test/%=test),test)
# under the test/ directory, additional subtargets
.PHONY: systemtests regress regress0 regress1 regress2 regress3
check units systemtests regress regress0 regress1 regress2 regress3:
@if test -e $(builddir); then \
echo cd $(builddir); \
cd $(builddir); \
echo $(MAKE) $@; \
$(MAKE) $@; \
else \
echo; \
echo "** ERROR: could not find testing dir \`$(builddir)'"; \
echo; \
fi
else
check units:
@if test -e $(unittestdir); then \
echo cd $(unittestdir); \
cd $(unittestdir); \
echo $(MAKE) TEST_PREFIX=$(unittestprefix)/ $@; \
$(MAKE) TEST_PREFIX=$(unittestprefix)/ $@; \
else \
echo; \
echo "** ERROR: could not find unit testing dir \`$(unittestdir)'"; \
echo; \
exit 1; \
fi
endif
# synonyms for "check"
.PHONY: test
test: check