forked from gabrielcuvillier/regal-emscripten-fixes
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile.gtest
52 lines (37 loc) · 1.33 KB
/
Makefile.gtest
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
ifndef MAKEFILE_GTEST_INCLUDED
MAKEFILE_GTEST_INCLUDED := 1
.PHONY: gtest.lib snappy.clean
include build/common.inc
ifeq ($(filter emscripten%,$(SYSTEM)),)
#
# googletest + googlemock
#
all:: gtest.lib
clean:: gtest.clean
GTEST.SRCS += src/googletest/src/gtest-all.cc
GTEST.SRCS += src/googlemock/src/gmock-all.cc
GTEST.SRCS.NAMES := $(notdir $(GTEST.SRCS))
GTEST.OBJS := $(addprefix tmp/$(SYSTEM)/gtest/static/,$(GTEST.SRCS.NAMES))
GTEST.OBJS := $(GTEST.OBJS:.cc=.o)
GTEST.DEPS := $(GTEST.OBJS:.o=.d)
GTEST.CFLAGS := -Isrc/googletest/include -Isrc/googletest -Isrc/googlemock/include -Isrc/googlemock
GTEST.STATIC := libgtestlib.a
-include $(GTEST.DEPS)
gtest.lib: lib/$(SYSTEM)/$(GTEST.STATIC)
gtest.clean:
$(RM) -r tmp/$(SYSTEM)/gtest/static
$(RM) -r lib/$(SYSTEM)/$(GTEST.STATIC)
tmp/$(SYSTEM)/gtest/static/gtest-all.o: src/googletest/src/gtest-all.cc
@mkdir -p $(dir $@)
$(LOG_CXX)$(CCACHE) $(CC) $(GTEST.CFLAGS) $(CFLAGS) $(CFLAGS.SO) -o $@ -c $<
tmp/$(SYSTEM)/gtest/static/gmock-all.o: src/googlemock/src/gmock-all.cc
@mkdir -p $(dir $@)
$(LOG_CXX)$(CCACHE) $(CC) $(GTEST.CFLAGS) $(CFLAGS) $(CFLAGS.SO) -o $@ -c $<
lib/$(SYSTEM)/$(GTEST.STATIC): $(GTEST.OBJS)
@mkdir -p $(dir $@)
$(LOG_AR)$(CCACHE) $(AR) cr $@ $(GTEST.OBJS)
ifneq ($(RANLIB),)
$(LOG_RANLIB)$(RANLIB) $@
endif
endif
endif