Mercurial > hg > forks > bilotrip-mj12
annotate Makefile @ 58:1099b8eb152a
Cosmetics.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 06 Aug 2013 23:15:34 +0300 |
parents | d85542c96791 |
children | 301805d68a97 |
rev | line source |
---|---|
5 | 1 CXX=g++ |
2 CFLAGS = -g -O3 -W -Wall | |
3 LDFLAGS = -s | |
4 AR=ar | |
5 RANLIB=ranlib | |
6 | |
7 DEMO_CFLAGS = -fpermissive | |
8 | |
9 OBJPATH=obj/ | |
10 | |
11
470774c3b381
Make a target for collecting the necessary libraries under lib/
Matti Hamalainen <ccr@tnsp.org>
parents:
5
diff
changeset
|
11 |
5 | 12 ### |
11
470774c3b381
Make a target for collecting the necessary libraries under lib/
Matti Hamalainen <ccr@tnsp.org>
parents:
5
diff
changeset
|
13 ### Depency library definitions |
5 | 14 ### |
15 BOOST_CFLAGS=-I/usr/include/ | |
24 | 16 BOOST_LDFLAGS=-lboost_thread -lboost_system -lpthread |
12 | 17 #/usr/lib/libboost_thread.a /usr/lib/libboost_system.a |
0 | 18 |
19 FREETYPE_CFLAGS=`pkg-config freetype2 --cflags` | |
20 FREETYPE_LDFLAGS=`pkg-config freetype2 --libs` | |
21 | |
22 GLEW_CFLAGS=`pkg-config glew --cflags` | |
23 GLEW_LDFLAGS=`pkg-config glew --libs` | |
24 | |
25 GLUT_CFLAGS=-I/usr/include/GL/ | |
12 | 26 GLUT_LDFLAGS=-lglut |
27 #/usr/lib/i386-linux-gnu/libglut.a | |
28 | |
25 | 29 OPENGL_CFLAGS=`pkg-config gl glu --cflags` |
30 OPENGL_LDFLAGS=`pkg-config gl glu --libs` | |
31 | |
12 | 32 |
33 ### | |
34 ### Included in source tree | |
35 ### | |
36 BASS_CFLAGS=-Ilibbass/ | |
37 BASS_LDFLAGS=-L./lib/ -lbass | |
38 | |
39 ASSIMP=assimp--3.0.1270-source-only/ | |
40 ASSIMP_CFLAGS=-I$(ASSIMP)include/ | |
41 ASSIMP_LDFLAGS=-L./lib/ -lassimp | |
42 | |
43 | |
44 LIBOGGPLAYER=liboggplayer-src/ | |
45 LIBOGGPLAYER_CFLAGS=-I$(LIBOGGPLAYER)include/ | |
46 #LIBOGGPLAYER_LDFLAGS=`pkg-config --libs ogg vorbis theoradec` | |
47 LIBOGGPLAYER_LDFLAGS=`pkg-config --libs ogg theoradec` | |
22
9316a55ea198
Fix liboggplayer.a target path.
Matti Hamalainen <ccr@tnsp.org>
parents:
21
diff
changeset
|
48 LIBOGGPLAYER_A=$(OBJPATH)liboggplayer.a |
0 | 49 |
5 | 50 |
51 DEMO_CFLAGS += $(BASS_CFLAGS) $(ASSIMP_CFLAGS) \ | |
52 $(LIBOGGPLAYER_CFLAGS) $(FREETYPE_CFLAGS) \ | |
53 $(GLEW_CFLAGS) $(GLUT_CFLAGS) \ | |
25 | 54 $(FREETYPE_CFLAGS) $(OPENGL_CFLAGS) |
5 | 55 |
56 DEMO_LDFLAGS = $(BASS_LDFLAGS) $(ASSIMP_LDFLAGS) \ | |
57 $(LIBOGGPLAYER_A) $(FREETYPE_LDFLAGS) \ | |
58 $(GLEW_LDFLAGS) $(GLUT_LDFLAGS) \ | |
59 $(FREETYPE_LDFLAGS) $(BOOST_LDFLAGS) \ | |
25 | 60 $(LIBOGGPLAYER_LDFLAGS) $(OPENGL_LDFLAGS) |
5 | 61 |
12 | 62 |
5 | 63 |
64 ### | |
65 ### Source files etc | |
66 ### | |
0 | 67 TARGETS=demo.bin |
68 | |
69 | |
45
d85542c96791
Clean up the build some more, move platform specifics again.
Matti Hamalainen <ccr@tnsp.org>
parents:
43
diff
changeset
|
70 DEMO_OBJS=platform.o vertex-attribute.o vertex-buffer.o \ |
5 | 71 texture-atlas.o texture-font.o mat4.o \ |
45
d85542c96791
Clean up the build some more, move platform specifics again.
Matti Hamalainen <ccr@tnsp.org>
parents:
43
diff
changeset
|
72 shader.o vector.o midifile.o midiutil.o main.o |
5 | 73 |
74 LIBOGGPLAYER_OBJS= \ | |
75 oggplayer.o open_close.o play.o \ | |
13
c859c22c1af5
Remove audio support from liboggplayer
Matti Hamalainen <ccr@tnsp.org>
parents:
12
diff
changeset
|
76 util.o |
5 | 77 |
0 | 78 |
79 ### | |
80 ### Main targets | |
81 ### | |
82 all: $(TARGETS) | |
83 | |
5 | 84 $(OBJPATH)%.o: $(LIBOGGPLAYER)src/%.cpp $(LIBOGGPLAYER)src/%.hpp |
85 @echo " CXX $+" | |
23
0dce9bac4043
Silence the build process slightly.
Matti Hamalainen <ccr@tnsp.org>
parents:
22
diff
changeset
|
86 @$(CXX) $(CFLAGS) -c -o $@ $< $(LIBOGGPLAYER_CFLAGS) $(BOOST_CFLAGS) |
5 | 87 |
88 $(OBJPATH)%.o: $(LIBOGGPLAYER)src/%.cpp | |
89 @echo " CXX $+" | |
23
0dce9bac4043
Silence the build process slightly.
Matti Hamalainen <ccr@tnsp.org>
parents:
22
diff
changeset
|
90 @$(CXX) $(CFLAGS) -c -o $@ $< $(LIBOGGPLAYER_CFLAGS) $(BOOST_CFLAGS) |
5 | 91 |
92 | |
93 $(OBJPATH)%.o: src/%.c src/%.h | |
94 @echo " CXX $+" | |
23
0dce9bac4043
Silence the build process slightly.
Matti Hamalainen <ccr@tnsp.org>
parents:
22
diff
changeset
|
95 @$(CXX) $(CFLAGS) -c -o $@ $< $(DEMO_CFLAGS) |
5 | 96 |
97 $(OBJPATH)%.o: src/%.c | |
98 @echo " CXX $+" | |
23
0dce9bac4043
Silence the build process slightly.
Matti Hamalainen <ccr@tnsp.org>
parents:
22
diff
changeset
|
99 @$(CXX) $(CFLAGS) -c -o $@ $< $(DEMO_CFLAGS) |
5 | 100 |
101 | |
43 | 102 $(OBJPATH)main.o: src/main.c src/stb_image.c src/ggets.c src/ggets.h |
103 @echo " CXX $+" | |
104 @$(CXX) $(CFLAGS) -c -o $@ $< $(DEMO_CFLAGS) | |
105 | |
106 | |
5 | 107 $(LIBOGGPLAYER_A): $(addprefix $(OBJPATH),$(LIBOGGPLAYER_OBJS)) |
108 @echo " AR $@ $+" | |
109 @$(AR) cru $@ $+ | |
110 @echo " RANLIB $@" | |
111 @$(RANLIB) $@ | |
112 | |
113 | |
114 demo.bin: $(addprefix $(OBJPATH),$(DEMO_OBJS)) $(LIBOGGPLAYER_A) | |
115 @echo " LINK $@ $+" | |
116 @$(CXX) $(CFLAGS) $(DEMO_CFLAGS) -o $@ $+ $(DEMO_LDFLAGS) | |
0 | 117 |
118 | |
119 ### | |
120 ### Special targets | |
121 ### | |
122 clean: | |
20 | 123 $(RM) $(TARGETS) $(OBJPATH)*.o $(LIBOGGPLAYER_A) |
124 | |
21 | 125 distclean: clean |
20 | 126 $(RM) -fr $(ASSIMP) libbass/ |
0 | 127 |
32
0337b6606312
Add build32 and build64 targets.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
128 |
0337b6606312
Add build32 and build64 targets.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
129 build-assimp: |
15 | 130 unzip assimp--3.0.1270-source-only.zip && \ |
131 cd $(ASSIMP) && \ | |
39
54e0fc833615
Add -j4 to sub-build of assimp.
Matti Hamalainen <ccr@tnsp.org>
parents:
32
diff
changeset
|
132 cmake . -DENABLE_BOOST_WORKAROUND=ON && \ |
54e0fc833615
Add -j4 to sub-build of assimp.
Matti Hamalainen <ccr@tnsp.org>
parents:
32
diff
changeset
|
133 make -j4 |
12 | 134 |
32
0337b6606312
Add build32 and build64 targets.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
135 build-bass: |
15 | 136 mkdir libbass/ && cd libbass && unzip ../bass24-linux.zip |
137 | |
32
0337b6606312
Add build32 and build64 targets.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
138 libs32: $(ASSIMP)lib/libassimp.so libbass/libbass.so |
16 | 139 cp -d -p $(addsuffix *,$+) lib/ |
140 | |
32
0337b6606312
Add build32 and build64 targets.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
141 libs64: $(ASSIMP)lib/libassimp.so libbass/x64/libbass.so |
0337b6606312
Add build32 and build64 targets.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
142 cp -d -p $(addsuffix *,$+) lib/ |
0337b6606312
Add build32 and build64 targets.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
143 |
0337b6606312
Add build32 and build64 targets.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
144 build32: build-assimp build-bass libs32 demo.bin |
0337b6606312
Add build32 and build64 targets.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
145 |
0337b6606312
Add build32 and build64 targets.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
146 build64: build-assimp build-bass libs64 demo.bin |