-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
108 lines (84 loc) · 2.41 KB
/
Makefile
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
104
105
106
107
108
# libscm -- Linux / OS X Makefile
ifdef DEBUG
CONFIG = Debug
CFLAGS += -g
else
CONFIG = Release
CFLAGS += -O2 -DNDEBUG
endif
#------------------------------------------------------------------------------
OBJS= \
util3d/glsl.o \
util3d/math3d.o \
util3d/type.o \
scm-cache.o \
scm-deque.o \
scm-file.o \
scm-frame.o \
scm-image.o \
scm-index.o \
scm-label.o \
scm-log.o \
scm-path.o \
scm-render.o \
scm-sample.o \
scm-scene.o \
scm-set.o \
scm-sphere.o \
scm-state.o \
scm-system.o \
scm-task.o
DEPS= $(OBJS:.o=.d)
LABEL_GLSL= \
scm_label_circle_frag.h \
scm_label_circle_vert.h \
scm_label_sprite_frag.h \
scm_label_sprite_vert.h
RENDER_GLSL= \
scm_render_blur_frag.h \
scm_render_blur_vert.h \
scm_render_both_frag.h \
scm_render_both_vert.h \
scm_render_atmo_frag.h \
scm_render_atmo_vert.h \
scm_render_fade_frag.h \
scm_render_fade_vert.h
GLSL= $(LABEL_GLSL) $(RENDER_GLSL)
#------------------------------------------------------------------------------
SDLCONF = $(firstword $(wildcard /usr/local/bin/sdl2-config \
/opt/local/bin/sdl2-config \
/usr/bin/sdl2-config) \
sdl2-config)
FT2CONF = $(firstword $(wildcard /usr/local/bin/freetype-config \
/opt/local/bin/freetype-config \
/usr/bin/freetype-config) \
freetype-config)
CONF = $(shell $(SDLCONF) --cflags) \
$(shell $(FT2CONF) --cflags)
TARGDIR = $(CONFIG)
TARG = libscm.a
#------------------------------------------------------------------------------
$(TARGDIR)/$(TARG) : $(TARGDIR) $(OBJS)
ar -r $(TARGDIR)/$(TARG) $(OBJS)
$(TARGDIR) :
mkdir -p $(TARGDIR)
clean:
$(RM) $(TARGDIR)/$(TARG) $(GLSL) $(OBJS) $(DEPS)
#------------------------------------------------------------------------------
# The bin2c tool embeds binary data in C sources.
B2C = etc/bin2c
$(B2C) : etc/bin2c.c
$(CC) -o $(B2C) etc/bin2c.c
#------------------------------------------------------------------------------
%.o : %.cpp
$(CXX) $(CFLAGS) $(CONF) -c $< -o $@
%.o : %.c
$(CC) $(CFLAGS) $(CONF) -c $< -o $@
%.h : %.glsl $(B2C)
$(B2C) $(basename $@) < $^ > $@
#------------------------------------------------------------------------------
scm-render.o : $(RENDER_GLSL)
scm-label.o : $(LABEL_GLSL)
ifneq ($(MAKECMDGOALS),clean)
-include $(DEPS)
endif