forked from alexmac/alcexamples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
224 lines (187 loc) · 9.46 KB
/
Makefile
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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
FLASCC=/path/to/FLASCC/sdk
ALCEXTRA=/path/to/alcextra
GLS3D=/path/to/GLS3D
BUILD=$(PWD)/build
INSTALL=$(PWD)/install
SRCROOT=$(PWD)/
all:
mkdir -p $(BUILD)
mkdir -p $(INSTALL)
.PHONY: quake3 cube2
clean:
rm -rf $(BUILD)
rm -rf neverball-1.5.4/vfs
find neverball-1.5.4/ | grep "\.o$$" | xargs rm -f
find neverball-1.5.4/ | grep "\.abc$$" | xargs rm -f
find neverball-1.5.4/ | grep "\.swf$$" | xargs rm -f
find cube2/ | grep "\.o$$" | xargs rm -f
find cube2/ | grep "\.abc$$" | xargs rm -f
find cube2/ | grep "\.swf$$" | xargs rm -f
nethack:
neverball:
mkdir -p $(BUILD)/neverball/
rm -f $(BUILD)/data*.zip
cd neverball-1.5.4/data1 && zip -9 -q -r $(BUILD)/neverball/data1.zip *
cd neverball-1.5.4/data2 && zip -9 -q -r $(BUILD)/neverball/data2.zip *
cd neverball-1.5.4/data3 && zip -9 -q -r $(BUILD)/neverball/data3.zip *
java -jar $(FLASCC)/usr/lib/asc2.jar -merge -md -AS3 -strict -optimize \
-import $(FLASCC)/usr/lib/builtin.abc \
-import $(FLASCC)/usr/lib/playerglobal.abc \
-import $(GLS3D)/install/usr/lib/libGL.abc \
-import $(FLASCC)/usr/lib/ISpecialFile.abc \
-import $(FLASCC)/usr/lib/IBackingStore.abc \
-import $(FLASCC)/usr/lib/IVFS.abc \
-import $(FLASCC)/usr/lib/InMemoryBackingStore.abc \
-import $(FLASCC)/usr/lib/AlcVFSZip.abc \
-import $(FLASCC)/usr/lib/CModule.abc \
-import $(FLASCC)/usr/lib/C_Run.abc \
-import $(FLASCC)/usr/lib/BinaryData.abc \
-import $(FLASCC)/usr/lib/PlayerKernel.abc \
neverball-1.5.4/Console.as -outdir $(BUILD)/neverball -out Console
java -jar $(FLASCC)/usr/lib/asc2.jar -merge -md -AS3 -strict -optimize \
-import $(FLASCC)/usr/lib/builtin.abc \
-import $(FLASCC)/usr/lib/playerglobal.abc \
-import $(GLS3D)/install/usr/lib/libGL.abc \
-import $(FLASCC)/usr/lib/ISpecialFile.abc \
-import $(FLASCC)/usr/lib/IBackingStore.abc \
-import $(FLASCC)/usr/lib/IVFS.abc \
-import $(FLASCC)/usr/lib/CModule.abc \
-import $(FLASCC)/usr/lib/C_Run.abc \
-import $(FLASCC)/usr/lib/BinaryData.abc \
-import $(FLASCC)/usr/lib/PlayerKernel.abc \
-import $(BUILD)/neverball/Console.abc \
neverball-1.5.4/VFSPreLoader.as -swf com.adobe.flascc.preloader.VFSPreLoader,800,600,60 -outdir $(BUILD)/neverball -out VFSPreLoader
cd neverball-1.5.4 && PATH=$(FLASCC)/usr/bin:$(ALCEXTRA)/usr/bin:$(PATH) make \
DATADIR=data \
LDFLAGS="-L$(ALCEXTRA)/install/usr/lib/ $(GLS3D)/install/usr/lib/libGL.abc -L$(GLS3D)/install/usr/lib/ $(FLASCC)/usr/lib/AlcVFSZip.abc -swf-preloader=$(BUILD)/neverball/VFSPreLoader.swf -swf-version=17 -symbol-abc=$(BUILD)/neverball/Console.abc -jvmopt=-Xmx4G -emit-swf -swf-size=800x600 " \
CFLAGS="-O4 -flto-api=exports.txt" \
CC="gcc" \
SDL_CPPFLAGS="-I$(ALCEXTRA)/install/usr/include/ -I$(GLS3D)/install/usr/include -I$(ALCEXTRA)/install/usr/include -I$(FLASCC)/usr/include/libpng15 -I$(FLASCC)/usr/include/SDL -I$(ALCEXTRA)/install/usr/include/SDL" \
PNG_CPPFLAGS="$(shell $(FLASCC)/usr/bin/libpng-config --cflags)" \
SDL_LIBS="$(shell $(FLASCC)/usr/bin/sdl-config --libs) -lvgl" \
PNG_LIBS="$(shell $(FLASCC)/usr/bin/libpng-config --libs)" \
OGL_LIBS="-lGL -lz -lfreetype -lvorbis -logg" \
EXT=".swf" \
DEBUG=0 ENABLE_NLS=0 \
neverball.swf neverputt.swf \
-j8
mv neverball-1.5.4/*.swf $(BUILD)/neverball/
quake3:
cd Quake3 && PATH=$(FLASCC)/usr/bin:$(ALCEXTRA)/usr/bin:$(PATH) make FLASCC=$(FLASCC) GLS3D=$(GLS3D) ALCEXTRA=$(ALCEXTRA) BASEQ3DIR=$(BASEQ3DIR) -j8
cube2:
cd cube2 && PATH=$(FLASCC)/usr/bin:$(ALCEXTRA)/usr/bin:$(PATH) make FLASCC=$(FLASCC) GLS3D=$(GLS3D) ALCEXTRA=$(ALCEXTRA) BASEQ3DIR=$(BASEQ3DIR) -j8 client
DOSBOX_OPTS:=-O4 -flto-api=$(SRCROOT)/dosbox-0.74/exports.txt -fno-exceptions -DDISABLE_JOYSTICK=1
#DOSBOX_OPTS:=-O0 -fno-exceptions -DDISABLE_JOYSTICK=1
BOCHS_OPTS:=-O4 -fno-exceptions
BOCHS_CFG:=--disable-show-ips --enable-clgd54xx --enable-static --disable-plugins --enable-fpu --without-x11 --with-sdl
bochsnative:
mkdir -p $(BUILD)/bochsnative
cd $(BUILD)/bochsnative/ && CFLAGS="-O3" CXXFLAGS="-O3" \
$(SRCROOT)/bochs-2.6/configure $(BOCHS_CFG)
cd $(BUILD)/bochsnative/ && FLASCC=$(FLASCC) make
bochs:
mkdir -p $(BUILD)/bochs
cd $(BUILD)/bochs/ && CFLAGS="-O3" CXXFLAGS="-O3" \
PATH=$(FLASCC)/usr/bin:$(ALCEXTRA)/usr/bin:$(PATH) CFLAGS="$(BOCHS_OPTS) " CXXFLAGS="$(BOCHS_OPTS) -I$(ALCEXTRA)/usr/include" $(SRCROOT)/bochs-2.6/configure $(BOCHS_CFG)
cd $(BUILD)/bochs/ && PATH=$(FLASCC)/usr/bin:$(ALCEXTRA)/usr/bin:$(PATH) SWF_LINK_OPTS="-Wl,--warn-unresolved-symbols -pthread -emit-swf -swf-preloader=VFSPreLoader.swf -swf-size=1024x768 -symbol-abc=Console.abc $(FLASCC)/usr/lib/AlcVFSZip.abc " make
mv $(BUILD)/bochs/bochs $(BUILD)/bochs/bochs.swf
dbnative:
mkdir -p $(BUILD)/dbnative
cd $(BUILD)/dbnative/ && CFLAGS="-O3" CXXFLAGS="-O3" \
$(SRCROOT)/dosbox-0.74/configure --disable-debug --disable-sdltest --disable-alsa-midi \
--disable-alsatest --disable-dynamic-core --disable-dynrec --disable-fpu-x86 --disable-opengl
cd $(BUILD)/dbnative/ && make
dosbox:
mkdir -p $(BUILD)/dosbox
cd $(BUILD)/dosbox/ && PATH=$(FLASCC)/usr/bin:$(ALCEXTRA)/usr/bin:$(PATH) CFLAGS="$(DOSBOX_OPTS) " CXXFLAGS="$(DOSBOX_OPTS) -I$(ALCEXTRA)/usr/include" \
$(SRCROOT)/dosbox-0.74/configure --disable-debug --disable-sdltest --disable-alsa-midi \
--disable-alsatest --disable-dynamic-core --disable-dynrec --disable-fpu-x86 --disable-opengl
cd $(BUILD)/dosbox/ && PATH=$(FLASCC)/usr/bin:$(ALCEXTRA)/usr/bin:$(PATH) make
mkdir -p $(SRCROOT)/dosbox-0.74/fs
cd $(SRCROOT)/dosbox-0.74/fs && zip -i -9 -q -r $(BUILD)/dosbox/dosboxvfs.zip *
cd $(BUILD)/dosbox && java -jar $(FLASCC)/usr/lib/asc2.jar -merge -md \
-AS3 -strict -optimize \
-import $(FLASCC)/usr/lib/builtin.abc \
-import $(FLASCC)/usr/lib/playerglobal.abc \
-import $(FLASCC)/usr/lib/ISpecialFile.abc \
-import $(FLASCC)/usr/lib/IBackingStore.abc \
-import $(FLASCC)/usr/lib/InMemoryBackingStore.abc \
-import $(FLASCC)/usr/lib/IVFS.abc \
-import $(FLASCC)/usr/lib/CModule.abc \
-import $(FLASCC)/usr/lib/C_Run.abc \
-import $(FLASCC)/usr/lib/BinaryData.abc \
-import $(FLASCC)/usr/lib/PlayerKernel.abc \
-import $(FLASCC)/usr/lib/AlcVFSZip.abc \
-import dosboxvfs.abc \
$(SRCROOT)/dosbox-0.74/Console.as -outdir . -out Console
cd $(BUILD)/dosbox && java -jar $(FLASCC)/usr/lib/asc2.jar -merge -md \
-AS3 -strict -optimize \
-import $(FLASCC)/usr/lib/builtin.abc \
-import $(FLASCC)/usr/lib/playerglobal.abc \
-import $(FLASCC)/usr/lib/ISpecialFile.abc \
-import $(FLASCC)/usr/lib/IBackingStore.abc \
-import $(FLASCC)/usr/lib/IVFS.abc \
-import $(FLASCC)/usr/lib/CModule.abc \
-import $(FLASCC)/usr/lib/C_Run.abc \
-import $(FLASCC)/usr/lib/BinaryData.abc \
-import $(FLASCC)/usr/lib/PlayerKernel.abc \
-import Console.abc \
$(SRCROOT)/dosbox-0.74/VFSPreLoader.as -swf VFSPreLoader,1024,768,60 -outdir . -out VFSPreLoader
make dbfinal
dbfinal:
cd $(BUILD)/dosbox/ && $(FLASCC)/usr/bin/g++ $(DOSBOX_OPTS) -pthread -save-temps \
src/dosbox.o \
$(FLASCC)/usr/lib/AlcVFSZip.abc \
src/cpu/libcpu.a src/debug/libdebug.a src/dos/libdos.a src/fpu/libfpu.a \
src/hardware/libhardware.a src/gui/libgui.a src/ints/libints.a \
src/misc/libmisc.a src/shell/libshell.a src/hardware/serialport/libserial.a src/libs/gui_tk/libgui_tk.a \
-lSDL -lm -lvgl -lpng -lz \
-swf-size=1024x768 \
-symbol-abc=Console.abc \
-emit-swf -swf-version=18 -swf-preloader=VFSPreLoader.swf -o dosbox.swf
OPENCV_OPTS:=-O4 -flto-api=$(SRCROOT)/OpenCV-2.4.2/exports.txt
opencv:
mkdir -p $(BUILD)/opencv
cd $(BUILD)/opencv && PATH=$(FLASCC)/usr/bin:$(ALCEXTRA)/usr/bin:$(PATH) CFLAGS="-O4" CXXFLAGS="-O4" cmake $(SRCROOT)/OpenCV-2.4.2 \
-DBUILD_SHARED_LIBS=FALSE -DCMAKE_SIZEOF_VOID_P=4 -DBUILD_EXAMPLES=FALSE \
-DBUILD_PERF_TESTS=FALSE -DBUILD_TESTS=FALSE -DBUILD_ZLIB=TRUE -DBUILD_TIFF=TRUE \
-DBUILD_JPEG=TRUE -DBUILD_JASPER=TRUE -DBUILD_PNG=TRUE -DCMAKE_INSTALL_PREFIX=$(INSTALL)
cd $(BUILD)/opencv && PATH=$(FLASCC)/usr/bin:$(ALCEXTRA)/usr/bin:$(PATH) make -j6
cd $(BUILD)/opencv && PATH=$(FLASCC)/usr/bin:$(ALCEXTRA)/usr/bin:$(PATH) make install
make opencv_test
opencv_test:
@echo "Generating VFS..."
@mkdir -p $(BUILD)/opencv/vfs
@cp -f $(SRCROOT)/OpenCV-2.4.2/data/haarcascades/haarcascade_frontalface_alt.xml $(BUILD)/opencv/vfs/
@cd $(BUILD)/opencv && "$(FLASCC)/usr/bin/genfs" --type=embed vfs vfs
@echo "Compiling Console..."
@cd $(BUILD)/opencv && java -jar $(FLASCC)/usr/lib/asc2.jar -merge -md \
-AS3 -strict -optimize \
-import $(FLASCC)/usr/lib/builtin.abc \
-import $(FLASCC)/usr/lib/playerglobal.abc \
-import $(FLASCC)/usr/lib/ISpecialFile.abc \
-import $(FLASCC)/usr/lib/IBackingStore.abc \
-import $(FLASCC)/usr/lib/InMemoryBackingStore.abc \
-import $(FLASCC)/usr/lib/IVFS.abc \
-import $(FLASCC)/usr/lib/CModule.abc \
-import $(FLASCC)/usr/lib/C_Run.abc \
-import $(FLASCC)/usr/lib/BinaryData.abc \
-import $(FLASCC)/usr/lib/PlayerKernel.abc \
-import $(FLASCC)/usr/lib/AlcVFSZip.abc \
$(SRCROOT)/OpenCV-2.4.2/Console.as vfs*.as -outdir . -out Console
@echo "Linking facetracker..."
@cd $(BUILD)/opencv/ && $(FLASCC)/usr/bin/g++ \
-I$(INSTALL)/include/opencv \
-I$(INSTALL)/include/ \
$(SRCROOT)/OpenCV-2.4.2/facetracker.cpp \
-pthread \
-swf-size=640x360 \
-symbol-abc=Console.abc \
-Wl,--start-group $(INSTALL)/lib/libopencv*.a -Wl,--end-group \
-lFlash++ -lAS3++ -lz $(OPENCV_OPTS) \
-emit-swf -swf-version=18 -o facetracker.swf
opencvnative:
mkdir -p $(BUILD)/opencvnative
cd $(BUILD)/opencvnative && cmake $(SRCROOT)/OpenCV-2.4.2 \
-DBUILD_SHARED_LIBS=FALSE -DBUILD_EXAMPLES=TRUE -DBUILD_PERF_TESTS=FALSE -DBUILD_TESTS=FALSE
cd $(BUILD)/opencvnative && make -j8