diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 55 |
1 files changed, 50 insertions, 5 deletions
@@ -1,4 +1,9 @@ -roms := pokecrystal.gbc pokecrystal11.gbc pokecrystal_au.gbc pokecrystal_debug.gbc pokecrystal11_debug.gbc +roms := pokecrystal.gbc \ + pokecrystal11.gbc \ + pokecrystal_au.gbc \ + pokecrystal_debug.gbc \ + pokecrystal11_debug.gbc +patches := pokecrystal11.patch rom_obj := \ audio.o \ @@ -23,6 +28,7 @@ pokecrystal11_obj := $(rom_obj:.o=11.o) pokecrystal_au_obj := $(rom_obj:.o=_au.o) pokecrystal_debug_obj := $(rom_obj:.o=_debug.o) pokecrystal11_debug_obj := $(rom_obj:.o=11_debug.o) +pokecrystal11_vc_obj := $(rom_obj:.o=11_vc.o) ### Build tools @@ -54,16 +60,42 @@ crystal11: pokecrystal11.gbc crystal_au: pokecrystal_au.gbc crystal_debug: pokecrystal_debug.gbc crystal11_debug: pokecrystal11_debug.gbc +crystal11_vc: pokecrystal11.patch clean: tidy - find gfx \( -name "*.[12]bpp" -o -name "*.lz" -o -name "*.gbcpal" -o -name "*.sgb.tilemap" \) -delete - find gfx/pokemon -mindepth 1 ! -path "gfx/pokemon/unown/*" \( -name "bitmask.asm" -o -name "frames.asm" -o -name "front.animated.tilemap" -o -name "front.dimensions" \) -delete + find gfx \ + \( -name "*.[12]bpp" \ + -o -name "*.lz" \ + -o -name "*.gbcpal" \ + -o -name "*.sgb.tilemap" \) \ + -delete + find gfx/pokemon -mindepth 1 \ + ! -path "gfx/pokemon/unown/*" \ + \( -name "bitmask.asm" \ + -o -name "frames.asm" \ + -o -name "front.animated.tilemap" \ + -o -name "front.dimensions" \) \ + -delete tidy: - $(RM) $(roms) $(pokecrystal_obj) $(pokecrystal11_obj) $(pokecrystal_au_obj) $(pokecrystal_debug_obj) $(pokecrystal11_debug_obj) $(roms:.gbc=.map) $(roms:.gbc=.sym) rgbdscheck.o + $(RM) $(roms) \ + $(roms:.gbc=.sym) \ + $(roms:.gbc=.map) \ + $(patches) \ + $(patches:.patch=_vc.gbc) \ + $(patches:.patch=_vc.sym) \ + $(patches:.patch=_vc.map) \ + $(patches:%.patch=vc/%.constants.sym) \ + $(pokecrystal_obj) \ + $(pokecrystal11_obj) \ + $(pokecrystal11_vc_obj) \ + $(pokecrystal_au_obj) \ + $(pokecrystal_debug_obj) \ + $(pokecrystal11_debug_obj) \ + rgbdscheck.o $(MAKE) clean -C tools/ -compare: $(roms) +compare: $(roms) $(patches) @$(SHA1) -c roms.sha1 tools: @@ -81,6 +113,12 @@ $(pokecrystal11_obj): RGBASMFLAGS += -D _CRYSTAL11 $(pokecrystal_au_obj): RGBASMFLAGS += -D _CRYSTAL11 -D _CRYSTAL_AU $(pokecrystal_debug_obj): RGBASMFLAGS += -D _DEBUG $(pokecrystal11_debug_obj): RGBASMFLAGS += -D _CRYSTAL11 -D _DEBUG +$(pokecrystal11_vc_obj): RGBASMFLAGS += -D _CRYSTAL11 -D _CRYSTAL11_VC + +%.patch: %_vc.sym vc/%.constants.sym %_vc.gbc %.gbc vc/%.patch.template + tools/make_patch $^ $@ + +%.sym: ; rgbdscheck.o: rgbdscheck.asm $(RGBASM) -o $@ $< @@ -105,6 +143,11 @@ $(foreach obj, $(pokecrystal11_obj), $(eval $(call DEP,$(obj),$(obj:11.o=.asm))) $(foreach obj, $(pokecrystal_au_obj), $(eval $(call DEP,$(obj),$(obj:_au.o=.asm)))) $(foreach obj, $(pokecrystal_debug_obj), $(eval $(call DEP,$(obj),$(obj:_debug.o=.asm)))) $(foreach obj, $(pokecrystal11_debug_obj), $(eval $(call DEP,$(obj),$(obj:11_debug.o=.asm)))) +$(foreach obj, $(pokecrystal11_vc_obj), $(eval $(call DEP,$(obj),$(obj:11_vc.o=.asm)))) + +# Dependencies for VC files that need to run scan_includes +%.constants.sym: %.constants.asm $(shell tools/scan_includes %.constants.asm) | rgbdscheck.o + $(RGBASM) $< > $@ endif @@ -114,10 +157,12 @@ pokecrystal11_opt = -Cjv -t PM_CRYSTAL -i BYTE -n 1 -k 01 -l 0x33 -m 0x10 pokecrystal_au_opt = -Cjv -t PM_CRYSTAL -i BYTU -n 0 -k 01 -l 0x33 -m 0x10 -r 3 -p 0 pokecrystal_debug_opt = -Cjv -t PM_CRYSTAL -i BYTE -n 0 -k 01 -l 0x33 -m 0x10 -r 3 -p 0 pokecrystal11_debug_opt = -Cjv -t PM_CRYSTAL -i BYTE -n 1 -k 01 -l 0x33 -m 0x10 -r 3 -p 0 +pokecrystal11_vc_opt = -Cjv -t PM_CRYSTAL -i BYTE -n 1 -k 01 -l 0x33 -m 0x10 -r 3 -p 0 pokecrystal_base = us pokecrystal11_base = us pokecrystal_au_base = us +pokecrystal11_vc_base = us pokecrystal_debug_base = dbg pokecrystal11_debug_base = dbg |