-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile.linux
200 lines (165 loc) · 7.17 KB
/
Makefile.linux
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
MOYAICLISRCS=common.cpp cumino.cpp lodepng.cpp Prop2D.cpp Prop3D.cpp ColorReplacerShader.cpp Font.cpp FragmentShader.cpp IndexBuffer.cpp Layer.cpp MoyaiClient.cpp TextBox.cpp Prim.cpp Texture.cpp VertexBuffer.cpp Viewport.cpp DrawBatch.cpp Camera.cpp CharGrid.cpp Grid.cpp Mesh.cpp Pad.cpp PerformanceCounter.cpp PrimDrawer.cpp Sound.cpp SoundSystem.cpp VertexFormat.cpp TileDeck.cpp Remote.cpp Keyboard.cpp JPEGCoder.cpp GLFWemu.cpp GLemu.cpp
UTF8SRC=ConvertUTF.c
UTF8OBJ=ConvertUTF.o
MOYAICLIOBJS=$(MOYAICLISRCS:.cpp=.o) $(UTF8OBJ)
MOYAISVSRCS=common.cpp cumino.cpp lodepng.cpp Camera.cpp Grid.cpp
MOYAISVOBJS=$(MOYAISVSRCS:.cpp=.o) $(UTF8OBJ)
DEMO2DSRCS=demo2d.cpp
DEMO2DOBJS=$(DEMO2DSRCS:.cpp=.o)
DEMO3DSRCS=demo3d.cpp
DEMO3DOBJS=$(DEMO3DSRCS:.cpp=.o)
MIN2DSRCS=min2d.cpp
MIN2DOBJS=$(MIN2DSRCS:.cpp=.o)
VIEWERSRCS=vw.cpp
VIEWEROBJS=$(VIEWERSRCS:.cpp=.o)
DYNCAM2DSRCS=dyncam2d.cpp
DYNCAM2DOBJS=$(DYNCAM2DSRCS:.cpp=.o)
LIBUV=libuv-1.20.2
LIBUVLIB=$(LIBUV)/.libs/libuv.a # Don't use -luv, no rpm for centos7
BZ2=bzip2-1.0.6
BZ2LIB=$(BZ2)/libbz2.a # build product of bz2 source
ZLIB=zlib-1.2.7
ZLIBLIB=$(ZLIB)/libz.a
SNAPPYOBJS=snappy/snappy-sinksource.o snappy/snappy-c.o snappy/snappy.o
OUTCLILIB=libmoyaicl.a
OUTSVLIB=libmoyaisv.a
SNAPPYLIB=libsnappy.a
JPEGLIB=jpeg-8d/libjpeg.a
EXTCOMMONLIBS= $(ZLIBLIB) $(BZ2LIB) $(LIBPNGLIB) $(SNAPPYLIB) $(JPEGLIB) $(LIBUVLIB)
EXTCLILIBS = $(EXTCOMMONLIBS)
CLILIBFLAGS=-m64 -L/usr/local/lib -lpthread
CFLAGS=-O0 -I/usr/local/include -Wall -m64 -I. -I$(LIBUV)/include -g
CFLAGS0X=-std=c++0x $(CFLAGS)
JPEGOBJS=jpeg-8d/jaricom.o jpeg-8d/jcapimin.o jpeg-8d/jcapistd.o jpeg-8d/jcarith.o jpeg-8d/jccoefct.o jpeg-8d/jccolor.o jpeg-8d/jcdctmgr.o jpeg-8d/jchuff.o jpeg-8d/jcinit.o jpeg-8d/jcmainct.o jpeg-8d/jcmarker.o jpeg-8d/jcmaster.o jpeg-8d/jcomapi.o jpeg-8d/jcparam.o jpeg-8d/jcprepct.o jpeg-8d/jcsample.o jpeg-8d/jctrans.o jpeg-8d/jdapimin.o jpeg-8d/jdapistd.o jpeg-8d/jdarith.o jpeg-8d/jdatadst.o jpeg-8d/jdatasrc.o jpeg-8d/jdcoefct.o jpeg-8d/jdcolor.o jpeg-8d/jddctmgr.o jpeg-8d/jdhuff.o jpeg-8d/jdinput.o jpeg-8d/jdmainct.o jpeg-8d/jdmarker.o jpeg-8d/jdmaster.o jpeg-8d/jdmerge.o jpeg-8d/jdpostct.o jpeg-8d/jdsample.o jpeg-8d/jdtrans.o jpeg-8d/jerror.o jpeg-8d/jfdctflt.o jpeg-8d/jfdctfst.o jpeg-8d/jfdctint.o jpeg-8d/jidctflt.o jpeg-8d/jidctfst.o jpeg-8d/jidctint.o jpeg-8d/jmemmgr.o jpeg-8d/jmemnobs.o jpeg-8d/jquant1.o jpeg-8d/jquant2.o jpeg-8d/jutils.o
DEMO2D=demo2d
DEMO3D=demo3d
MIN2D=min2d
VIEWER=viewer
DYNCAM2D=dyncam2d
all : $(DEMO2D) $(DEMO3D) $(MIN2D) $(VIEWER) $(DYNCAM2D)
server : $(OUTSVLIB) $(SNAPPYLIB)
$(DYNCAM2D) : $(EXTCLILIBS) $(OUTCLILIB) $(DYNCAM2DOBJS) $(BZ2LIB) $(ZLIBLIB) $(JPEGLIB)
g++ $(CFLAGS0X) $(CLILIBFLAGS) $(DYNCAM2DOBJS) -o $(DYNCAM2D) $(OUTCLILIB) $(EXTCLILIBS) $(CLILIBFLAGS)
$(MIN2D) : $(EXTCLILIBS) $(OUTCLILIB) $(MIN2DOBJS) $(BZ2LIB) $(ZLIBLIB) $(JPEGLIB)
g++ $(CFLAGS0X) $(CLILIBFLAGS) $(MIN2DOBJS) -o $(MIN2D) $(OUTCLILIB) $(EXTCLILIBS) $(CLILIBFLAGS)
$(DEMO2D) : $(EXTCLILIBS) $(OUTCLILIB) $(DEMO2DOBJS) $(BZ2LIB) $(ZLIBLIB) $(JPEGLIB)
g++ $(CFLAGS0X) $(CLILIBFLAGS) $(DEMO2DOBJS) -o $(DEMO2D) $(OUTCLILIB) $(EXTCLILIBS) $(CLILIBFLAGS)
$(DEMO3D) : $(EXTCLILIBS) $(OUTCLILIB) $(DEMO3DOBJS) $(BZ2LIB) $(ZLIBLIB) $(JPEGLIB)
g++ $(CFLAGS0X) $(CLILIBFLAGS) $(DEMO3DOBJS) -o $(DEMO3D) $(OUTCLILIB) $(EXTCLILIBS) $(CLILIBFLAGS)
$(VIEWER) : $(EXTCLILIBS) $(OUTCLILIB) $(VIEWEROBJS) $(BZ2LIB) $(ZLIBLIB) $(JPEGLIB)
g++ $(CFLAGS0X) $(CLILIBFLAGS) $(VIEWEROBJS) -o $(VIEWER) $(OUTCLILIB) $(EXTCLILIBS) $(CLILIBFLAGS)
demo2d.o : demo2d.cpp
g++ -c demo2d.cpp $(CFLAGS0X)
demo3d.o : demo3d.cpp
g++ -c demo3d.cpp $(CFLAGS0X)
min2d.o : min2d.cpp
g++ -c min2d.cpp $(CFLAGS0X)
vw.o : vw.cpp
g++ -c vw.cpp $(CFLAGS0X)
dyncam2d.o : dyncam2d.cpp
g++ -c dyncam2d.cpp $(CFLAGS0X)
$(OUTCLILIB) : $(MOYAICLIOBJS)
ar cr $(OUTCLILIB) $(MOYAICLIOBJS)
ranlib $(OUTCLILIB)
$(OUTSVLIB) : $(MOYAISVOBJS)
ar cr $(OUTSVLIB) $(MOYAISVOBJS)
ranlib $(OUTSVLIB)
$(SNAPPYLIB) : $(SNAPPYOBJS)
ar cr $(SNAPPYLIB) $(SNAPPYOBJS)
ranlib $(SNAPPYLIB)
$(JPEGLIB) : $(JPEGOBJS)
ar cr $(JPEGLIB) $(JPEGOBJS)
ranlib $(JPEGLIB)
common.o : common.cpp
g++ -c common.cpp $(CFLAGS0X)
cumino.o : cumino.cpp
g++ -c cumino.cpp $(CFLAGS0X)
Prop2D.o : Prop2D.cpp
g++ -c $(CFLAGS0X) Prop2D.cpp -o Prop2D.o
Prop3D.o : Prop3D.cpp
g++ -c $(CFLAGS0X) Prop3D.cpp -o Prop3D.o
ColorReplacerShader.o : ColorReplacerShader.cpp
g++ -c $(CFLAGS0X) ColorReplacerShader.cpp -o ColorReplacerShader.o
Font.o : Font.cpp
g++ -c $(CFLAGS0X) Font.cpp -o Font.o
FragmentShader.o : FragmentShader.cpp
g++ -c $(CFLAGS0X) FragmentShader.cpp -o FragmentShader.o
IndexBuffer.o : IndexBuffer.cpp
g++ -c $(CFLAGS0X) IndexBuffer.cpp -o IndexBuffer.o
Layer.o : Layer.cpp
g++ -c $(CFLAGS0X) Layer.cpp -o Layer.o
MoyaiClient.o : MoyaiClient.cpp
g++ -c $(CFLAGS0X) MoyaiClient.cpp -o MoyaiClient.o
TextBox.o : TextBox.cpp
g++ -c $(CFLAGS0X) TextBox.cpp -o TextBox.o
Texture.o : Texture.cpp
g++ -c $(CFLAGS0X) Texture.cpp -o Texture.o
VertexBuffer.o : VertexBuffer.cpp
g++ -c $(CFLAGS0X) VertexBuffer.cpp -o VertexBuffer.o
Viewport.o : Viewport.cpp
g++ -c $(CFLAGS0X) Viewport.cpp -o Viewport.o
Prim.o : Prim.cpp
g++ -c $(CFLAGS0X) Prim.cpp -o Prim.o
DrawBatch.o : DrawBatch.cpp
g++ -c $(CFLAGS0X) DrawBatch.cpp -o DrawBatch.o
Camera.o : Camera.cpp
g++ -c $(CFLAGS0X) Camera.cpp -o Camera.o
CharGrid.o : CharGrid.cpp
g++ -c $(CFLAGS0X) CharGrid.cpp -o CharGrid.o
Grid.o : Grid.cpp
g++ -c $(CFLAGS0X) Grid.cpp -o Grid.o
Mesh.o : Mesh.cpp
g++ -c $(CFLAGS0X) Mesh.cpp -o Mesh.o
Pad.o : Pad.cpp
g++ -c $(CFLAGS0X) Pad.cpp -o Pad.o
PerformanceCounter.o : PerformanceCounter.cpp
g++ -c $(CFLAGS0X) PerformanceCounter.cpp -o PerformanceCounter.o
PrimDrawer.o : PrimDrawer.cpp
g++ -c $(CFLAGS0X) PrimDrawer.cpp -o PrimDrawer.o
Sound.o : Sound.cpp
g++ -c $(CFLAGS0X) Sound.cpp -o Sound.o
SoundSystem.o : SoundSystem.cpp
g++ -c $(CFLAGS0X) SoundSystem.cpp -o SoundSystem.o
VertexFormat.o : VertexFormat.cpp
g++ -c $(CFLAGS0X) VertexFormat.cpp -o VertexFormat.o
TileDeck.o : TileDeck.cpp
g++ -c $(CFLAGS0X) TileDeck.cpp -o TileDeck.o
Remote.o : Remote.cpp
g++ -c $(CFLAGS0X) Remote.cpp -o Remote.o
ConvertUTF.o : ConvertUTF.c
g++ -c $(CFLAGS0X) ConvertUTF.c -o ConvertUTF.o
Keyboard.o : Keyboard.cpp
g++ -c $(CFLAGS0X) Keyboard.cpp -o Keyboard.o
JPEGCoder.o : JPEGCoder.cpp
g++ -c $(CFLAGS0X) JPEGCoder.cpp -o JPEGCoder.o
GLFWemu.o : GLFWemu.cpp
g++ -c $(CFLAGS0X) GLFWemu.cpp -o GLFWemu.o
GLemu.o : GLemu.cpp
g++ -c $(CFLAGS0X) GLemu.cpp -o GLemu.o
snappy-sinksource.o:
g++ -c snappy/snappy-sinksource.cc $(CFLAGS)
snappy-c.o:
g++ -c snappy/snappy-c.cc $(CFLAGS)
snappy.o:
g++ -c snappy/snappy.cc $(CFLAGS)
$(LIBUVLIB) :
tar zxf $(LIBUV).tar.gz
cd $(LIBUV); sh autogen.sh; ./configure; make clean; make
$(BZ2LIB):
rm -rf $(BZ2)
tar zxf $(BZ2).tar.gz
cd $(BZ2); make
$(ZLIBLIB):
rm -rf $(ZLIB)
tar zxf $(ZLIB).tar.gz
cd $(ZLIB); ./configure; make
$(LIBPNGLIB):
rm -rf $(LIBPNG)
tar zxf $(LIBPNG).tar.gz
cd $(LIBPNG); ./configure; make
clean:
rm -rf $(BZ2) $(ZLIB) $(LIBPNG)
rm -f deps.make $(VIEWER) $(DEMO2D) $(MIN2D) $(DEMO3D) $(DYNCAM2D) $(OUTCLILIB) $(OUTSVLIB) *.o *.a */*.o
depend:
$(CC) $(CFLAGS0X) -MM $(TESTSRCS) $(MOYAICLISRCS) $(DEMO2DSRCS) $(DEMO3DSRCS) $(MIN2DSRCS) $(DYNCAM2DSRCS) $(VIEWERSRCS) > deps.make
-include deps.make