summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile13
1 files changed, 9 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 32d37f16..bc3f1459 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,8 @@
MD5 := md5sum -c
-pokered_obj := audio_red.o main_red.o text_red.o wram_red.o
-pokeblue_obj := audio_blue.o main_blue.o text_blue.o wram_blue.o
+pokered_obj := audio_red.o main_red.o
+pokeblue_obj := audio_blue.o main_blue.o
+both_obj := text.o wram.o
.SUFFIXES:
.SECONDEXPANSION:
@@ -20,7 +21,7 @@ compare: red blue
@$(MD5) roms.md5
clean:
- rm -f $(roms) $(pokered_obj) $(pokeblue_obj) $(roms:.gbc=.sym)
+ rm -f $(roms) $(pokered_obj) $(pokeblue_obj) $(both_obj) $(roms:.gbc=.sym)
find . \( -iname '*.1bpp' -o -iname '*.2bpp' -o -iname '*.pic' \) -exec rm {} +
$(MAKE) clean -C tools/
@@ -45,10 +46,14 @@ $(pokered_obj): %_red.o: %.asm $$(dep)
$(pokeblue_obj): %_blue.o: %.asm $$(dep)
rgbasm -D _BLUE -h -o $@ $*.asm
+%.o: dep = $(shell tools/scan_includes $(@D)/$*.asm)
+$(both_obj): %.o: %.asm $$(dep)
+ rgbasm -h -o $@ $*.asm
+
pokered_opt = -jsv -k 01 -l 0x33 -m 0x13 -p 0 -r 03 -t "POKEMON RED"
pokeblue_opt = -jsv -k 01 -l 0x33 -m 0x13 -p 0 -r 03 -t "POKEMON BLUE"
-%.gbc: $$(%_obj)
+%.gbc: $$(%_obj) $(both_obj)
rgblink -d -n $*.sym -l pokered.link -o $@ $^
rgbfix $($*_opt) $@
sort $*.sym -o $*.sym