-
Notifications
You must be signed in to change notification settings - Fork 2
/
make.bat
49 lines (31 loc) · 1.09 KB
/
make.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
48
49
@echo off
:: Cleanup
rmdir /s /q bin
rmdir /s /q dist
:: Cleanup
mkdir bin
mkdir dist
SET GBDK_HOME=C:/gbdk
SET LCC_COMPILE_BASE=%GBDK_HOME%\bin\lcc -Iheaders/main -Iheaders/gen -Wa-l -Wl-m -Wl-j -DUSE_SFR_FOR_REG
SET LCC_COMPILE=%LCC_COMPILE_BASE% -c -o
:: Required to concatenate the "COMPILE_OBJECT_FILES" via a for loop
SETLOCAL ENABLEDELAYEDEXPANSION
SET "COMPILE_OBJECT_FILES="
call generate-graphics.bat
:: loop for all files in the default source folder
FOR /R "source/gen/" %%X IN (*.c) DO (
echo Compiling %%~nX ...
%LCC_COMPILE% bin/gen_%%~nX.o %%X
SET "COMPILE_OBJECT_FILES=bin/gen_%%~nX.o !COMPILE_OBJECT_FILES!"
)
:: loop for all files in the default source folder
FOR /R "source/default/" %%X IN (*.c) DO (
echo Compiling %%~nX ...
%LCC_COMPILE% bin/%%~nX.o %%X
SET "COMPILE_OBJECT_FILES=bin/%%~nX.o !COMPILE_OBJECT_FILES!"
)
:: Compile a .gb file from the compiled .o files
%LCC_COMPILE_BASE% -Wm-yc -o dist/Pacman.gb !COMPILE_OBJECT_FILES!
endlocal
:: Use the romusage.exe to show the size of the ROM and what makes it up
"lib/romusage" dist\Pacman.noi -a