forked from emscripten-ports/regal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.regaltest
81 lines (61 loc) · 2.42 KB
/
Makefile.regaltest
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
73
74
75
76
77
78
79
80
81
ifndef MAKEFILE_REGALTEST_INCLUDED
MAKEFILE_REGALTEST_INCLUDED := 1
.PHONY: regaltest.bin regaltest.clean
include build/common.inc
# Not supported for Emscripten - Revisit
ifeq ($(filter emscripten% nacl-pnacl,$(SYSTEM)),)
include build/regaltest.inc
#
# regaltest
#
include Makefile.regal
include Makefile.pcrelib
include Makefile.glsloptlib
include Makefile.gtest
ifndef REGAL.STATIC
$(error regaltest needs Regal.)
endif
ifndef GTEST.STATIC
$(error regaltest needs google test.)
endif
all:: regaltest.bin
clean:: regaltest.clean
regaltest.bin: bin/$(SYSTEM)/regaltest$(BIN_EXTENSION)
regaltest.clean:
$(RM) -r tmp/$(SYSTEM)/regaltest/static
$(RM) -r bin/$(SYSTEM)/regaltest$(BIN_EXTENSION)
REGALTEST.SRCS += $(REGALTEST.CXX)
REGALTEST.SRCS.NAMES := $(notdir $(REGALTEST.SRCS))
REGALTEST.OBJS := $(addprefix tmp/$(SYSTEM)/regaltest/static/,$(REGALTEST.SRCS.NAMES))
REGALTEST.OBJS := $(REGALTEST.OBJS:.cpp=.o)
REGALTEST.DEPS := $(REGALTEST.DEPS:.o=.d)
REGALTEST.CFLAGS := -Isrc/googletest/include -Isrc/googlemock/include -Isrc/regal -Isrc/boost -Isrc/lookup3 -Isrc/pcre
REGALTEST.LIBS := -Llib/$(SYSTEM) $(LDFLAGS.X11) -lm
ifeq ($(filter nacl%,$(SYSTEM)),)
REGALTEST.LIBS += -ldl
else
REGALTEST.LIBS += -lnacl_io -lppapi -lppapi_gles2
endif
-include $(REGALTEST.DEPS)
tmp/$(SYSTEM)/regaltest/static/%.o: tests/%.cpp
@mkdir -p $(dir $@)
$(LOG_CXX)$(CCACHE) $(CXX) $(REGAL.CFLAGS) $(REGALTEST.CFLAGS) $(CFLAGS) $(CFLAGS.SO) -o $@ -c $<
bin/$(SYSTEM)/regaltest$(BIN_EXTENSION): $(REGALTEST.OBJS) lib/$(SYSTEM)/$(GTEST.STATIC) lib/$(SYSTEM)/$(REGAL.STATIC) lib/$(SYSTEM)/$(PCRE.STATIC) $(REGAL.SHARED.DEPEND)
@mkdir -p $(dir $@)
ifdef APITRACE.STATIC
$(LOG_LD)$(CCACHE) $(LD) $(LDFLAGS.EXTRA) -o $@ $(REGALTEST.OBJS) $(LDFLAGS.STARTGROUP) lib/$(SYSTEM)/$(REGAL.STATIC) lib/$(SYSTEM)/$(APITRACE.STATIC) $(LDFLAGS.ENDGROUP) $(REGAL.SHARED.DEPEND) $(REGAL.LIBS) $(REGALTEST.LIBS) lib/$(SYSTEM)/$(PCRE.STATIC) lib/$(SYSTEM)/$(GTEST.STATIC) $(REGAL.LDFLAGS)
else
$(LOG_LD)$(CCACHE) $(LD) $(LDFLAGS.EXTRA) -o $@ $(REGALTEST.OBJS) lib/$(SYSTEM)/$(REGAL.STATIC) lib/$(SYSTEM)/$(PCRE.STATIC) $(REGAL.SHARED.DEPEND) $(REGAL.LIBS) $(REGALTEST.LIBS) lib/$(SYSTEM)/$(GTEST.STATIC) $(REGAL.LDFLAGS)
endif
ifneq ($(STRIP),)
$(LOG_STRIP)$(STRIP) -x $@
endif
test: bin/$(SYSTEM)/regaltest$(BIN_EXTENSION)
@echo Running tests: $^
ifeq ($(filter nacl%,$(SYSTEM)),)
$^
else
"$(NACL_SDK_ROOT)/tools/sel_ldr.py" $^
endif
endif
endif