This commit is contained in:
dannye 2023-04-19 20:04:38 -05:00
commit 772520c2c2
63 changed files with 4114 additions and 1216 deletions

View file

@ -69,7 +69,7 @@ tools:
$(MAKE) -C tools/
RGBASMFLAGS = -h -L -Weverything -Wnumeric-string=2 -Wtruncation=1
RGBASMFLAGS = -hL -Q8 -P includes.asm -Weverything -Wnumeric-string=2 -Wtruncation=1
# Create a sym/map for debug purposes if `make` run with `DEBUG=1`
ifeq ($(DEBUG),1)
RGBASMFLAGS += -E
@ -83,26 +83,27 @@ $(kep_obj): RGBASMFLAGS += -D _KEP -D _DEBUG
rgbdscheck.o: rgbdscheck.asm
$(RGBASM) -o $@ $<
# The dep rules have to be explicit or else missing files won't be reported.
# As a side effect, they're evaluated immediately instead of when the rule is invoked.
# It doesn't look like $(shell) can be deferred so there might not be a better way.
define DEP
$1: $2 $$(shell tools/scan_includes $2) | rgbdscheck.o
$$(RGBASM) $$(RGBASMFLAGS) -o $$@ $$<
endef
# Build tools when building the rom.
# This has to happen before the rules are processed, since that's when scan_includes is run.
ifeq (,$(filter clean tidy tools,$(MAKECMDGOALS)))
$(info $(shell $(MAKE) -C tools))
# The dep rules have to be explicit or else missing files won't be reported.
# As a side effect, they're evaluated immediately instead of when the rule is invoked.
# It doesn't look like $(shell) can be deferred so there might not be a better way.
preinclude_deps := includes.asm $(shell tools/scan_includes includes.asm)
define DEP
$1: $2 $$(shell tools/scan_includes $2) $(preinclude_deps) | rgbdscheck.o
$$(RGBASM) $$(RGBASMFLAGS) -o $$@ $$<
endef
# Dependencies for objects (drop _red and _blue from asm file basenames)
$(foreach obj, $(kep_obj), $(eval $(call DEP,$(obj),$(obj:_kep.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) $< > $@
%.constants.sym: %.constants.asm $(shell tools/scan_includes %.constants.asm) $(preinclude_deps) | rgbdscheck.o
$(RGBASM) $(RGBASMFLAGS) $< > $@
endif
@ -121,13 +122,13 @@ kep_opt = -jsv -n 0 -k 01 -l 0x33 -m 0x13 -r 03 -t "KEP Hack"
### Misc file-specific graphics rules
gfx/battle/attack_anim_1.2bpp: tools/gfx += --trim-whitespace
gfx/battle/attack_anim_2.2bpp: tools/gfx += --trim-whitespace
gfx/battle/move_anim_0.2bpp: tools/gfx += --trim-whitespace
gfx/battle/move_anim_1.2bpp: tools/gfx += --trim-whitespace
gfx/intro/red_nidorino_1.2bpp: rgbgfx += -h
gfx/intro/red_nidorino_2.2bpp: rgbgfx += -h
gfx/intro/red_nidorino_3.2bpp: rgbgfx += -h
gfx/intro/gengar.2bpp: rgbgfx += -h
gfx/intro/red_nidorino_1.2bpp: rgbgfx += -Z
gfx/intro/red_nidorino_2.2bpp: rgbgfx += -Z
gfx/intro/red_nidorino_3.2bpp: rgbgfx += -Z
gfx/intro/gengar.2bpp: rgbgfx += -Z
gfx/intro/gengar.2bpp: tools/gfx += --remove-duplicates --preserve=0x19,0x76
gfx/credits/the_end.2bpp: tools/gfx += --interleave --png=$<