forked from emscripten-ports/regal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.apitrace
88 lines (63 loc) · 2.21 KB
/
Makefile.apitrace
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
82
83
84
85
86
87
ifndef MAKEFILE_APITRACE_INCLUDED
MAKEFILE_APITRACE_INCLUDED := 1
.PHONY: apitrace.lib apitrace.clean
include build/common.inc
include build/apitrace.inc
# Not supported for NaCL or emscripten, currently
ifneq ($(filter nacl% emscripten%,$(SYSTEM)),)
APITRACE.STATIC :=
APITRACE.SHARED :=
endif
#
# apitrace
#
ifdef APITRACE.STATIC
include Makefile.snappy
ifndef SNAPPY.STATIC
$(error apitrace needs snappy.)
endif
all:: apitrace.lib
clean:: apitrace.clean
APITRACE.SRCS := $(APITRACE.CXX)
APITRACE.SRCS := $(filter %.c,$(APITRACE.SRCS)) $(filter %.cc,$(APITRACE.SRCS)) $(filter %.cpp,$(APITRACE.SRCS))
APITRACE.SRCS.NAMES := $(notdir $(APITRACE.SRCS))
APITRACE.OBJS := $(addprefix tmp/$(SYSTEM)/apitrace/static/,$(APITRACE.SRCS.NAMES))
APITRACE.OBJS := $(APITRACE.OBJS:.c=.o) $(APITRACE.OBJS:.cc=.o) $(APITRACE.OBJS:.cpp=.o)
APITRACE.OBJS := $(filter %.o,$(APITRACE.OBJS))
APITRACE.DEPS := $(APITRACE.OBJS:.o=.d)
-include $(APITRACE.DEPS)
APITRACE.CFLAGS += -fvisibility=hidden
ifneq ($(filter linux%,$(SYSTEM)),)
APITRACE.CFLAGS += -DHAVE_X11=1
endif
ifeq ($(MODE),release)
APITRACE.CFLAGS += -DNDEBUG
APITRACE.CFLAGS += -DREGAL_NO_ASSERT=1
endif
apitrace.lib: snappy.lib lib/$(SYSTEM)/$(APITRACE.STATIC)
apitrace.clean:
$(RM) -r tmp/$(SYSTEM)/apitrace/static
$(RM) -r lib/$(SYSTEM)/$(APITRACE.STATIC)
tmp/$(SYSTEM)/apitrace/static/%.o: src/apitrace/common/%.cpp
@mkdir -p $(dir $@)
$(LOG_CXX)$(CCACHE) $(CXX) $(APITRACE.CFLAGS) $(CFLAGS) $(PICFLAG) -o $@ -c $<
tmp/$(SYSTEM)/apitrace/static/%.o: src/apitrace/dispatch/%.cpp
@mkdir -p $(dir $@)
$(LOG_CXX)$(CCACHE) $(CXX) $(APITRACE.CFLAGS) $(CFLAGS) $(PICFLAG) -o $@ -c $<
tmp/$(SYSTEM)/apitrace/static/%.o: src/apitrace/helpers/%.cpp
@mkdir -p $(dir $@)
$(LOG_CXX)$(CCACHE) $(CXX) $(APITRACE.CFLAGS) $(CFLAGS) $(PICFLAG) -o $@ -c $<
tmp/$(SYSTEM)/apitrace/static/%.o: src/apitrace/wrappers/%.cpp
@mkdir -p $(dir $@)
$(LOG_CXX)$(CCACHE) $(CXX) $(APITRACE.CFLAGS) $(CFLAGS) $(PICFLAG) -o $@ -c $<
lib/$(SYSTEM)/$(APITRACE.STATIC): $(APITRACE.OBJS)
@mkdir -p $(dir $@)
$(LOG_AR)$(CCACHE) $(AR) cr $@ $(APITRACE.OBJS)
ifneq ($(RANLIB),)
$(LOG_RANLIB)$(RANLIB) $@
endif
ifneq ($(STRIP),)
$(LOG_STRIP)$(STRIP) -x $@
endif
endif
endif