forked from rocket/rocket
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
74 lines (56 loc) · 1.72 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
# default target
all:
.PHONY: all clean editor
QMAKE ?= qmake
# default build flags
CFLAGS += -g -O2 -Wall
# user-defined config file (if available)
-include config.mak
ifdef COMSPEC
X = .exe
OPENGL_LIBS = -lopengl32 -lglu32
SDL_LIBS = -lSDL
LDLIBS += -lws2_32
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S), Linux)
LIB_CPPFLAGS += -DUSE_GETADDRINFO
OPENGL_LIBS = -lGL -lGLU
else ifeq ($(UNAME_S), Darwin)
LIB_CPPFLAGS += -DUSE_GETADDRINFO
OPENGL_LIBS = -framework OpenGL
else
OPENGL_LIBS = -lGL -lGLU
endif
SDL_CFLAGS = $(shell sdl-config --cflags)
SDL_LIBS = $(shell sdl-config --libs)
LDLIBS += -lm
endif
LIB_OBJS = \
lib/device.o \
lib/track.o
all: lib/librocket.a lib/librocket-player.a editor
lib/%.o: CPPFLAGS += $(LIB_CPPFLAGS)
examples/%$X: CPPFLAGS += -Iexamples/include
examples/%$X: CXXFLAGS += $(SDL_CFLAGS)
examples/%$X: LDLIBS += -Lexamples/lib -lbass
examples/%$X: LDLIBS += $(OPENGL_LIBS) $(SDL_LIBS)
clean:
$(RM) $(LIB_OBJS) lib/librocket.a lib/librocket-player.a
$(RM) examples/example_bass$X examples/example_bass-player$X
if test -e editor/Makefile; then $(MAKE) -C editor clean; fi;
$(RM) editor/editor editor/Makefile
lib/librocket.a: $(LIB_OBJS)
$(AR) $(ARFLAGS) $@ $^
%.player.o : %.c
$(COMPILE.c) -DSYNC_PLAYER $(OUTPUT_OPTION) $<
lib/librocket-player.a: $(LIB_OBJS:.o=.player.o)
$(AR) $(ARFLAGS) $@ $^
examples/example_bass$X: examples/example_bass.cpp lib/librocket.a
$(LINK.cpp) $^ $(LOADLIBES) $(LDLIBS) -o $@
examples/example_bass-player$X: examples/example_bass.cpp lib/librocket-player.a
$(LINK.cpp) -DSYNC_PLAYER $^ $(LOADLIBES) $(LDLIBS) -o $@
editor/Makefile: editor/editor.pro
cd editor && $(QMAKE) editor.pro -o Makefile
editor: editor/Makefile
$(MAKE) -C editor