annotate Makefile @ 62:301805d68a97 default tip

Clean up better.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 06 Jan 2015 04:33:07 +0200
parents d85542c96791
children
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
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
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
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
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
73
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
74 LIBOGGPLAYER_OBJS= \
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
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
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
77
0
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
78
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
79 ###
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
80 ### Main targets
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
81 ###
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
82 all: $(TARGETS)
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
83
5
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
84 $(OBJPATH)%.o: $(LIBOGGPLAYER)src/%.cpp $(LIBOGGPLAYER)src/%.hpp
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
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
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
87
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
88 $(OBJPATH)%.o: $(LIBOGGPLAYER)src/%.cpp
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
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
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
91
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 $(OBJPATH)%.o: src/%.c src/%.h
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
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
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
96
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
97 $(OBJPATH)%.o: src/%.c
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
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
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
100
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
101
43
d00b967c48f2 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 39
diff changeset
102 $(OBJPATH)main.o: src/main.c src/stb_image.c src/ggets.c src/ggets.h
d00b967c48f2 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 39
diff changeset
103 @echo " CXX $+"
d00b967c48f2 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 39
diff changeset
104 @$(CXX) $(CFLAGS) -c -o $@ $< $(DEMO_CFLAGS)
d00b967c48f2 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 39
diff changeset
105
d00b967c48f2 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 39
diff changeset
106
5
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
107 $(LIBOGGPLAYER_A): $(addprefix $(OBJPATH),$(LIBOGGPLAYER_OBJS))
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
108 @echo " AR $@ $+"
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
109 @$(AR) cru $@ $+
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
110 @echo " RANLIB $@"
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
111 @$(RANLIB) $@
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
112
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
113
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
114 demo.bin: $(addprefix $(OBJPATH),$(DEMO_OBJS)) $(LIBOGGPLAYER_A)
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
115 @echo " LINK $@ $+"
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
116 @$(CXX) $(CFLAGS) $(DEMO_CFLAGS) -o $@ $+ $(DEMO_LDFLAGS)
0
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
117
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
118
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
119 ###
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
120 ### Special targets
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
121 ###
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
122 clean:
20
cef612f414ca Added dist-clean target.
Matti Hamalainen <ccr@tnsp.org>
parents: 16
diff changeset
123 $(RM) $(TARGETS) $(OBJPATH)*.o $(LIBOGGPLAYER_A)
cef612f414ca Added dist-clean target.
Matti Hamalainen <ccr@tnsp.org>
parents: 16
diff changeset
124
21
Matti Hamalainen <ccr@tnsp.org>
parents: 20
diff changeset
125 distclean: clean
62
301805d68a97 Clean up better.
Matti Hamalainen <ccr@tnsp.org>
parents: 45
diff changeset
126 $(RM) -fr $(ASSIMP) lib/lib* libbass/
0
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
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
a354578a41c6 Add library packages.
Matti Hamalainen <ccr@tnsp.org>
parents: 13
diff changeset
130 unzip assimp--3.0.1270-source-only.zip && \
a354578a41c6 Add library packages.
Matti Hamalainen <ccr@tnsp.org>
parents: 13
diff changeset
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
2184f64b5b33 More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 11
diff changeset
134
32
0337b6606312 Add build32 and build64 targets.
Matti Hamalainen <ccr@tnsp.org>
parents: 25
diff changeset
135 build-bass:
15
a354578a41c6 Add library packages.
Matti Hamalainen <ccr@tnsp.org>
parents: 13
diff changeset
136 mkdir libbass/ && cd libbass && unzip ../bass24-linux.zip
a354578a41c6 Add library packages.
Matti Hamalainen <ccr@tnsp.org>
parents: 13
diff changeset
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
25aef68f3073 Fix build target.
Matti Hamalainen <ccr@tnsp.org>
parents: 15
diff changeset
139 cp -d -p $(addsuffix *,$+) lib/
25aef68f3073 Fix build target.
Matti Hamalainen <ccr@tnsp.org>
parents: 15
diff changeset
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