forked from facebook/hhvm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
72 lines (54 loc) · 1.64 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
PROJECT_ROOT = .
include src/dirs.mk
TEST := $(if $(OUT_TOP),$(OUT_TOP),test/)test
ifneq ($(OUT_TOP),)
COPY = && cp $(OUT_TOP)/hphpi src/hphpi/hphpi && cp $(OUT_TOP)/hphp src/hphp/hphp
else
COPY =
endif
TOBUILD := $(filter clean% clobber% both debug release, $(MAKECMDGOALS))
CLEAN := $(filter clean% clobber%,$(MAKECMDGOALS))
TOTEST := $(filter-out $(TOBUILD), $(MAKECMDGOALS))
ifeq ($(if $(TOBUILD),1)$(if $(TOTEST),1),11)
$(TOTEST) : $(TOBUILD)
endif
ifneq ($(filter fast_tests slow_tests $(FAST_TESTS) $(SLOW_TESTS) TestCodeRun%,$(MAKECMDGOALS)),)
# run all tests, even if some fail
MAKEFLAGS += k
.NOTPARALLEL:
endif
QuickTests = "" "" $@
TestExt = "" "" $@
FAST_TESTS := QuickTests TestExt TestCodeRunEval
SLOW_TESTS := TestCodeRun TestServer
all: fast_tests
tags: ctags etags
ctags:
-$(V)cd src && ct
etags:
-$(V)cd src && ct -e
.PHONY: tags ctags etags
$(FAST_TESTS) $(SLOW_TESTS) TestCodeRunStatic: % : setup
cd src && $(TEST) $(if $($@),$($@),$@)
setup: $(CLEAN)
$(MAKE) -C src $(COPY)
fast_tests: $(FAST_TESTS)
slow_tests: $(SLOW_TESTS)
.PHONY: $(FAST_TESTS) $(SLOW_TESTS) TestCodeRun%
TestCodeRun-% TestCodeRunEval-% TestCodeRunStatic-% : setup
cd src && $(TEST) $(patsubst %-$*,%,$@) Test$*
.PHONY: debug release both check_by_type fast_tests slow_tests setup
check_by_type: $(CLEAN)
@if [ -z "$$OUTDIR_BY_TYPE" ] ; then \
echo "You need to set OUTDIR_BY_TYPE to build both DEBUG and RELEASE into the same client"; \
exit 1; \
fi
release: check_by_type
$(MAKE) -Csrc RELEASE=1 DEBUG=
debug: check_by_type
$(MAKE) -Csrc RELEASE= DEBUG=1
both: debug release
clobber:
$(MAKE) -C src clobber
$(MAKE) -C facebook clobber
clean: clobber