-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
36 lines (26 loc) · 1.06 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
# If you move this project you can change the directory
# to match your GBDK root directory (ex: GBDK_HOME = "C:/GBDK/"
GBDK_HOME = ../../../
LCC = $(GBDK_HOME)bin/lcc
# You can uncomment the line below to turn on debug output
# LCC = $(LCC) -debug
# You can set the name of the .gb ROM file here
PROJECTNAME = magic-life
BINS = $(PROJECTNAME).gb
CSOURCES := $(wildcard src/*.c)
ASMSOURCES := $(wildcard src/*.s)
all: $(BINS)
compile.bat: Makefile
@echo "REM Automatically generated from Makefile" > compile.bat
@make -sn | sed y/\\//\\\\/ | grep -v make >> compile.bat
# Compile and link all source files in a single call to LCC
# -Wm-yc : color support
# -Wl-yt0x1B : MBC5 ROM + RAM + Battery (for better compatibility with emulators)
# -Wl-ya1 : 1 RAM bank
$(BINS): $(CSOURCES) $(ASMSOURCES)
$(LCC) -Wm-yn"MAGICLIFE" -Wl-yt0x1B -Wl-ya1 -D_ram_func=0xD000 -o $@ $(CSOURCES) assets/*.c $(ASMSOURCES)
python3 rom_size.py $(BINS)
clean:
rm -f *.o *.lst *.map *.gb *.ihx *.sym *.cdb *.adb *.asm
dev:
make && (killall SameBoy || true) && open $(PROJECTNAME).gb