1 # environmental vars required:
\r
2 # EPOCROOT2 - root of your SDK with slash at the end
\r
12 EPOCBLDUREL = _BUILD
\r
13 EPOCTRGUREL = $(EPOCROOT2)EPOC32\RELEASE\ARMI\UREL
\r
14 EPOCLINKUREL = $(EPOCTRGUREL)
\r
15 EPOCSTATLINKUREL = $(EPOCTRGUREL)
\r
18 # must set both PATH and Path to make it work correctly (?)
\r
19 Path:=$(EPOCROOT2)EPOC32\gcc\bin;$(Path)
\r
21 ERASE = @erase 2>>nul
\r
25 UREL : CHECKENV MAKEDIRS
\r
26 UREL : $(EPOCTRGUREL)\PICOSMALL.EXE
\r
29 @perl -S ermdir.pl "$(EPOCBLDUREL)"
\r
33 del ..\..\zlib\*.o 2> NUL
\r
36 del ..\..\musashi\*.o 2> NUL
\r
38 CLEANALL : CLEAN CLEANZ CLEANM
\r
41 # check for EPOCROOT2
\r
42 CHECKENV : $(EPOCROOT2)epoc32
\r
44 $(EPOCROOT2)epoc32 :
\r
45 @echo Please set EPOCROOT2 environmental variable to full path to your SDK
\r
46 @echo with ending slash (something like C:\Uiq_21\)
\r
47 @cd : 2> NUL # do something stupid to make it silently fail
\r
51 INCDIR = -I. -I "..\..\" -I "$(EPOCROOT2)EPOC32\INCLUDE" -I "$(EPOCROOT2)EPOC32\INCLUDE\LIBC"
\r
53 GCCFLAGS = -nostdinc -Wall -Wno-ctor-dtor-privacy -Wno-unknown-pragmas -march=armv4t -mthumb-interwork -pipe -O3 -fomit-frame-pointer
\r
55 GCCDEFS = -D__SYMBIAN32__ -D__GCC32__ -D__EPOC32__ -D__MARM__ -D__MARM_ARMI__ -D__EXE__ -DNDEBUG -D_UNICODE -DARM
\r
58 ifeq "$(dprint)" "1"
\r
59 GCCDEFS += -D__DEBUG_PRINT
\r
63 GCCDEFS += -D_USE_MZ80
\r
65 GCCDEFS += -D_USE_DRZ80
\r
68 ifeq "$(debug_cyclone)" "1"
\r
70 GCCDEFS += -DEMU_C68K
\r
74 ifeq "$(use_musashi)" "1"
\r
75 GCCDEFS += -DEMU_M68K
\r
77 GCCDEFS += -DEMU_C68K
\r
81 GCC = gcc -c $(GCCFLAGS) $(GCCDEFS) $(INCDIR)
\r
85 $(EPOCSTATLINKUREL)\EGCC.LIB \
\r
86 $(EPOCLINKUREL)\ESTLIB.LIB \
\r
87 $(EPOCLINKUREL)\WS32.LIB \
\r
88 $(EPOCLINKUREL)\HAL.LIB \
\r
89 $(EPOCLINKUREL)\EUSER.LIB \
\r
90 $(EPOCLINKUREL)\EFSRV.LIB \
\r
91 $(EPOCLINKUREL)\EZLIB.LIB
\r
93 $(EPOCTRGUREL)\PICOSMALL.EXE : $(EPOCBLDUREL)\PICOSMALL.in $(EPOCSTATLINKUREL)\EEXE.LIB $(LIBSUREL)
\r
94 @echo * linking and finishing
\r
95 @ld -s -e _E32Startup -u _E32Startup \
\r
96 --base-file "$(EPOCBLDUREL)\PICOSMALL.bas" -o "$(EPOCBLDUREL)\PICOSMALL.EXE" \
\r
97 "$(EPOCSTATLINKUREL)\EEXE.LIB" --whole-archive "$(EPOCBLDUREL)\PICOSMALL.in" \
\r
98 --no-whole-archive $(LIBSUREL) $(USERLDFLAGS)
\r
99 -$(ERASE) "$(EPOCBLDUREL)\PICOSMALL.EXE"
\r
100 @dlltool -m arm_interwork \
\r
101 --base-file "$(EPOCBLDUREL)\PICOSMALL.bas" \
\r
102 --output-exp "$(EPOCBLDUREL)\PICOSMALL.exp"
\r
103 -$(ERASE) "$(EPOCBLDUREL)\PICOSMALL.bas"
\r
104 @ld -s -e _E32Startup -u _E32Startup \
\r
105 "$(EPOCBLDUREL)\PICOSMALL.exp" \
\r
106 -Map "$(EPOCBLDUREL)\PICOSMALL.EXE.map" -o "$(EPOCBLDUREL)\PICOSMALL.EXE" \
\r
107 "$(EPOCSTATLINKUREL)\EEXE.LIB" --whole-archive "$(EPOCBLDUREL)\PICOSMALL.in" \
\r
108 --no-whole-archive $(LIBSUREL) $(USERLDFLAGS)
\r
109 -$(ERASE) "$(EPOCBLDUREL)\PICOSMALL.exp"
\r
110 ifeq "$(noecompxl)" "1"
\r
111 @petran "$(EPOCBLDUREL)\PICOSMALL.EXE" "$@" \
\r
112 -nocall -uid1 0x1000007a -uid2 0x00000000 -uid3 0x00000000 \
\r
113 -heap 0x00000001 0x00800000
\r
115 @petran_ "$(EPOCBLDUREL)\PICOSMALL.EXE" "$@" \
\r
116 -nocall -uid1 0x1000007a -uid2 0x00000000 -uid3 0x00000000 \
\r
117 -heap 0x00000001 0x00800000 -stack 0x80000000
\r
119 # -$(ERASE) "$(EPOCBLDUREL)\PICOSMALL.EXE"
\r
120 @perl -S ecopyfile.pl "$@" "PICOSMALL.EXE"
\r
127 $(EPOCBLDUREL)\debug.o \
\r
128 $(EPOCBLDUREL)\CART.o \
\r
129 $(EPOCBLDUREL)\DRAW.o \
\r
130 $(EPOCBLDUREL)\DRAW2.o \
\r
131 $(EPOCBLDUREL)\MAIN.o \
\r
132 $(EPOCBLDUREL)\MEMORY.o \
\r
133 $(EPOCBLDUREL)\PICO.o \
\r
134 $(EPOCBLDUREL)\SEK.o \
\r
135 $(EPOCBLDUREL)\VIDEOPORT.o \
\r
136 $(EPOCBLDUREL)\SIMPLESERVER.o \
\r
137 $(EPOCBLDUREL)\VID.o \
\r
138 $(EPOCBLDUREL)\Utils.o \
\r
139 $(EPOCBLDUREL)\Area.o \
\r
140 $(EPOCBLDUREL)\Misc.o \
\r
141 $(EPOCBLDUREL)\unzip.o \
\r
142 ..\..\zlib\gzio_symb.o \
\r
143 $(EPOCBLDUREL)\sound.o \
\r
144 $(EPOCBLDUREL)\sn76496.o \
\r
145 $(EPOCBLDUREL)\ym2612.o \
\r
146 $(EPOCBLDUREL)\blit.o
\r
148 ifeq "$(debug_cyclone)" "1"
\r
149 OBJECTSUREL += $(EPOCBLDUREL)\Cyclone.o $(EPOCBLDUREL)\_cyclone_debug.o
\r
152 ifeq "$(use_musashi)" "1"
\r
154 ..\..\musashi\m68kcpu.o \
\r
155 ..\..\musashi\m68kops.o \
\r
156 ..\..\musashi\m68kopac.o \
\r
157 ..\..\musashi\m68kopdm.o \
\r
158 ..\..\musashi\m68kopnz.o \
\r
159 ..\..\musashi\m68kdasm.o
\r
161 OBJECTSUREL += $(EPOCBLDUREL)\Cyclone.o
\r
165 OBJECTSUREL := $(OBJECTSUREL) $(EPOCBLDUREL)\mz80.o
\r
167 OBJECTSUREL := $(OBJECTSUREL) $(EPOCBLDUREL)\DrZ80.o
\r
170 ifeq "$(asm_memory)" "1"
\r
171 ASMDEFINES += -D_ASM_MEMORY_C
\r
172 OBJECTSUREL := $(OBJECTSUREL) $(EPOCBLDUREL)\memory_asm.o
\r
175 ifeq "$(asm_render)" "1"
\r
176 ASMDEFINES += -D_ASM_DRAW_C
\r
177 OBJECTSUREL := $(OBJECTSUREL) $(EPOCBLDUREL)\draw_asm.o $(EPOCBLDUREL)\draw2_asm.o
\r
180 $(EPOCBLDUREL)\PICOSMALL.in : $(OBJECTSUREL)
\r
182 @if exist "$@" del "$@"
\r
185 ..\..\Cyclone\proj\Cyclone.s :
\r
186 @echo You need to build Cyclone first. See Cyclone.txt in cyclone directory.
\r
187 @cd : 2> NUL # do something stupid to make it silently fail
\r
189 $(EPOCBLDUREL)\Cyclone.o : ..\..\Cyclone\proj\Cyclone.s
\r
190 @echo * assembling Cyclone..
\r
191 @as -marmv4t -mthumb-interwork -o $@ $^
\r
193 $(EPOCBLDUREL)\DrZ80.o : ..\..\pico\sound\DrZ80.s ..\..\pico\sound\DrZ80.h
\r
194 @echo * assembling DrZ80..
\r
195 @as -marmv4t -mthumb-interwork -o $@ ..\..\pico\sound\DrZ80.s
\r
200 $(EPOCBLDUREL)\debug.o : debug.cpp debug.h
\r
202 @$(GCC) -o $@ debug.cpp
\r
204 $(EPOCBLDUREL)\MAIN.o : Main.cpp ..\..\pico\picoInt.h vid.h SimpleServer.h ClientServer.h audio.h debug.h
\r
206 @$(GCC) -o $@ "Main.cpp"
\r
208 $(EPOCBLDUREL)\VID.o : VID.cpp vid.h ClientServer.h ..\..\pico\picoInt.h
\r
210 @$(GCC) -o $@ "VID.cpp"
\r
212 $(EPOCBLDUREL)\SIMPLESERVER.o : SIMPLESERVER.cpp version.h ClientServer.h SimpleServer.h ..\..\pico\picoInt.h debug.h
\r
213 @echo * SimpleServer.cpp
\r
214 @$(GCC) -o $@ "SIMPLESERVER.cpp"
\r
216 $(EPOCBLDUREL)\CART.o : ..\..\pico\Cart.c ..\..\pico\picoInt.h ..\..\pico\Pico.h ..\..\unzip\unzip.h
\r
218 @$(GCC) -D_UNZIP_SUPPORT -o $@ "..\..\pico\Cart.c"
\r
220 $(EPOCBLDUREL)\DRAW.o : ..\..\pico\Draw.c ..\..\pico\picoInt.h ..\..\pico\Pico.h
\r
222 @$(GCC) $(ASMDEFINES) -o $@ "..\..\pico\Draw.c"
\r
225 $(EPOCBLDUREL)\DRAW2.o : ..\..\pico\Draw2.c ..\..\pico\picoInt.h ..\..\pico\Pico.h
\r
227 @$(GCC) $(ASMDEFINES) -o $@ "..\..\pico\Draw2.c"
\r
229 $(EPOCBLDUREL)\MEMORY.o : ..\..\pico\Memory.c ..\..\pico\picoInt.h ..\..\pico\Pico.h
\r
231 @$(GCC) $(ASMDEFINES) -o $@ "..\..\pico\Memory.c"
\r
233 $(EPOCBLDUREL)\PICO.o : ..\..\pico\Pico.c ..\..\pico\picoInt.h ..\..\pico\Pico.h
\r
235 @$(GCC) -o $@ "..\..\pico\Pico.c"
\r
237 $(EPOCBLDUREL)\SEK.o : ..\..\pico\Sek.c ..\..\pico\picoInt.h ..\..\pico\Pico.h
\r
239 @$(GCC) -o $@ "..\..\pico\Sek.c"
\r
241 $(EPOCBLDUREL)\VIDEOPORT.o : ..\..\pico\Videoport.c ..\..\pico\picoInt.h ..\..\pico\Pico.h
\r
242 @echo * Videoport.c
\r
243 @$(GCC) -o $@ "..\..\pico\Videoport.c"
\r
245 $(EPOCBLDUREL)\Utils.o : ..\..\pico\Utils.c ..\..\pico\picoInt.h ..\..\pico\Pico.h
\r
247 @$(GCC) -o $@ "..\..\pico\Utils.c"
\r
249 $(EPOCBLDUREL)\Area.o : ..\..\pico\Area.c ..\..\pico\picoInt.h ..\..\pico\Pico.h
\r
251 @$(GCC) -o $@ "..\..\pico\Area.c"
\r
253 $(EPOCBLDUREL)\Misc.o : ..\..\pico\Misc.c ..\..\pico\picoInt.h ..\..\pico\Pico.h
\r
255 @$(GCC) -o $@ "..\..\pico\Misc.c"
\r
257 $(EPOCBLDUREL)\unzip.o : ..\..\unzip\unzip.c ..\..\unzip\unzip.h
\r
259 @$(GCC) -o $@ "..\..\unzip\unzip.c"
\r
261 # assembly "optimized" stuff
\r
262 $(EPOCBLDUREL)\blit.o : blit.s
\r
264 @as -marmv4t -mthumb-interwork -o $@ blit.s
\r
266 $(EPOCBLDUREL)\draw_asm.o : ..\..\pico\draw.s
\r
268 @as -marmv4t -mthumb-interwork -o $@ ..\..\pico\draw.s
\r
270 $(EPOCBLDUREL)\draw2_asm.o : ..\..\pico\draw2.s
\r
272 @as -marmv4t -mthumb-interwork -o $@ ..\..\pico\draw2.s
\r
274 $(EPOCBLDUREL)\memory_asm.o : ..\..\pico\memory.s
\r
276 @as -marmv4t -mthumb-interwork -o $@ ..\..\pico\memory.s
\r
279 $(EPOCBLDUREL)\sound.o : ..\..\pico\sound\sound.c ..\..\pico\sound\sound.h
\r
281 @$(GCC) -o $@ "..\..\pico\sound\sound.c"
\r
283 $(EPOCBLDUREL)\ym2612.o : ..\..\pico\sound\ym2612.c ..\..\pico\sound\ym2612.h ..\..\pico\sound\driver.h
\r
285 @$(GCC) -o $@ "..\..\pico\sound\ym2612.c"
\r
287 $(EPOCBLDUREL)\sn76496.o : ..\..\pico\sound\sn76496.c ..\..\pico\sound\sn76496.h ..\..\pico\sound\driver.h
\r
289 @$(GCC) -o $@ "..\..\pico\sound\sn76496.c"
\r
291 $(EPOCBLDUREL)\mz80.o : ..\..\pico\sound\mz80.c ..\..\pico\sound\mz80.h
\r
293 @$(GCC) -o $@ "..\..\pico\sound\mz80.c"
\r
295 # -D__DEBUG_PRINT_SND
\r
299 $(EPOCBLDUREL)\_cyclone_debug.o : ..\..\pico\_cyclone_debug.c
\r
300 @echo * _cyclone_debug.c
\r
301 @$(GCC) -o $@ "..\..\pico\_cyclone_debug.c"
\r
303 # generic rule for generic C stuff
\r
311 # --- SRCFILES END ---
\r
314 # Rules to create all necessary directories
\r
320 @echo * making build dir
\r
321 @perl -S emkdir.pl $@
\r