-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMAKEFILE.BAT
47 lines (47 loc) · 1.24 KB
/
MAKEFILE.BAT
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
@echo off
REM MAKEFILE for 16K ROMs using SDCC compiler
REM CFILENAME = Source name without extension
REM ROMFILENAME = ROM file name without extension
REM ROMSIZE = 2000 for 8KBytes ROM or 4000 for 16KBytes ROM
SET CFILENAME=tarp
SET ROMFILENAME=TARP1
SET CODELOC=0x4020
SET ROMSIZE=4000
SET CRT=libs\crt0msx.16k.4000.rel
SET LIB0=libs\joystick_ROM.rel
SET LIB1=libs\VDP_TMS9918_ROM.rel
SET LIB2=libs\VDP_SPRITES_ROM1.rel
SET LIB3=libs\keyboard_MSXROM.rel
SET LIB4=libs\memory.rel
SET LIB5=libs\unRLEWBtoVRAM.rel
SET LIB6=libs\unRLEWBtoRAM.rel
SET LIB7=
SET LIB8=
SET LIB9=
SET LIB10=
SET LIB11=
SET LIB12=
if exist build\ goto NEXTSTEP1
echo MAKEDIR build
md build
:NEXTSTEP1
if exist bin\ goto NEXTSTEP2
echo MAKEDIR bin
md bin
:NEXTSTEP2
REM get SDCC version
sdcc -v
if not exist build\%CFILENAME%.ihx goto COMPILA
del build\%CFILENAME%.ihx
:COMPILA
echo Compiling...
sdcc -mz80 -o build\ --code-loc %CODELOC% --data-loc 0xC000 --use-stdout --no-std-crt0 %CRT% %LIB0% %LIB1% %LIB2% %LIB3% %LIB4% %LIB5% %LIB6% %LIB7% %LIB8% %LIB9% %LIB10% %LIB11% %LIB12% sources\%CFILENAME%.c
if not exist build\%CFILENAME%.ihx goto SALIDA
hex2bin -e bin -l %ROMSIZE% build\%CFILENAME%.ihx
copy build\%CFILENAME%.bin bin\%ROMFILENAME%.ROM
pause
exit /b
:SALIDA
echo ERROR
pause
exit /b