Mercurial > hg > forks > bilotrip-mj12
annotate Makefile @ 11:470774c3b381
Make a target for collecting the necessary libraries under lib/
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 05 Aug 2013 15:02:50 +0300 |
parents | 08e2ed7d5879 |
children | 2184f64b5b33 |
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 ADD_LIBS=\ |
470774c3b381
Make a target for collecting the necessary libraries under lib/
Matti Hamalainen <ccr@tnsp.org>
parents:
5
diff
changeset
|
12 /usr/lib/i386-linux-gnu/libfreetype.so \ |
470774c3b381
Make a target for collecting the necessary libraries under lib/
Matti Hamalainen <ccr@tnsp.org>
parents:
5
diff
changeset
|
13 assimp--3.0.1270-source-only/lib/libassimp.so \ |
470774c3b381
Make a target for collecting the necessary libraries under lib/
Matti Hamalainen <ccr@tnsp.org>
parents:
5
diff
changeset
|
14 libbass/libbass.so \ |
470774c3b381
Make a target for collecting the necessary libraries under lib/
Matti Hamalainen <ccr@tnsp.org>
parents:
5
diff
changeset
|
15 /usr/lib/i386-linux-gnu/libGLEW.so \ |
470774c3b381
Make a target for collecting the necessary libraries under lib/
Matti Hamalainen <ccr@tnsp.org>
parents:
5
diff
changeset
|
16 /usr/lib/i386-linux-gnu/libvorbis.so \ |
470774c3b381
Make a target for collecting the necessary libraries under lib/
Matti Hamalainen <ccr@tnsp.org>
parents:
5
diff
changeset
|
17 /usr/lib/i386-linux-gnu/libtheoradec.so \ |
470774c3b381
Make a target for collecting the necessary libraries under lib/
Matti Hamalainen <ccr@tnsp.org>
parents:
5
diff
changeset
|
18 /usr/lib/i386-linux-gnu/libogg.so \ |
470774c3b381
Make a target for collecting the necessary libraries under lib/
Matti Hamalainen <ccr@tnsp.org>
parents:
5
diff
changeset
|
19 /usr/lib/i386-linux-gnu/libstdc++.so.6 |
470774c3b381
Make a target for collecting the necessary libraries under lib/
Matti Hamalainen <ccr@tnsp.org>
parents:
5
diff
changeset
|
20 |
5 | 21 ### |
11
470774c3b381
Make a target for collecting the necessary libraries under lib/
Matti Hamalainen <ccr@tnsp.org>
parents:
5
diff
changeset
|
22 ### Depency library definitions |
5 | 23 ### |
24 BOOST_CFLAGS=-I/usr/include/ | |
25 BOOST_LDFLAGS=/usr/lib/libboost_thread.a /usr/lib/libboost_system.a | |
26 | |
0 | 27 BASS_CFLAGS=-Ilibbass/ |
28 BASS_LDFLAGS=-L./ -lbass | |
29 | |
30 ASSIMP_CFLAGS=-Iassimp--3.0.1270-source-only/include/ | |
31 ASSIMP_LDFLAGS=-L./ -lassimp | |
32 | |
33 FREETYPE_CFLAGS=`pkg-config freetype2 --cflags` | |
34 FREETYPE_LDFLAGS=`pkg-config freetype2 --libs` | |
35 | |
5 | 36 LIBOGGPLAYER=liboggplayer-src/ |
37 LIBOGGPLAYER_CFLAGS=-I$(LIBOGGPLAYER)include/ | |
38 LIBOGGPLAYER_LDFLAGS=`pkg-config --libs ogg vorbis theoradec` | |
39 LIBOGGPLAYER_A=$(LIBOGGPLAYER)lib/liboggplayer.a | |
0 | 40 |
41 GLEW_CFLAGS=`pkg-config glew --cflags` | |
42 GLEW_LDFLAGS=`pkg-config glew --libs` | |
43 | |
44 GLUT_CFLAGS=-I/usr/include/GL/ | |
45 GLUT_LDFLAGS=/usr/lib/i386-linux-gnu/libglut.a | |
46 | |
5 | 47 |
48 DEMO_CFLAGS += $(BASS_CFLAGS) $(ASSIMP_CFLAGS) \ | |
49 $(LIBOGGPLAYER_CFLAGS) $(FREETYPE_CFLAGS) \ | |
50 $(GLEW_CFLAGS) $(GLUT_CFLAGS) \ | |
51 $(FREETYPE_CFLAGS) | |
52 | |
53 DEMO_LDFLAGS = $(BASS_LDFLAGS) $(ASSIMP_LDFLAGS) \ | |
54 $(LIBOGGPLAYER_A) $(FREETYPE_LDFLAGS) \ | |
55 $(GLEW_LDFLAGS) $(GLUT_LDFLAGS) \ | |
56 $(FREETYPE_LDFLAGS) $(BOOST_LDFLAGS) \ | |
57 $(LIBOGGPLAYER_LDFLAGS) | |
58 | |
59 | |
60 ### | |
61 ### Source files etc | |
62 ### | |
0 | 63 TARGETS=demo.bin |
64 | |
65 | |
5 | 66 DEMO_OBJS=vertex-attribute.o vertex-buffer.o \ |
67 texture-atlas.o texture-font.o mat4.o \ | |
68 shader.o vector.o midifile.o \ | |
69 midiutil.o main.o | |
70 | |
71 LIBOGGPLAYER_OBJS= \ | |
72 oggplayer.o open_close.o play.o \ | |
73 SDL_audiocvt.o util.o | |
74 | |
0 | 75 |
76 ### | |
77 ### Main targets | |
78 ### | |
79 all: $(TARGETS) | |
80 | |
5 | 81 $(OBJPATH)%.o: $(LIBOGGPLAYER)src/%.cpp $(LIBOGGPLAYER)src/%.hpp |
82 @echo " CXX $+" | |
83 $(CXX) $(CFLAGS) -c -o $@ $< $(LIBOGGPLAYER_CFLAGS) $(BOOST_CFLAGS) | |
84 | |
85 $(OBJPATH)%.o: $(LIBOGGPLAYER)src/%.cpp | |
86 @echo " CXX $+" | |
87 $(CXX) $(CFLAGS) -c -o $@ $< $(LIBOGGPLAYER_CFLAGS) $(BOOST_CFLAGS) | |
88 | |
89 | |
90 $(OBJPATH)%.o: src/%.c src/%.h | |
91 @echo " CXX $+" | |
92 $(CXX) $(CFLAGS) -c -o $@ $< $(DEMO_CFLAGS) | |
93 | |
94 $(OBJPATH)%.o: src/%.c | |
95 @echo " CXX $+" | |
96 $(CXX) $(CFLAGS) -c -o $@ $< $(DEMO_CFLAGS) | |
97 | |
98 | |
99 $(LIBOGGPLAYER_A): $(addprefix $(OBJPATH),$(LIBOGGPLAYER_OBJS)) | |
100 @echo " AR $@ $+" | |
101 @$(AR) cru $@ $+ | |
102 @echo " RANLIB $@" | |
103 @$(RANLIB) $@ | |
104 | |
105 | |
106 demo.bin: $(addprefix $(OBJPATH),$(DEMO_OBJS)) $(LIBOGGPLAYER_A) | |
107 @echo " LINK $@ $+" | |
108 @$(CXX) $(CFLAGS) $(DEMO_CFLAGS) -o $@ $+ $(DEMO_LDFLAGS) | |
0 | 109 |
110 | |
111 ### | |
112 ### Special targets | |
113 ### | |
114 clean: | |
5 | 115 $(RM) $(TARGETS) $(OBJPATH)*.o |
0 | 116 |
11
470774c3b381
Make a target for collecting the necessary libraries under lib/
Matti Hamalainen <ccr@tnsp.org>
parents:
5
diff
changeset
|
117 build: demo.bin $(ADD_LIBS) |
470774c3b381
Make a target for collecting the necessary libraries under lib/
Matti Hamalainen <ccr@tnsp.org>
parents:
5
diff
changeset
|
118 cp -d -p $(addsuffix *,$(ADD_LIBS)) lib/ |