13 all: $(EPOCROOT2)epoc32 MAKEDIRS RESOURCES PicoDrive.exe
\r
16 @perl -S ermdir.pl _build
\r
17 @erase 2>>nul rsc\*.rsc
\r
18 @erase 2>>nul rsc\*.rsg
\r
19 @erase 2>>nul rsc\PicoDrive.mb?
\r
23 $(EPOCROOT2)epoc32 :
\r
24 @echo Please set EPOCROOT2 environmental variable to full path to your SDK
\r
25 @echo with ending slash (something like C:\Uiq_21\)
\r
26 @cd : 2> NUL # do something stupid to make it silently fail
\r
28 # resource compiler hates drive lettered paths
\r
29 EPOCROOT2_NODRV = $(filter \\%,$(subst :, ,$(EPOCROOT2)))
\r
30 EPOCLIB = $(EPOCROOT2)EPOC32\RELEASE\ARMV5
\r
33 CC=arm-none-symbianelf-gcc
\r
36 LD=arm-none-symbianelf-ld
\r
39 ASM=arm-none-symbianelf-as
\r
42 AR=arm-none-symbianelf-ar
\r
45 STRIP=arm-none-symbianelf-strip
\r
48 GCCDEFINES = -DNDEBUG -D_UNICODE -D__GCCE__ -D__SYMBIAN32__ -D__EPOC32__ -D__MARM__ \
\r
49 -D__EABI__ -D__MARM_ARMV5__ -D__EXE__ -D__SUPPORT_CPP_EXCEPTIONS__ \
\r
50 -D__MARM_ARMV5__ -D__PRODUCT_INCLUDE__=\"$(EPOCROOT2)epoc32/include/variant/UIQ_3.0.hrh\"
\r
52 GCCDEFINES += -D_UNZIP_SUPPORT -D__BROKEN_FWRITE
\r
54 # 'CSL Arm Toolchain' stuff must be specified after Symbian includes
\r
55 GCCINCLUDES = -I "$(EPOCROOT2)epoc32\include\variant" -I "$(EPOCROOT2)EPOC32\INCLUDE" -I "$(EPOCROOT2)EPOC32\INCLUDE\LIBC" \
\r
56 -I "$(EPOCROOT2)\CSL Arm Toolchain\lib\gcc\arm-none-symbianelf\3.4.3\include" -I.
\r
58 # -funit-at-a-time is not compatible with SDK, it either has linker problems or does not start on device
\r
59 GCCCOMMFLAGS = -Wall -Wno-unknown-pragmas -fexceptions -march=armv5t -mapcs -pipe -nostdinc -msoft-float \
\r
60 $(GCCINCLUDES) -include "$(EPOCROOT2)EPOC32/INCLUDE/GCCE/GCCE.h" -marm
\r
62 GCCCPPFLAGS = -x c++ -Wno-ctor-dtor-privacy -O3 -fno-unit-at-a-time
\r
63 GCCCFLAGS = -x c -O3 -fno-unit-at-a-time
\r
65 GCCLDFLAGS = -L"$(EPOCROOT2)CSL Arm Toolchain\arm-none-symbianelf\lib" \
\r
66 -L"$(EPOCROOT2)CSL Arm Toolchain\lib\gcc\arm-none-symbianelf\3.4.3" \
\r
67 --target1-abs --no-undefined -nostdlib -shared -Ttext 0x8000 -Tdata 0x400000 --default-symver
\r
71 $(EPOCLIB)\LIB\ESTLIB.dso \
\r
72 $(EPOCLIB)\urel\qikalloc.lib \
\r
73 $(EPOCLIB)\LIB\euser.dso \
\r
74 $(EPOCLIB)\LIB\apparc.dso \
\r
75 $(EPOCLIB)\LIB\cone.dso \
\r
76 $(EPOCLIB)\LIB\eikcore.dso \
\r
77 $(EPOCLIB)\LIB\eikcoctl.dso \
\r
78 $(EPOCLIB)\LIB\qikcore.dso \
\r
79 $(EPOCLIB)\LIB\qikdlg.dso \
\r
80 $(EPOCLIB)\LIB\etext.dso \
\r
81 $(EPOCLIB)\LIB\bafl.dso \
\r
82 $(EPOCLIB)\LIB\efsrv.dso \
\r
83 $(EPOCLIB)\LIB\eikctl.dso \
\r
84 $(EPOCLIB)\LIB\WS32.dso \
\r
85 $(EPOCLIB)\LIB\EIKDLG.dso \
\r
86 $(EPOCLIB)\LIB\GDI.dso \
\r
87 $(EPOCLIB)\LIB\estor.dso \
\r
88 $(EPOCLIB)\LIB\EZLIB.dso \
\r
89 $(EPOCLIB)\LIB\HAL.dso \
\r
90 $(EPOCLIB)\LIB\mediaclient.dso \
\r
91 $(EPOCLIB)\LIB\mediaclientaudiostream.dso
\r
94 $(EPOCLIB)\LIB\qikallocdll.dso \
\r
95 $(EPOCLIB)\UREL\usrt2_2.lib \
\r
96 $(EPOCLIB)\LIB\dfpaeabi.dso \
\r
97 $(EPOCLIB)\LIB\dfprvct2_2.dso \
\r
98 $(EPOCLIB)\LIB\drtaeabi.dso \
\r
99 $(EPOCLIB)\LIB\scppnwdl.dso \
\r
100 $(EPOCLIB)\LIB\drtrvct2_2.dso
\r
106 OBJECTS += _build\App.o _build\Engine.o _build\Dialogs.o _build\CSimpleTextParser.o
\r
108 OBJECTS += _build\main.o _build\vid.o _build\polledas.o _build\audio_mediaserver.o _build\debug.o
\r
111 OBJECTS += _build\Area.o _build\Cart.o _build\Utils.o _build\Memory.o _build\Misc.o \
\r
112 _build\Pico.o _build\Sek.o _build\VideoPort.o _build\Draw2.o _build\Draw.o
\r
114 ifeq "$(asm_render)" "1"
\r
115 GCCDEFINES += -D_ASM_DRAW_C
\r
116 OBJECTS += _build\draw_asm.o _build\draw2_asm.o
\r
118 ifeq "$(asm_memory)" "1"
\r
119 GCCDEFINES += -D_ASM_MEMORY_C
\r
120 OBJECTS += _build\memory_asm.o
\r
123 OBJECTS += _build\sound.o _build\sn76496.o _build\ym2612.o
\r
125 OBJECTS += _build\unzip.o _build\gzio_symb.o
\r
127 ifeq "$(use_musashi)" "1"
\r
128 GCCDEFINES += -DEMU_M68K
\r
129 OBJECTS += _build\m68kcpu.o _build\m68kopac.o _build\m68kopdm.o _build\m68kopnz.o _build\m68kops.o
\r
131 GCCDEFINES += -DEMU_C68K
\r
132 OBJECTS += _build\Cyclone.o
\r
134 ifeq "$(asm_blit)" "1"
\r
135 OBJECTS += _build\blit_asm.o
\r
137 OBJECTS += _build\blit.o
\r
139 GCCDEFINES += -D_USE_DRZ80
\r
140 OBJECTS += _build\DrZ80.o
\r
141 GCCDEFINES += -D_ASM_YM2612_C
\r
142 OBJECTS += _build\ym2612_asm.o
\r
147 ifeq "$(dprint)" "1"
\r
148 GCCDEFINES += -D__DEBUG_PRINT
\r
154 @$(CC) -c $(GCCCOMMFLAGS) $(GCCDEFINES) $(GCCCFLAGS) $< -o $@
\r
159 @$(CC) -c $(GCCCOMMFLAGS) $(GCCDEFINES) $(GCCCPPFLAGS) $< -o $@
\r
164 @$(ASM) -marmv4t -mthumb-interwork -o $@ $^
\r
167 # object making rules
\r
168 _build\App.o : App.cpp
\r
170 _build\Engine.o : Engine.cpp
\r
172 _build\Dialogs.o : Dialogs.cpp
\r
174 _build\CSimpleTextParser.o : CSimpleTextParser.cpp
\r
177 _build\main.o : engine\main.cpp
\r
179 _build\vid.o : engine\vid.cpp
\r
181 _build\polledas.o: engine\polledas.cpp
\r
183 _build\audio_mediaserver.o : engine\audio_mediaserver.cpp
\r
185 _build\debug.o : engine\debug.cpp
\r
187 _build\blit.o : engine\blit.c
\r
190 _build\Area.o : ..\..\Pico\Area.c
\r
192 _build\Cart.o : ..\..\Pico\Cart.c
\r
194 _build\Draw.o : ..\..\Pico\Draw.c
\r
196 _build\Draw2.o : ..\..\Pico\Draw2.c
\r
198 _build\Memory.o : ..\..\Pico\Memory.c
\r
200 _build\Misc.o : ..\..\Pico\Misc.c
\r
202 _build\Pico.o : ..\..\Pico\Pico.c
\r
204 _build\Sek.o : ..\..\Pico\Sek.c
\r
206 _build\Utils.o : ..\..\Pico\Utils.c
\r
208 _build\VideoPort.o : ..\..\Pico\VideoPort.c
\r
210 _build\sound.o : ..\..\Pico\sound\sound.c
\r
212 _build\sn76496.o : ..\..\Pico\sound\sn76496.c
\r
214 _build\ym2612.o : ..\..\Pico\sound\ym2612.c
\r
217 _build\unzip.o : ..\..\unzip\unzip.c
\r
219 _build\gzio_symb.o : ..\..\zlib\gzio_symb.c
\r
222 _build\m68kcpu.o : ..\..\musashi\m68kcpu.c
\r
224 _build\m68kopac.o : ..\..\musashi\m68kopac.c
\r
226 _build\m68kopdm.o : ..\..\musashi\m68kopdm.c
\r
228 _build\m68kopnz.o : ..\..\musashi\m68kopnz.c
\r
230 _build\m68kops.o : ..\..\musashi\m68kops.c
\r
233 _build\Cyclone.o : ..\..\cpu\Cyclone\proj\Cyclone.s
\r
235 _build\DrZ80.o : ..\..\cpu\DrZ80\drz80.s
\r
237 _build\draw_asm.o : ..\..\Pico\draw.s
\r
239 _build\draw2_asm.o : ..\..\Pico\draw2.s
\r
241 _build\memory_asm.o : ..\..\Pico\memory.s
\r
243 _build\ym2612_asm.o : ..\..\Pico\sound\ym2612.s
\r
245 _build\blit_asm.o : engine\blit.s
\r
249 PicoDrive.exe : $(OBJECTS)
\r
251 @$(LD) $(GCCLDFLAGS) -soname PicoDrive{000a0000}[a00010f3].exe --entry _E32Startup -u _E32Startup \
\r
252 $(EPOCROOT2)EPOC32\RELEASE\ARMV5\UREL\EEXE.LIB -o "_build\PicoDrive_elf.exe" -Map "_build\PicoDrive.exe.map" $(OBJECTS) $(LIBS) -lsupc++ -lgcc
\r
254 # @$(STRIP) _build\PicoDrive_elf.exe
\r
256 @elf2e32 --sid=0xa00010f3 --heap=0x00000100,0x00800000 --stack=0x00003000 \
\r
257 --uid1=0x1000007a --uid2=0x100039ce --uid3=0xa00010f3 \
\r
258 --capability=none --fpu=softvfp --targettype=EXE --output="$@" \
\r
259 --elfinput="_build\PicoDrive_elf.exe" --linkas=PicoDrive{000a0000}[a00010f3].exe --libpath="$(EPOCLIB)\LIB"
\r
271 # @echo * making build dir
\r
272 @perl -S emkdir.pl $@
\r
275 # BitMap PicoDrive.mbm
\r
277 RESOURCES : rsc\PicoDrive.mbm rsc\PicoDrive.RSC rsc\PicoDrive_reg.RSC rsc\PicoDrive_loc.RSC rsc\PicoDrive.mbg
\r
279 rsc\PicoDrive.mbg : rsc\PicoDrive.mbm
\r
281 rsc\PicoDrive.mbm : rsc\pico18x18.bmp rsc\pico18x18m.bmp rsc\pico40x40.bmp rsc\pico40x40m.bmp rsc\pico64x64.bmp rsc\pico64x64m.bmp
\r
283 @perl -S epocmbm.pl -h"rsc\PicoDrive.mbg" -o"rsc\PicoDrive.mbm" -l"\Z\Resource\Apps\:rsc" \
\r
284 -b"/c24rsc\pico18x18.bmp /8rsc\pico18x18m.bmp /c24rsc\pico40x40.bmp /8rsc\pico40x40m.bmp /c24rsc\pico64x64.bmp /8rsc\pico64x64m.bmp" -l"\Z\Resource\Apps\:rsc"
\r
285 @perl -S ecopyfile.pl "rsc\PicoDrive.mbg" "$(EPOCROOT2)EPOC32\INCLUDE\PicoDrive.mbg"
\r
287 # Resource Z\Resource\Apps\PicoDrive.RSC
\r
289 rsc\PicoDrive.RSC : rsc\PicoDrive.rss picodrive.hrh
\r
291 @perl -S epocrc.pl -m045,046,047 -I "." -I- -I "$(EPOCROOT2_NODRV)EPOC32\include" -DLANGUAGE_SC -u "rsc\PicoDrive.rss" -o$@ \
\r
292 -h"rsc\PicoDrive.rsg" -t"rsc" -l"Z\Resource\Apps:rsc"
\r
293 @perl -S ecopyfile.pl "rsc\PicoDrive.rsg" "$(EPOCROOT2)EPOC32\INCLUDE\PicoDrive.RSG"
\r
295 # Resource Z\private\10003a3f\apps\PicoDrive_reg.RSC
\r
297 rsc\PicoDrive_reg.RSC : rsc\PicoDrive_reg.rss
\r
299 @perl -S epocrc.pl -m045,046,047 -I "." -I- -I "$(EPOCROOT2)EPOC32\include" -DLANGUAGE_SC -u "rsc\PicoDrive_reg.rss" -o$@ \
\r
300 -t"rsc" -l"Z\private\10003a3f\apps:rsc"
\r
302 # Resource Z\Resource\Apps\PicoDrive_loc.RSC
\r
304 rsc\PicoDrive_loc.RSC : rsc\PicoDrive_loc.rss
\r
306 @perl -S epocrc.pl -m045,046,047 -I "." -I- -I "$(EPOCROOT2)EPOC32\include" -DLANGUAGE_SC -u "rsc\PicoDrive_loc.rss" -o$@ \
\r
307 -t"rsc" -l"Z\Resource\Apps:rsc"
\r