annotate Makefile @ 32:0337b6606312

Add build32 and build64 targets.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 05 Aug 2013 19:24:08 +0300
parents b6b0be5ac50c
children 54e0fc833615
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
5
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
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
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
14 ###
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
15 BOOST_CFLAGS=-I/usr/include/
24
c88e8f589c32 Add libpthread.
Matti Hamalainen <ccr@tnsp.org>
parents: 23
diff changeset
16 BOOST_LDFLAGS=-lboost_thread -lboost_system -lpthread
12
2184f64b5b33 More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 11
diff changeset
17 #/usr/lib/libboost_thread.a /usr/lib/libboost_system.a
0
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
18
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
19 FREETYPE_CFLAGS=`pkg-config freetype2 --cflags`
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
20 FREETYPE_LDFLAGS=`pkg-config freetype2 --libs`
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
21
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
22 GLEW_CFLAGS=`pkg-config glew --cflags`
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
23 GLEW_LDFLAGS=`pkg-config glew --libs`
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
24
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
25 GLUT_CFLAGS=-I/usr/include/GL/
12
2184f64b5b33 More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 11
diff changeset
26 GLUT_LDFLAGS=-lglut
2184f64b5b33 More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 11
diff changeset
27 #/usr/lib/i386-linux-gnu/libglut.a
2184f64b5b33 More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 11
diff changeset
28
25
b6b0be5ac50c Add OpenGL linking.
Matti Hamalainen <ccr@tnsp.org>
parents: 24
diff changeset
29 OPENGL_CFLAGS=`pkg-config gl glu --cflags`
b6b0be5ac50c Add OpenGL linking.
Matti Hamalainen <ccr@tnsp.org>
parents: 24
diff changeset
30 OPENGL_LDFLAGS=`pkg-config gl glu --libs`
b6b0be5ac50c Add OpenGL linking.
Matti Hamalainen <ccr@tnsp.org>
parents: 24
diff changeset
31
12
2184f64b5b33 More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 11
diff changeset
32
2184f64b5b33 More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 11
diff changeset
33 ###
2184f64b5b33 More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 11
diff changeset
34 ### Included in source tree
2184f64b5b33 More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 11
diff changeset
35 ###
2184f64b5b33 More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 11
diff changeset
36 BASS_CFLAGS=-Ilibbass/
2184f64b5b33 More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 11
diff changeset
37 BASS_LDFLAGS=-L./lib/ -lbass
2184f64b5b33 More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 11
diff changeset
38
2184f64b5b33 More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 11
diff changeset
39 ASSIMP=assimp--3.0.1270-source-only/
2184f64b5b33 More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 11
diff changeset
40 ASSIMP_CFLAGS=-I$(ASSIMP)include/
2184f64b5b33 More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 11
diff changeset
41 ASSIMP_LDFLAGS=-L./lib/ -lassimp
2184f64b5b33 More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 11
diff changeset
42
2184f64b5b33 More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 11
diff changeset
43
2184f64b5b33 More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 11
diff changeset
44 LIBOGGPLAYER=liboggplayer-src/
2184f64b5b33 More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 11
diff changeset
45 LIBOGGPLAYER_CFLAGS=-I$(LIBOGGPLAYER)include/
2184f64b5b33 More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 11
diff changeset
46 #LIBOGGPLAYER_LDFLAGS=`pkg-config --libs ogg vorbis theoradec`
2184f64b5b33 More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 11
diff changeset
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
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
49
5
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
50
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
51 DEMO_CFLAGS += $(BASS_CFLAGS) $(ASSIMP_CFLAGS) \
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
52 $(LIBOGGPLAYER_CFLAGS) $(FREETYPE_CFLAGS) \
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
53 $(GLEW_CFLAGS) $(GLUT_CFLAGS) \
25
b6b0be5ac50c Add OpenGL linking.
Matti Hamalainen <ccr@tnsp.org>
parents: 24
diff changeset
54 $(FREETYPE_CFLAGS) $(OPENGL_CFLAGS)
5
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
55
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
56 DEMO_LDFLAGS = $(BASS_LDFLAGS) $(ASSIMP_LDFLAGS) \
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
57 $(LIBOGGPLAYER_A) $(FREETYPE_LDFLAGS) \
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
58 $(GLEW_LDFLAGS) $(GLUT_LDFLAGS) \
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
59 $(FREETYPE_LDFLAGS) $(BOOST_LDFLAGS) \
25
b6b0be5ac50c Add OpenGL linking.
Matti Hamalainen <ccr@tnsp.org>
parents: 24
diff changeset
60 $(LIBOGGPLAYER_LDFLAGS) $(OPENGL_LDFLAGS)
5
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
61
12
2184f64b5b33 More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 11
diff changeset
62
5
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
63
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
64 ###
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
65 ### Source files etc
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
66 ###
0
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
67 TARGETS=demo.bin
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
68
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
69
5
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
70 DEMO_OBJS=vertex-attribute.o vertex-buffer.o \
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
71 texture-atlas.o texture-font.o mat4.o \
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
72 shader.o vector.o midifile.o \
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
73 midiutil.o main.o
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
74
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
75 LIBOGGPLAYER_OBJS= \
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
76 oggplayer.o open_close.o play.o \
13
c859c22c1af5 Remove audio support from liboggplayer
Matti Hamalainen <ccr@tnsp.org>
parents: 12
diff changeset
77 util.o
5
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
78
0
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
79
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
80 ###
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
81 ### Main targets
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
82 ###
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
83 all: $(TARGETS)
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
84
5
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
85 $(OBJPATH)%.o: $(LIBOGGPLAYER)src/%.cpp $(LIBOGGPLAYER)src/%.hpp
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
86 @echo " CXX $+"
23
0dce9bac4043 Silence the build process slightly.
Matti Hamalainen <ccr@tnsp.org>
parents: 22
diff changeset
87 @$(CXX) $(CFLAGS) -c -o $@ $< $(LIBOGGPLAYER_CFLAGS) $(BOOST_CFLAGS)
5
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 $(OBJPATH)%.o: $(LIBOGGPLAYER)src/%.cpp
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
90 @echo " CXX $+"
23
0dce9bac4043 Silence the build process slightly.
Matti Hamalainen <ccr@tnsp.org>
parents: 22
diff changeset
91 @$(CXX) $(CFLAGS) -c -o $@ $< $(LIBOGGPLAYER_CFLAGS) $(BOOST_CFLAGS)
5
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
92
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 src/%.h
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
95 @echo " CXX $+"
23
0dce9bac4043 Silence the build process slightly.
Matti Hamalainen <ccr@tnsp.org>
parents: 22
diff changeset
96 @$(CXX) $(CFLAGS) -c -o $@ $< $(DEMO_CFLAGS)
5
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 $(OBJPATH)%.o: src/%.c
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
99 @echo " CXX $+"
23
0dce9bac4043 Silence the build process slightly.
Matti Hamalainen <ccr@tnsp.org>
parents: 22
diff changeset
100 @$(CXX) $(CFLAGS) -c -o $@ $< $(DEMO_CFLAGS)
5
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
101
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
102
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
103 $(LIBOGGPLAYER_A): $(addprefix $(OBJPATH),$(LIBOGGPLAYER_OBJS))
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
104 @echo " AR $@ $+"
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
105 @$(AR) cru $@ $+
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
106 @echo " RANLIB $@"
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
107 @$(RANLIB) $@
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
108
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
109
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
110 demo.bin: $(addprefix $(OBJPATH),$(DEMO_OBJS)) $(LIBOGGPLAYER_A)
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
111 @echo " LINK $@ $+"
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
112 @$(CXX) $(CFLAGS) $(DEMO_CFLAGS) -o $@ $+ $(DEMO_LDFLAGS)
0
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
113
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
114
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
115 ###
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
116 ### Special targets
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
117 ###
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
118 clean:
20
cef612f414ca Added dist-clean target.
Matti Hamalainen <ccr@tnsp.org>
parents: 16
diff changeset
119 $(RM) $(TARGETS) $(OBJPATH)*.o $(LIBOGGPLAYER_A)
cef612f414ca Added dist-clean target.
Matti Hamalainen <ccr@tnsp.org>
parents: 16
diff changeset
120
21
Matti Hamalainen <ccr@tnsp.org>
parents: 20
diff changeset
121 distclean: clean
20
cef612f414ca Added dist-clean target.
Matti Hamalainen <ccr@tnsp.org>
parents: 16
diff changeset
122 $(RM) -fr $(ASSIMP) libbass/
0
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
123
32
0337b6606312 Add build32 and build64 targets.
Matti Hamalainen <ccr@tnsp.org>
parents: 25
diff changeset
124
0337b6606312 Add build32 and build64 targets.
Matti Hamalainen <ccr@tnsp.org>
parents: 25
diff changeset
125 build-assimp:
15
a354578a41c6 Add library packages.
Matti Hamalainen <ccr@tnsp.org>
parents: 13
diff changeset
126 unzip assimp--3.0.1270-source-only.zip && \
a354578a41c6 Add library packages.
Matti Hamalainen <ccr@tnsp.org>
parents: 13
diff changeset
127 cd $(ASSIMP) && \
a354578a41c6 Add library packages.
Matti Hamalainen <ccr@tnsp.org>
parents: 13
diff changeset
128 cmake . -DENABLE_BOOST_WORKAROUND=ON && make
12
2184f64b5b33 More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 11
diff changeset
129
32
0337b6606312 Add build32 and build64 targets.
Matti Hamalainen <ccr@tnsp.org>
parents: 25
diff changeset
130 build-bass:
15
a354578a41c6 Add library packages.
Matti Hamalainen <ccr@tnsp.org>
parents: 13
diff changeset
131 mkdir libbass/ && cd libbass && unzip ../bass24-linux.zip
a354578a41c6 Add library packages.
Matti Hamalainen <ccr@tnsp.org>
parents: 13
diff changeset
132
32
0337b6606312 Add build32 and build64 targets.
Matti Hamalainen <ccr@tnsp.org>
parents: 25
diff changeset
133 libs32: $(ASSIMP)lib/libassimp.so libbass/libbass.so
16
25aef68f3073 Fix build target.
Matti Hamalainen <ccr@tnsp.org>
parents: 15
diff changeset
134 cp -d -p $(addsuffix *,$+) lib/
25aef68f3073 Fix build target.
Matti Hamalainen <ccr@tnsp.org>
parents: 15
diff changeset
135
32
0337b6606312 Add build32 and build64 targets.
Matti Hamalainen <ccr@tnsp.org>
parents: 25
diff changeset
136 libs64: $(ASSIMP)lib/libassimp.so libbass/x64/libbass.so
0337b6606312 Add build32 and build64 targets.
Matti Hamalainen <ccr@tnsp.org>
parents: 25
diff changeset
137 cp -d -p $(addsuffix *,$+) lib/
0337b6606312 Add build32 and build64 targets.
Matti Hamalainen <ccr@tnsp.org>
parents: 25
diff changeset
138
0337b6606312 Add build32 and build64 targets.
Matti Hamalainen <ccr@tnsp.org>
parents: 25
diff changeset
139 build32: build-assimp build-bass libs32 demo.bin
0337b6606312 Add build32 and build64 targets.
Matti Hamalainen <ccr@tnsp.org>
parents: 25
diff changeset
140
0337b6606312 Add build32 and build64 targets.
Matti Hamalainen <ccr@tnsp.org>
parents: 25
diff changeset
141 build64: build-assimp build-bass libs64 demo.bin