forked from emscripten-ports/regal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.glut
86 lines (66 loc) · 1.75 KB
/
Makefile.glut
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
ifndef MAKEFILE_GLUT_INCLUDED
MAKEFILE_GLUT_INCLUDED := 1
.PHONY: glut.lib glut.clean
include build/common.inc
include build/glut.inc
# Not supported for Mac or emscripten
ifneq ($(filter darwin% emscripten%,$(SYSTEM)),)
GLUT.STATIC :=
GLUT.SHARED :=
endif
#
# RegalGLUT
#
ifdef GLUT.STATIC
include Makefile.regal
include Makefile.glu
ifndef REGAL.STATIC
$(error RegalGLUT needs Regal.)
endif
all:: glut.lib
clean:: glut.clean
GLUT.SRCS := $(GLUT.C)
GLUT.SRCS.NAMES := $(notdir $(GLUT.SRCS))
GLUT.OBJS := $(addprefix tmp/$(SYSTEM)/glut/static/,$(GLUT.SRCS.NAMES))
GLUT.OBJS := $(GLUT.OBJS:.c=.o)
GLUT.DEPS := $(GLUT.OBJS:.o=.d)
GLUT.LIBS := -Llib/$(SYSTEM) -lRegal -lRegalGLU
GLUT.LIBS += -lX11 -lXmu -lXi
GLUT.LIBS += -pthread -lm
-include $(GLUT.DEPS)
ifdef GLUT.STATIC
glut.lib: lib/$(SYSTEM)/$(GLUT.STATIC)
endif
ifdef GLUT.SHARED
glut.lib: lib/$(SYSTEM)/$(GLUT.SHARED)
endif
glut.clean:
$(RM) -r tmp/$(SYSTEM)/glut/static
ifdef GLU.STATIC
$(RM) -r lib/$(SYSTEM)/$(GLUT.STATIC)
endif
ifdef GLU.SHARED
$(RM) -r lib/$(SYSTEM)/$(GLUT.SHARED)
endif
tmp/$(SYSTEM)/glut/static/%.o: src/glut/src/%.c
@mkdir -p $(dir $@)
$(LOG_CC)$(CCACHE) $(CC) $(GLUT.CFLAGS) $(CFLAGS) $(PICFLAG) $(CFLAGS.SO) -o $@ -c $<
lib/$(SYSTEM)/$(GLUT.STATIC): $(GLUT.OBJS)
@mkdir -p $(dir $@)
$(LOG_AR)$(CCACHE) $(AR) cr $@ $(GLUT.OBJS)
ifneq ($(RANLIB),)
$(LOG_RANLIB)$(RANLIB) $@
endif
ifneq ($(STRIP),)
$(LOG_STRIP)$(STRIP) -x $@
endif
lib/$(SYSTEM)/$(GLUT.SHARED): $(GLUT.OBJS) lib/$(SYSTEM)/$(GLU.SHARED) lib/$(SYSTEM)/$(REGAL.SHARED)
$(LOG_LD)$(CCACHE) $(LD) $(LDFLAGS.EXTRA) $(LDFLAGS.DYNAMIC) -o $@ $(GLUT.OBJS) $(GLUT.LIBS)
ifneq ($(RANLIB),)
$(LOG_RANLIB)$(RANLIB) $@
endif
ifneq ($(STRIP),)
$(LOG_STRIP)$(STRIP) -x $@
endif
endif
endif