summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authoryenatch <yenatch@gmail.com>2014-01-27 16:22:41 -0500
committeryenatch <yenatch@gmail.com>2014-01-27 16:24:13 -0500
commit1b9ee46af9f8baac0d266a54130115a719788377 (patch)
tree8ac61c0752dc74da0677cb26fe4db6362db5b2b7 /Makefile
parent6bde08504fdc336b1d458bab0bed4ef649cae25a (diff)
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.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile17
1 files changed, 6 insertions, 11 deletions
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" $@