This repository has been archived by the owner on Aug 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
54 lines (41 loc) · 1.58 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
PYTHON := python
MD5 := md5sum -c --quiet
2bpp := $(PYTHON) extras/pokemontools/gfx.py 2bpp
1bpp := $(PYTHON) extras/pokemontools/gfx.py 1bpp
pic := $(PYTHON) extras/pokemontools/pic.py compress
includes := $(PYTHON) extras/pokemontools/scan_includes.py
LetsGoEeveeGB_obj := audio_red.o main_red.o text_red.o wram_red.o
LetsGoPikachuGB_obj := audio_blue.o main_blue.o text_blue.o wram_blue.o
.SUFFIXES:
.SUFFIXES: .asm .o .gbc .png .2bpp .1bpp .pic
.SECONDEXPANSION:
# Suppress annoying intermediate file deletion messages.
.PRECIOUS: %.2bpp
.PHONY: all clean red blue compare
roms := LetsGoEeveeGB.gbc LetsGoPikachuGB.gbc
all: $(roms)
red: LetsGoEeveeGB.gbc
blue: LetsGoPikachuGB.gbc
# For contributors to make sure a change didn't affect the contents of the rom.
compare: red blue
@$(MD5) roms.md5
clean:
rm -f $(roms) $(LetsGoEeveeGB_obj) $(LetsGoPikachuGB_obj) $(roms:.gbc=.sym)
find . \( -iname '*.1bpp' -o -iname '*.2bpp' -o -iname '*.pic' \) -exec rm {} +
%.asm: ;
%_red.o: dep = $(shell $(includes) $(@D)/$*.asm)
$(LetsGoEeveeGB_obj): %_red.o: %.asm $$(dep)
rgbasm -D _RED -h -o $@ $*.asm
%_blue.o: dep = $(shell $(includes) $(@D)/$*.asm)
$(LetsGoPikachuGB_obj): %_blue.o: %.asm $$(dep)
rgbasm -D _BLUE -h -o $@ $*.asm
LetsGoEeveeGB_opt = -jsv -k 01 -l 0x33 -m 0x13 -p 0 -r 03 -t "LETSGOGBEEVEE"
LetsGoPikachuGB_opt = -jsv -k 01 -l 0x33 -m 0x13 -p 0 -r 03 -t "LETSGOGBPIKA"
%.gbc: $$(%_obj)
rgblink -n $*.sym -l pokered.link -o $@ $^
rgbfix $($*_opt) $@
sort $*.sym -o $*.sym
%.png: ;
%.2bpp: %.png ; @$(2bpp) $<
%.1bpp: %.png ; @$(1bpp) $<
%.pic: %.2bpp ; @$(pic) $<