forked from emscripten-ports/regal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.glu
103 lines (79 loc) · 2.4 KB
/
Makefile.glu
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
ifndef MAKEFILE_GLU_INCLUDED
MAKEFILE_GLU_INCLUDED := 1
.PHONY: glu.lib glu.clean
include build/common.inc
include build/glu.inc
#
# RegalGLU
#
# Not supported for NaCL or emscripten, yet
ifneq ($(filter nacl% emscripten%,$(SYSTEM)),)
GLU.SHARED :=
endif
ifdef GLU.STATIC
include Makefile.regal
ifndef REGAL.STATIC
$(error RegalGLU needs Regal.)
endif
all:: glu.lib
clean:: glu.clean
GLU.SRCS := $(GLU.C) $(GLU.CXX)
GLU.SRCS.NAMES := $(notdir $(GLU.SRCS))
GLU.OBJS := $(addprefix tmp/$(SYSTEM)/glu/shared/,$(GLU.SRCS.NAMES))
GLU.OBJS := $(GLU.OBJS:.c=.o) $(GLU.OBJS:.cc=.o)
GLU.OBJS := $(filter %.o,$(GLU.OBJS))
GLU.DEPS := $(GLU.OBJS:.o=.d)
GLU.LIBS := -Llib/$(SYSTEM) -lRegal
GLU.LIBS += -lstdc++
GLU.LIBS += -pthread -lm
-include $(GLU.DEPS)
ifdef GLU.STATIC
glu.lib: lib/$(SYSTEM)/$(GLU.STATIC)
endif
ifdef GLU.SHARED
glu.lib: lib/$(SYSTEM)/$(GLU.SHARED)
endif
glu.clean:
$(RM) -r tmp/$(SYSTEM)/glu/shared
ifdef GLU.STATIC
$(RM) -r lib/$(SYSTEM)/$(GLU.STATIC)
endif
ifdef GLU.SHARED
$(RM) -r lib/$(SYSTEM)/$(GLU.SHARED)
endif
tmp/$(SYSTEM)/glu/shared/%.o: src/glu/libtess/%.c
@mkdir -p $(dir $@)
$(LOG_CC)$(CCACHE) $(CC) $(PICFLAG) $(GLU.CFLAGS) $(CFLAGS) $(CFLAGS.SO) -o $@ -c $<
tmp/$(SYSTEM)/glu/shared/%.o: src/glu/libutil/%.c
@mkdir -p $(dir $@)
$(LOG_CC)$(CCACHE) $(CC) $(PICFLAG) $(GLU.CFLAGS) $(CFLAGS) $(CFLAGS.SO) -o $@ -c $<
tmp/$(SYSTEM)/glu/shared/%.o: src/glu/libnurbs/interface/%.cc
@mkdir -p $(dir $@)
$(LOG_CXX)$(CCACHE) $(CC) $(PICFLAG) $(GLU.CFLAGS) $(CFLAGS) $(CFLAGS.SO) -o $@ -c $<
tmp/$(SYSTEM)/glu/shared/%.o: src/glu/libnurbs/internals/%.cc
@mkdir -p $(dir $@)
$(LOG_CXX)$(CCACHE) $(CC) $(PICFLAG) $(GLU.CFLAGS) $(CFLAGS) $(CFLAGS.SO) -o $@ -c $<
tmp/$(SYSTEM)/glu/shared/%.o: src/glu/libnurbs/nurbtess/%.cc
@mkdir -p $(dir $@)
$(LOG_CXX)$(CCACHE) $(CC) $(PICFLAG) $(GLU.CFLAGS) $(CFLAGS) $(CFLAGS.SO) -o $@ -c $<
ifdef GLU.SHARED
lib/$(SYSTEM)/$(GLU.SHARED): $(GLU.OBJS) lib/$(SYSTEM)/$(REGAL.SHARED)
@mkdir -p $(dir $@)
$(LOG_LD)$(CCACHE) $(LD) $(LDFLAGS.EXTRA) $(LDFLAGS.DYNAMIC) $(REGAL.LDFLAGS) -o $@ $(GLU.OBJS) $(GLU.LIBS)
ifneq ($(STRIP),)
$(LOG_STRIP)$(STRIP) -x $@
endif
endif
ifdef GLU.STATIC
lib/$(SYSTEM)/$(GLU.STATIC): $(GLU.OBJS)
@mkdir -p $(dir $@)
$(LOG_AR)$(CCACHE) $(AR) cr $@ $(GLU.OBJS)
ifneq ($(RANLIB),)
$(LOG_RANLIB)$(RANLIB) $@
endif
ifneq ($(STRIP),)
$(LOG_STRIP)$(STRIP) -x $@
endif
endif
endif
endif