From 1176712cfebba527fac1438fdf8ca8b9e643a8e7 Mon Sep 17 00:00:00 2001 From: yenatch Date: Fri, 29 Jan 2016 01:10:41 -0500 Subject: Use rgbasm -D instead of extra files for version differences. --- Makefile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 261b58c24..ccfd36357 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ includes := $(PYTHON) $(poketools)/scan_includes.py crystal11_obj := \ wram11.o \ -crystal11.o \ +main11.o \ lib/mobile/main.o \ home.o \ audio.o \ @@ -42,10 +42,10 @@ misc/crystal_misc.o \ text/common_text.o \ gfx/pics.o -all_obj := $(crystal_obj) crystal11.o wram11.o +all_obj := $(crystal_obj) main11.o wram11.o # object dependencies -$(foreach obj, $(all_obj), \ +$(foreach obj, $(crystal_obj), \ $(eval $(obj:.o=)_dep := $(shell $(includes) $(obj:.o=.asm))) \ ) @@ -64,7 +64,9 @@ compare: pokecrystal.gbc pokecrystal11.gbc @$(MD5) roms.md5 %.asm: ; -$(all_obj): $$*.asm $$($$*_dep) +%11.o: %.asm $$(%_dep) + rgbasm -D CRYSTAL11 -o $@ $< +%.o: %.asm $$(%_dep) rgbasm -o $@ $< pokecrystal11.gbc: $(crystal11_obj) -- cgit v1.2.3 From 08ac6dfd80000f1cdd449225e4d2cc195e086439 Mon Sep 17 00:00:00 2001 From: yenatch Date: Fri, 29 Jan 2016 16:24:02 -0500 Subject: *_crystal.asm files are no longer needed to build crystal *.o. --- Makefile | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index ccfd36357..d458381b2 100644 --- a/Makefile +++ b/Makefile @@ -16,12 +16,12 @@ main11.o \ lib/mobile/main.o \ home.o \ audio.o \ -maps_crystal.o \ -engine/events_crystal.o \ -engine/credits_crystal.o \ -data/egg_moves_crystal.o \ -data/evos_attacks_crystal.o \ -data/pokedex/entries_crystal.o \ +maps.o \ +engine/events.o \ +engine/credits.o \ +data/egg_moves.o \ +data/evos_attacks.o \ +data/pokedex/entries.o \ misc/crystal_misc.o \ text/common_text.o \ gfx/pics.o @@ -32,12 +32,12 @@ main.o \ lib/mobile/main.o \ home.o \ audio.o \ -maps_crystal.o \ -engine/events_crystal.o \ -engine/credits_crystal.o \ -data/egg_moves_crystal.o \ -data/evos_attacks_crystal.o \ -data/pokedex/entries_crystal.o \ +maps.o \ +engine/events.o \ +engine/credits.o \ +data/egg_moves.o \ +data/evos_attacks.o \ +data/pokedex/entries.o \ misc/crystal_misc.o \ text/common_text.o \ gfx/pics.o @@ -69,6 +69,10 @@ compare: pokecrystal.gbc pokecrystal11.gbc %.o: %.asm $$(%_dep) rgbasm -o $@ $< +# This seems to be required because of a filename collision (but not a path collision). +lib/%.o: lib/%.asm $$(lib/%_dep) + rgbasm -o $@ $< + pokecrystal11.gbc: $(crystal11_obj) rgblink -n $*.sym -m $*.map -o $@ $^ rgbfix -Cjv -i BYTE -k 01 -l 0x33 -m 0x10 -n 1 -p 0 -r 3 -t PM_CRYSTAL $@ -- cgit v1.2.3 From 36f0bda0b33f5444241f1081b93f63f94a1b046a Mon Sep 17 00:00:00 2001 From: yenatch Date: Wed, 10 Feb 2016 00:31:32 -0500 Subject: Use static pattern rules to fix dependencies for objects in subdirs. --- Makefile | 34 ++++++---------------------------- 1 file changed, 6 insertions(+), 28 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index d458381b2..c5fad3779 100644 --- a/Makefile +++ b/Makefile @@ -10,22 +10,6 @@ gfx := $(PYTHON) gfx.py includes := $(PYTHON) $(poketools)/scan_includes.py -crystal11_obj := \ -wram11.o \ -main11.o \ -lib/mobile/main.o \ -home.o \ -audio.o \ -maps.o \ -engine/events.o \ -engine/credits.o \ -data/egg_moves.o \ -data/evos_attacks.o \ -data/pokedex/entries.o \ -misc/crystal_misc.o \ -text/common_text.o \ -gfx/pics.o - crystal_obj := \ wram.o \ main.o \ @@ -42,11 +26,10 @@ misc/crystal_misc.o \ text/common_text.o \ gfx/pics.o -all_obj := $(crystal_obj) main11.o wram11.o +crystal11_obj := $(crystal_obj:.o=11.o) -# object dependencies -$(foreach obj, $(crystal_obj), \ - $(eval $(obj:.o=)_dep := $(shell $(includes) $(obj:.o=.asm))) \ +$(foreach obj, $(crystal_obj:.o=), \ + $(eval $(obj)_dep := $(shell $(includes) $(obj).asm)) \ ) @@ -54,23 +37,18 @@ roms := pokecrystal.gbc all: $(roms) crystal: pokecrystal.gbc - crystal11: pokecrystal11.gbc clean: - rm -f $(roms) $(all_obj) $(roms:.gbc=.map) $(roms:.gbc=.sym) + rm -f $(roms) $(crystal_obj) $(crystal11_obj) $(roms:.gbc=.map) $(roms:.gbc=.sym) compare: pokecrystal.gbc pokecrystal11.gbc @$(MD5) roms.md5 %.asm: ; -%11.o: %.asm $$(%_dep) +$(crystal11_obj): %11.o: %.asm $$(%_dep) rgbasm -D CRYSTAL11 -o $@ $< -%.o: %.asm $$(%_dep) - rgbasm -o $@ $< - -# This seems to be required because of a filename collision (but not a path collision). -lib/%.o: lib/%.asm $$(lib/%_dep) +$(crystal_obj): %.o: %.asm $$(%_dep) rgbasm -o $@ $< pokecrystal11.gbc: $(crystal11_obj) -- cgit v1.2.3 From 73a660bf2a4f4d91ee846f403ce128fc30958b85 Mon Sep 17 00:00:00 2001 From: yenatch Date: Wed, 17 Feb 2016 16:22:05 -0500 Subject: Remove "make pngs". --- Makefile | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index c5fad3779..cb6a66726 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ PYTHON := python MD5 := md5sum -c --quiet .SUFFIXES: .asm .o .gbc .png .2bpp .1bpp .lz .pal .bin .blk .tilemap -.PHONY: all clean crystal crystal11 pngs +.PHONY: all clean crystal crystal11 .SECONDEXPANSION: poketools := extras/pokemontools @@ -60,12 +60,7 @@ pokecrystal.gbc: $(crystal_obj) rgbfix -Cjv -i BYTE -k 01 -l 0x33 -m 0x10 -p 0 -r 3 -t PM_CRYSTAL $@ -pngs: - find . -iname "*.lz" -exec $(gfx) unlz {} + - find . -iname "*.[12]bpp" -exec $(gfx) png {} + - find . -iname "*.[12]bpp" -exec touch {} \; - find . -iname "*.lz" -exec touch {} \; - +%.png: ; %.2bpp: %.png ; $(gfx) 2bpp $< %.1bpp: %.png ; $(gfx) 1bpp $< %.lz: % ; $(gfx) lz $< -- cgit v1.2.3 From 782cbc14d66e544ed78dc9d6468455baad239834 Mon Sep 17 00:00:00 2001 From: yenatch Date: Tue, 1 Mar 2016 20:58:00 -0500 Subject: Only use suffixes needed for intermediate rules. This is technically a hack, since keeping the .asm suffix was causing nonexistent rules to be evaluated as per the next commit. On the other hand, this is the intended purpose of .SUFFIXES. --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index cb6a66726..c1e16af65 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,8 @@ PYTHON := python MD5 := md5sum -c --quiet -.SUFFIXES: .asm .o .gbc .png .2bpp .1bpp .lz .pal .bin .blk .tilemap +.SUFFIXES: +.SUFFIXES: .2bpp .PHONY: all clean crystal crystal11 .SECONDEXPANSION: -- cgit v1.2.3 From e11ef2b8d5d73fd8c56ee015c78b086aaf3daf02 Mon Sep 17 00:00:00 2001 From: yenatch Date: Tue, 1 Mar 2016 21:01:34 -0500 Subject: 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(-) (limited to 'Makefile') 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) -- cgit v1.2.3 From 0be6e6c910ea4ab7909d878aa12c4c7989d5ca13 Mon Sep 17 00:00:00 2001 From: yenatch Date: Tue, 1 Mar 2016 21:09:34 -0500 Subject: Remove useless lines in the makefile. The previous rules were composed this way but only because target-specific variables weren't used. As they are now, they actually do nothing. --- Makefile | 2 -- 1 file changed, 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 44f872647..65c64ede0 100644 --- a/Makefile +++ b/Makefile @@ -45,12 +45,10 @@ compare: pokecrystal.gbc pokecrystal11.gbc %.asm: ; %11.o: dep = $(shell $(includes) $(@D)/$*.asm) -$(crystal11_obj): %11.o: %11.o: %.asm $$(dep) rgbasm -D CRYSTAL11 -o $@ $< %.o: dep = $(shell $(includes) $(@D)/$*.asm) -$(crystal_obj): %.o: %.o: %.asm $$(dep) rgbasm -o $@ $< -- cgit v1.2.3