annotate Makefile @ 22:9316a55ea198

Fix liboggplayer.a target path.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 05 Aug 2013 18:07:02 +0300
parents c85ee156a83a
children 0dce9bac4043
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/
12
2184f64b5b33 More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 11
diff changeset
16 BOOST_LDFLAGS=-lboost_thread -lboost_system
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
2184f64b5b33 More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 11
diff changeset
29
2184f64b5b33 More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 11
diff changeset
30 ###
2184f64b5b33 More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 11
diff changeset
31 ### Included in source tree
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 BASS_CFLAGS=-Ilibbass/
2184f64b5b33 More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 11
diff changeset
34 BASS_LDFLAGS=-L./lib/ -lbass
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 ASSIMP=assimp--3.0.1270-source-only/
2184f64b5b33 More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 11
diff changeset
37 ASSIMP_CFLAGS=-I$(ASSIMP)include/
2184f64b5b33 More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 11
diff changeset
38 ASSIMP_LDFLAGS=-L./lib/ -lassimp
2184f64b5b33 More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 11
diff changeset
39
2184f64b5b33 More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 11
diff changeset
40
2184f64b5b33 More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 11
diff changeset
41 LIBOGGPLAYER=liboggplayer-src/
2184f64b5b33 More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 11
diff changeset
42 LIBOGGPLAYER_CFLAGS=-I$(LIBOGGPLAYER)include/
2184f64b5b33 More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 11
diff changeset
43 #LIBOGGPLAYER_LDFLAGS=`pkg-config --libs ogg vorbis theoradec`
2184f64b5b33 More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 11
diff changeset
44 LIBOGGPLAYER_LDFLAGS=`pkg-config --libs ogg theoradec`
22
9316a55ea198 Fix liboggplayer.a target path.
Matti Hamalainen <ccr@tnsp.org>
parents: 21
diff changeset
45 LIBOGGPLAYER_A=$(OBJPATH)liboggplayer.a
0
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
12
2184f64b5b33 More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 11
diff changeset
59
5
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 ###
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
62 ### Source files etc
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
63 ###
0
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
64 TARGETS=demo.bin
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
65
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
66
5
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
67 DEMO_OBJS=vertex-attribute.o vertex-buffer.o \
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
68 texture-atlas.o texture-font.o mat4.o \
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
69 shader.o vector.o midifile.o \
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
70 midiutil.o main.o
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
71
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
72 LIBOGGPLAYER_OBJS= \
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
73 oggplayer.o open_close.o play.o \
13
c859c22c1af5 Remove audio support from liboggplayer
Matti Hamalainen <ccr@tnsp.org>
parents: 12
diff changeset
74 util.o
5
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
75
0
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
76
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
77 ###
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
78 ### Main targets
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
79 ###
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
80 all: $(TARGETS)
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
81
5
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
82 $(OBJPATH)%.o: $(LIBOGGPLAYER)src/%.cpp $(LIBOGGPLAYER)src/%.hpp
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
83 @echo " CXX $+"
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
84 $(CXX) $(CFLAGS) -c -o $@ $< $(LIBOGGPLAYER_CFLAGS) $(BOOST_CFLAGS)
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
85
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
86 $(OBJPATH)%.o: $(LIBOGGPLAYER)src/%.cpp
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
87 @echo " CXX $+"
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
88 $(CXX) $(CFLAGS) -c -o $@ $< $(LIBOGGPLAYER_CFLAGS) $(BOOST_CFLAGS)
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
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
91 $(OBJPATH)%.o: src/%.c src/%.h
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
92 @echo " CXX $+"
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
93 $(CXX) $(CFLAGS) -c -o $@ $< $(DEMO_CFLAGS)
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
94
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
95 $(OBJPATH)%.o: src/%.c
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
96 @echo " CXX $+"
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
97 $(CXX) $(CFLAGS) -c -o $@ $< $(DEMO_CFLAGS)
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
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
100 $(LIBOGGPLAYER_A): $(addprefix $(OBJPATH),$(LIBOGGPLAYER_OBJS))
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
101 @echo " AR $@ $+"
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
102 @$(AR) cru $@ $+
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
103 @echo " RANLIB $@"
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
104 @$(RANLIB) $@
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
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
107 demo.bin: $(addprefix $(OBJPATH),$(DEMO_OBJS)) $(LIBOGGPLAYER_A)
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
108 @echo " LINK $@ $+"
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
109 @$(CXX) $(CFLAGS) $(DEMO_CFLAGS) -o $@ $+ $(DEMO_LDFLAGS)
0
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 ###
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
113 ### Special targets
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
114 ###
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
115 clean:
20
cef612f414ca Added dist-clean target.
Matti Hamalainen <ccr@tnsp.org>
parents: 16
diff changeset
116 $(RM) $(TARGETS) $(OBJPATH)*.o $(LIBOGGPLAYER_A)
cef612f414ca Added dist-clean target.
Matti Hamalainen <ccr@tnsp.org>
parents: 16
diff changeset
117
21
Matti Hamalainen <ccr@tnsp.org>
parents: 20
diff changeset
118 distclean: clean
20
cef612f414ca Added dist-clean target.
Matti Hamalainen <ccr@tnsp.org>
parents: 16
diff changeset
119 $(RM) -fr $(ASSIMP) libbass/
0
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
120
15
a354578a41c6 Add library packages.
Matti Hamalainen <ccr@tnsp.org>
parents: 13
diff changeset
121 $(ASSIMP)lib/libassimp.so:
a354578a41c6 Add library packages.
Matti Hamalainen <ccr@tnsp.org>
parents: 13
diff changeset
122 unzip assimp--3.0.1270-source-only.zip && \
a354578a41c6 Add library packages.
Matti Hamalainen <ccr@tnsp.org>
parents: 13
diff changeset
123 cd $(ASSIMP) && \
a354578a41c6 Add library packages.
Matti Hamalainen <ccr@tnsp.org>
parents: 13
diff changeset
124 cmake . -DENABLE_BOOST_WORKAROUND=ON && make
12
2184f64b5b33 More cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 11
diff changeset
125
15
a354578a41c6 Add library packages.
Matti Hamalainen <ccr@tnsp.org>
parents: 13
diff changeset
126 libbass/libbass.so:
a354578a41c6 Add library packages.
Matti Hamalainen <ccr@tnsp.org>
parents: 13
diff changeset
127 mkdir libbass/ && cd libbass && unzip ../bass24-linux.zip
a354578a41c6 Add library packages.
Matti Hamalainen <ccr@tnsp.org>
parents: 13
diff changeset
128
16
25aef68f3073 Fix build target.
Matti Hamalainen <ccr@tnsp.org>
parents: 15
diff changeset
129 libs: $(ASSIMP)lib/libassimp.so libbass/libbass.so
25aef68f3073 Fix build target.
Matti Hamalainen <ccr@tnsp.org>
parents: 15
diff changeset
130 cp -d -p $(addsuffix *,$+) lib/
25aef68f3073 Fix build target.
Matti Hamalainen <ccr@tnsp.org>
parents: 15
diff changeset
131
25aef68f3073 Fix build target.
Matti Hamalainen <ccr@tnsp.org>
parents: 15
diff changeset
132 build: libs demo.bin