From d79082f39cfe6700a60e0f025c23b42fbb1c3116 Mon Sep 17 00:00:00 2001 From: IIMarckus Date: Fri, 1 Jun 2018 15:51:29 -0600 Subject: =?UTF-8?q?Don=E2=80=99t=20build=20duplicates=20of=20identical=20o?= =?UTF-8?q?bject=20files.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'Makefile') 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 -- cgit v1.2.3