From 1b9ee46af9f8baac0d266a54130115a719788377 Mon Sep 17 00:00:00 2001 From: yenatch Date: Mon, 27 Jan 2014 16:22:41 -0500 Subject: Get rid of globals.asm. Use ::s to export labels between objects. globals.asm was a hack that: - gave rgbasm an extra 100k lines to read - increased reliance on the python preprocessor - made the makefile a mess - gave object creation an extra step - wasn't even necessary This speeds up build time by at least a third. --- Makefile | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index f889f2aa..ad93c02b 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,7 @@ ROMS := pokered.gbc pokeblue.gbc # generate dependencies for each object $(shell $(foreach obj, $(OBJS), \ - $(eval $(obj:.o=)_DEPENDENCIES := $(shell $(PYTHON) extras/pokemontools/scan_includes.py $(obj:.o=.asm) | sed s/globals.asm//g)) \ + $(eval $(obj:.o=)_DEPENDENCIES := $(shell $(PYTHON) extras/pokemontools/scan_includes.py $(obj:.o=.asm))) \ )) $(shell $(foreach obj, $(OBJS), \ $(eval ALL_DEPENDENCIES += $($(obj:.o=)_DEPENDENCIES)) \ @@ -41,7 +41,6 @@ redrle: extras/redtools/redrle.c clean: rm -f $(ROMS) rm -f $(OBJS) - rm -f globals.asm @echo "removing *.tx" && find . -iname '*.tx' -exec rm {} + rm -f redrle @@ -51,23 +50,19 @@ baserom.gbc: ; %.asm: ; .asm.tx: - $(eval TEXTQUEUE := $(TEXTQUEUE) $<) + $(eval TEXTQUEUE += $<) @rm -f $@ -globals.asm: $(ALL_DEPENDENCIES:.asm=.tx) $(OBJS:.o=.tx) - @touch $@ - @$(PYTHON) prequeue.py $(TEXTQUEUE) -globals.tx: globals.asm - @cp $< $@ - $(OBJS): $$*.tx $$(patsubst %.asm, %.tx, $$($$*_DEPENDENCIES)) + @$(PYTHON) prequeue.py $(TEXTQUEUE) + @$(eval TEXTQUEUE :=) rgbasm -o $@ $*.tx -pokered.gbc: globals.tx $(RED_OBJS) +pokered.gbc: $(RED_OBJS) rgblink -n $*.sym -m $*.map -o $@ $(RED_OBJS) rgbfix -jsv -k 01 -l 0x33 -m 0x13 -p 0 -r 03 -t "POKEMON RED" $@ -pokeblue.gbc: globals.tx $(BLUE_OBJS) +pokeblue.gbc: $(BLUE_OBJS) rgblink -n $*.sym -m $*.map -o $@ $(BLUE_OBJS) rgbfix -jsv -k 01 -l 0x33 -m 0x13 -p 0 -r 03 -t "POKEMON BLUE" $@ -- cgit v1.2.3