rewrite Makefile to handle multiple rgbasm objects

for now, any new files to preprocess will trigger the targets for all objects.
this isn't a problem yet since there's still only one object.
This commit is contained in:
yenatch 2013-09-10 18:24:44 -04:00
parent 018cf26767
commit 4db0e3c186

View File

@ -4,6 +4,8 @@ PYTHON := python
TEXTFILES := $(shell find ./ -type f -name '*.asm') TEXTFILES := $(shell find ./ -type f -name '*.asm')
TEXTQUEUE := TEXTQUEUE :=
OBJS := pokecrystal.o
PNG_GFX := $(shell find gfx/ -type f -name '*.png') PNG_GFX := $(shell find gfx/ -type f -name '*.png')
LZ_GFX := $(shell find gfx/ -type f -name '*.lz') LZ_GFX := $(shell find gfx/ -type f -name '*.lz')
TWOBPP_GFX := $(shell find gfx/ -type f -name '*.2bpp') TWOBPP_GFX := $(shell find gfx/ -type f -name '*.2bpp')
@ -14,18 +16,21 @@ clean:
rm -f pokecrystal.o pokecrystal.gbc rm -f pokecrystal.o pokecrystal.gbc
@echo 'Removing preprocessed .tx files...' @echo 'Removing preprocessed .tx files...'
@rm -f $(TEXTFILES:.asm=.tx) @rm -f $(TEXTFILES:.asm=.tx)
pokecrystal.o: $(TEXTFILES:.asm=.tx) $(LZ_GFX) $(TWOBPP_GFX)
@echo "Preprocessing .asm to .tx..."
@$(PYTHON) prequeue.py $(TEXTQUEUE)
rgbasm -o pokecrystal.o pokecrystal.tx
.asm.tx:
$(eval TEXTQUEUE := $(TEXTQUEUE) $<)
@rm -f $@
baserom.gbc: baserom.gbc:
@echo "Wait! Need baserom.gbc first. Check README and INSTALL for details." && false @echo "Wait! Need baserom.gbc first. Check README and INSTALL for details." && false
pokecrystal.gbc: pokecrystal.o .asm.tx:
rgblink -n pokecrystal.sym -m pokecrystal.map -o $@ $< $(eval TEXTQUEUE := $(TEXTQUEUE) $<)
@rm -f $@
$(OBJS): $(TEXTFILES:.asm=.tx) $(LZ_GFX) $(TWOBPP_GFX)
@echo "Preprocessing .asm to .tx..."
@$(PYTHON) prequeue.py $(TEXTQUEUE)
rgbasm -o $@ $(@:.o=.tx)
pokecrystal.gbc: $(OBJS)
rgblink -n pokecrystal.sym -m pokecrystal.map -o pokecrystal.gbc $<
rgbfix -Cjv -i BYTE -k 01 -l 0x33 -m 0x10 -p 0 -r 3 -t PM_CRYSTAL $@ rgbfix -Cjv -i BYTE -k 01 -l 0x33 -m 0x10 -p 0 -r 3 -t PM_CRYSTAL $@
pngs: pngs: