annotate Makefile @ 5:08e2ed7d5879

Improve build process.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 05 Aug 2013 14:07:43 +0300
parents 785057719d9b
children 470774c3b381
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
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
11 ###
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
12 ### Depency definitions
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
13 ###
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
14 BOOST_CFLAGS=-I/usr/include/
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
15 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
16
0
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
17 BASS_CFLAGS=-Ilibbass/
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
18 BASS_LDFLAGS=-L./ -lbass
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
19
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
20 ASSIMP_CFLAGS=-Iassimp--3.0.1270-source-only/include/
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
21 ASSIMP_LDFLAGS=-L./ -lassimp
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
22
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
23 FREETYPE_CFLAGS=`pkg-config freetype2 --cflags`
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
24 FREETYPE_LDFLAGS=`pkg-config freetype2 --libs`
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
25
5
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
26 LIBOGGPLAYER=liboggplayer-src/
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
27 LIBOGGPLAYER_CFLAGS=-I$(LIBOGGPLAYER)include/
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
28 LIBOGGPLAYER_LDFLAGS=`pkg-config --libs ogg vorbis theoradec`
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
29 LIBOGGPLAYER_A=$(LIBOGGPLAYER)lib/liboggplayer.a
0
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
30
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
31 GLEW_CFLAGS=`pkg-config glew --cflags`
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
32 GLEW_LDFLAGS=`pkg-config glew --libs`
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
33
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
34 GLUT_CFLAGS=-I/usr/include/GL/
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
35 GLUT_LDFLAGS=/usr/lib/i386-linux-gnu/libglut.a
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
36
5
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
37
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
38 DEMO_CFLAGS += $(BASS_CFLAGS) $(ASSIMP_CFLAGS) \
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
39 $(LIBOGGPLAYER_CFLAGS) $(FREETYPE_CFLAGS) \
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
40 $(GLEW_CFLAGS) $(GLUT_CFLAGS) \
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
41 $(FREETYPE_CFLAGS)
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
42
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
43 DEMO_LDFLAGS = $(BASS_LDFLAGS) $(ASSIMP_LDFLAGS) \
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
44 $(LIBOGGPLAYER_A) $(FREETYPE_LDFLAGS) \
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
45 $(GLEW_LDFLAGS) $(GLUT_LDFLAGS) \
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
46 $(FREETYPE_LDFLAGS) $(BOOST_LDFLAGS) \
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
47 $(LIBOGGPLAYER_LDFLAGS)
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
48
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
49
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 ### Source files etc
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
52 ###
0
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
53 TARGETS=demo.bin
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
54
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
55
5
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
56 DEMO_OBJS=vertex-attribute.o vertex-buffer.o \
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
57 texture-atlas.o texture-font.o mat4.o \
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
58 shader.o vector.o midifile.o \
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
59 midiutil.o main.o
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 LIBOGGPLAYER_OBJS= \
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
62 oggplayer.o open_close.o play.o \
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
63 SDL_audiocvt.o util.o
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
64
0
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
65
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
66 ###
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
67 ### Main targets
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
68 ###
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
69 all: $(TARGETS)
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
70
5
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
71 $(OBJPATH)%.o: $(LIBOGGPLAYER)src/%.cpp $(LIBOGGPLAYER)src/%.hpp
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
72 @echo " CXX $+"
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
73 $(CXX) $(CFLAGS) -c -o $@ $< $(LIBOGGPLAYER_CFLAGS) $(BOOST_CFLAGS)
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 $(OBJPATH)%.o: $(LIBOGGPLAYER)src/%.cpp
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
76 @echo " CXX $+"
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
77 $(CXX) $(CFLAGS) -c -o $@ $< $(LIBOGGPLAYER_CFLAGS) $(BOOST_CFLAGS)
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
78
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
79
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
80 $(OBJPATH)%.o: src/%.c src/%.h
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
81 @echo " CXX $+"
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
82 $(CXX) $(CFLAGS) -c -o $@ $< $(DEMO_CFLAGS)
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
83
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
84 $(OBJPATH)%.o: src/%.c
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
85 @echo " CXX $+"
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
86 $(CXX) $(CFLAGS) -c -o $@ $< $(DEMO_CFLAGS)
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
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
89 $(LIBOGGPLAYER_A): $(addprefix $(OBJPATH),$(LIBOGGPLAYER_OBJS))
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
90 @echo " AR $@ $+"
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
91 @$(AR) cru $@ $+
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
92 @echo " RANLIB $@"
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
93 @$(RANLIB) $@
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
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
96 demo.bin: $(addprefix $(OBJPATH),$(DEMO_OBJS)) $(LIBOGGPLAYER_A)
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
97 @echo " LINK $@ $+"
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
98 @$(CXX) $(CFLAGS) $(DEMO_CFLAGS) -o $@ $+ $(DEMO_LDFLAGS)
0
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
99
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
100
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
101 ###
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
102 ### Special targets
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
103 ###
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
104 clean:
5
08e2ed7d5879 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
105 $(RM) $(TARGETS) $(OBJPATH)*.o
0
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
106