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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
1 CXX=g++
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
2 CFLAGS = -g -O3 -W -Wall
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
3 LDFLAGS = -s
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
4 AR=ar
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
5 RANLIB=ranlib
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
6
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
7 DEMO_CFLAGS = -fpermissive
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
8
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
9 OBJPATH=obj/
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
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
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
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
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
23 ###
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
24 BOOST_CFLAGS=-I/usr/include/
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
25 BOOST_LDFLAGS=/usr/lib/libboost_thread.a /usr/lib/libboost_system.a
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
26
0
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
27 BASS_CFLAGS=-Ilibbass/
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
28 BASS_LDFLAGS=-L./ -lbass
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
29
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
30 ASSIMP_CFLAGS=-Iassimp--3.0.1270-source-only/include/
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
31 ASSIMP_LDFLAGS=-L./ -lassimp
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
32
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
33 FREETYPE_CFLAGS=`pkg-config freetype2 --cflags`
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
34 FREETYPE_LDFLAGS=`pkg-config freetype2 --libs`
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
35
5
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
36 LIBOGGPLAYER=liboggplayer-src/
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
37 LIBOGGPLAYER_CFLAGS=-I$(LIBOGGPLAYER)include/
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
38 LIBOGGPLAYER_LDFLAGS=`pkg-config --libs ogg vorbis theoradec`
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
39 LIBOGGPLAYER_A=$(LIBOGGPLAYER)lib/liboggplayer.a
0
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
40
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
41 GLEW_CFLAGS=`pkg-config glew --cflags`
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
42 GLEW_LDFLAGS=`pkg-config glew --libs`
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
43
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
44 GLUT_CFLAGS=-I/usr/include/GL/
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
45 GLUT_LDFLAGS=/usr/lib/i386-linux-gnu/libglut.a
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
46
5
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
47
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
48 DEMO_CFLAGS += $(BASS_CFLAGS) $(ASSIMP_CFLAGS) \
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
49 $(LIBOGGPLAYER_CFLAGS) $(FREETYPE_CFLAGS) \
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
50 $(GLEW_CFLAGS) $(GLUT_CFLAGS) \
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
51 $(FREETYPE_CFLAGS)
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
52
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
53 DEMO_LDFLAGS = $(BASS_LDFLAGS) $(ASSIMP_LDFLAGS) \
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
54 $(LIBOGGPLAYER_A) $(FREETYPE_LDFLAGS) \
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
55 $(GLEW_LDFLAGS) $(GLUT_LDFLAGS) \
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
56 $(FREETYPE_LDFLAGS) $(BOOST_LDFLAGS) \
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
57 $(LIBOGGPLAYER_LDFLAGS)
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
58
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
59
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
60 ###
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
61 ### Source files etc
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
62 ###
0
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
63 TARGETS=demo.bin
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
64
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
65
5
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
66 DEMO_OBJS=vertex-attribute.o vertex-buffer.o \
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
67 texture-atlas.o texture-font.o mat4.o \
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
68 shader.o vector.o midifile.o \
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
69 midiutil.o main.o
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
70
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
71 LIBOGGPLAYER_OBJS= \
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
72 oggplayer.o open_close.o play.o \
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
73 SDL_audiocvt.o util.o
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
74
0
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
75
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
76 ###
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
77 ### Main targets
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
78 ###
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
79 all: $(TARGETS)
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
80
5
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
81 $(OBJPATH)%.o: $(LIBOGGPLAYER)src/%.cpp $(LIBOGGPLAYER)src/%.hpp
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
82 @echo " CXX $+"
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
83 $(CXX) $(CFLAGS) -c -o $@ $< $(LIBOGGPLAYER_CFLAGS) $(BOOST_CFLAGS)
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
84
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
85 $(OBJPATH)%.o: $(LIBOGGPLAYER)src/%.cpp
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
86 @echo " CXX $+"
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
87 $(CXX) $(CFLAGS) -c -o $@ $< $(LIBOGGPLAYER_CFLAGS) $(BOOST_CFLAGS)
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
88
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
89
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
90 $(OBJPATH)%.o: src/%.c src/%.h
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
91 @echo " CXX $+"
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
92 $(CXX) $(CFLAGS) -c -o $@ $< $(DEMO_CFLAGS)
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
93
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
94 $(OBJPATH)%.o: src/%.c
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
95 @echo " CXX $+"
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
96 $(CXX) $(CFLAGS) -c -o $@ $< $(DEMO_CFLAGS)
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
97
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
98
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
99 $(LIBOGGPLAYER_A): $(addprefix $(OBJPATH),$(LIBOGGPLAYER_OBJS))
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
100 @echo " AR $@ $+"
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
101 @$(AR) cru $@ $+
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
102 @echo " RANLIB $@"
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
103 @$(RANLIB) $@
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
104
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
105
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
106 demo.bin: $(addprefix $(OBJPATH),$(DEMO_OBJS)) $(LIBOGGPLAYER_A)
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
107 @echo " LINK $@ $+"
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
108 @$(CXX) $(CFLAGS) $(DEMO_CFLAGS) -o $@ $+ $(DEMO_LDFLAGS)
0
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
109
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
110
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
111 ###
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
112 ### Special targets
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
113 ###
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
114 clean:
5
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
115 $(RM) $(TARGETS) $(OBJPATH)*.o
0
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
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/