From e11ef2b8d5d73fd8c56ee015c78b086aaf3daf02 Mon Sep 17 00:00:00 2001 From: yenatch Date: Tue, 1 Mar 2016 21:01:34 -0500 Subject: [PATCH] Only generate dependencies for a target when it's invoked. This means dependencies for unrelated targets aren't generated if you aren't building them. This makes "make clean" and building individual targets fast again. --- Makefile | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index c1e16af65..44f872647 100644 --- a/Makefile +++ b/Makefile @@ -29,10 +29,6 @@ gfx/pics.o crystal11_obj := $(crystal_obj:.o=11.o) -$(foreach obj, $(crystal_obj:.o=), \ - $(eval $(obj)_dep := $(shell $(includes) $(obj).asm)) \ -) - roms := pokecrystal.gbc @@ -47,9 +43,15 @@ compare: pokecrystal.gbc pokecrystal11.gbc @$(MD5) roms.md5 %.asm: ; -$(crystal11_obj): %11.o: %.asm $$(%_dep) + +%11.o: dep = $(shell $(includes) $(@D)/$*.asm) +$(crystal11_obj): %11.o: +%11.o: %.asm $$(dep) rgbasm -D CRYSTAL11 -o $@ $< -$(crystal_obj): %.o: %.asm $$(%_dep) + +%.o: dep = $(shell $(includes) $(@D)/$*.asm) +$(crystal_obj): %.o: +%.o: %.asm $$(dep) rgbasm -o $@ $< pokecrystal11.gbc: $(crystal11_obj)