-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
executable file
·56 lines (43 loc) · 1.23 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
55
56
PYTHON := python
MD5 := md5sum -c --quiet
2bpp := $(PYTHON) gfx.py 2bpp
1bpp := $(PYTHON) gfx.py 1bpp
pcm := $(PYTHON) extras/pokemontools/pcm.py pcm
pic := $(PYTHON) extras/pokemontools/pic.py compress
includes := $(PYTHON) extras/pokemontools/scan_includes.py
objs := \
audio.o \
main.o \
text.o \
wram.o
$(foreach obj, $(objs:.o=), \
$(eval $(obj)_dep := $(shell $(includes) $(obj).asm)) \
)
.SUFFIXES:
.SUFFIXES: .asm .o .gbc .png .2bpp .1bpp .pic .wav .pcm
.SECONDEXPANSION:
# Suppress annoying intermediate file deletion messages.
.PRECIOUS: %.2bpp
.PHONY: all clean yellow compare
rom := pokeyellow.gbc
all: $(rom)
yellow: $(rom)
# For contributors to make sure a change didn't affect the contents of the rom.
compare: yellow
@$(MD5) roms.md5
clean:
rm -f $(rom) $(objs) $(rom:.gbc=.sym)
find . \( -iname '*.1bpp' -o -iname '*.2bpp' -o -iname '*.pic' -o -iname '*.pcm' \) -exec rm {} +
%.asm: ;
$(objs): %.o: %.asm $$(%_dep)
rgbasm -h -o $@ $*.asm
opts = -cjsv -k 01 -l 0x33 -m 0x1b -p 0 -r 03 -t "POKEMON YELAPSK"
$(rom): $(objs)
rgblink -n $*.sym -o $@ $^
rgbfix $(opts) $@
%.png: ;
%.2bpp: %.png ; @$(2bpp) $<
%.1bpp: %.png ; @$(1bpp) $<
%.pic: %.2bpp ; @$(pic) $<
%.wav: ;
%.pcm: %.wav ; @$(pcm) $<