From 2b38b9ba21181669982552975e99990289f91d4a Mon Sep 17 00:00:00 2001 From: yenatch Date: Mon, 9 Sep 2013 23:45:52 -0400 Subject: suppress .tx handling in Makefile there are too many .tx files for the commands to be meaningful better to just look at the makefile to see what's going on --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 1fe1789ad..d3cbae3c5 100644 --- a/Makefile +++ b/Makefile @@ -12,10 +12,11 @@ all: baserom.gbc pokecrystal.gbc cmp baserom.gbc pokecrystal.gbc clean: rm -f pokecrystal.o pokecrystal.gbc - @echo 'rm -f $(TEXTFILES:.asm=.tx)' + @echo 'Removing preprocessed .tx files...' @rm -f $(TEXTFILES:.asm=.tx) pokecrystal.o: $(TEXTFILES:.asm=.tx) wram.asm constants.asm $(shell find constants/ -type f -name '*.asm') hram.asm gbhw.asm $(LZ_GFX) $(TWOBPP_GFX) - $(PYTHON) prequeue.py $(TEXTQUEUE) + @echo "Preprocessing .asm to .tx..." + @$(PYTHON) prequeue.py $(TEXTQUEUE) rgbasm -o pokecrystal.o pokecrystal.asm .asm.tx: $(eval TEXTQUEUE := $(TEXTQUEUE) $<) -- cgit v1.2.3 From 6e6514c2c9e08a263a9067998161eb4a1cb6bb48 Mon Sep 17 00:00:00 2001 From: yenatch Date: Tue, 10 Sep 2013 00:08:49 -0400 Subject: no need to use python if baserom.gbc doesn't exist this part is only reached if baserom.gbc doesn't exist, so it's pointless to check if it does --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index d3cbae3c5..d480ceac1 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,7 @@ pokecrystal.o: $(TEXTFILES:.asm=.tx) wram.asm constants.asm $(shell find constan $(eval TEXTQUEUE := $(TEXTQUEUE) $<) @rm -f $@ baserom.gbc: - $(PYTHON) -c "import os; assert 'baserom.gbc' in os.listdir('.'), 'Wait! Need baserom.gbc first. Check README and INSTALL for details.';" + @echo "Wait! Need baserom.gbc first. Check README and INSTALL for details." && false pokecrystal.gbc: pokecrystal.o rgblink -n pokecrystal.sym -m pokecrystal.map -o $@ $< -- cgit v1.2.3 From 3e9e7663ec0428a5f054e09efa704aea1d704c9a Mon Sep 17 00:00:00 2001 From: yenatch Date: Tue, 10 Sep 2013 02:03:40 -0400 Subject: preprocess everything it makes more sense this way --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index d480ceac1..6fc7ce2bf 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ PYTHON := python .SUFFIXES: .asm .tx .o .gbc .png .2bpp .lz -TEXTFILES := $(shell find ./ -type f -name '*.asm' | grep -v pokecrystal.asm | grep -v constants.asm | grep -v gbhw.asm | grep -v hram.asm | grep -v constants | grep -v wram.asm) +TEXTFILES := $(shell find ./ -type f -name '*.asm') TEXTQUEUE := PNG_GFX := $(shell find gfx/ -type f -name '*.png') @@ -14,10 +14,10 @@ clean: rm -f pokecrystal.o pokecrystal.gbc @echo 'Removing preprocessed .tx files...' @rm -f $(TEXTFILES:.asm=.tx) -pokecrystal.o: $(TEXTFILES:.asm=.tx) wram.asm constants.asm $(shell find constants/ -type f -name '*.asm') hram.asm gbhw.asm $(LZ_GFX) $(TWOBPP_GFX) +pokecrystal.o: $(TEXTFILES:.asm=.tx) $(LZ_GFX) $(TWOBPP_GFX) @echo "Preprocessing .asm to .tx..." @$(PYTHON) prequeue.py $(TEXTQUEUE) - rgbasm -o pokecrystal.o pokecrystal.asm + rgbasm -o pokecrystal.o pokecrystal.tx .asm.tx: $(eval TEXTQUEUE := $(TEXTQUEUE) $<) @rm -f $@ -- cgit v1.2.3 From 4db0e3c18691b57bc8d00f02ea9fe7b116b97db1 Mon Sep 17 00:00:00 2001 From: yenatch Date: Tue, 10 Sep 2013 18:24:44 -0400 Subject: 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. --- Makefile | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 6fc7ce2bf..be357d323 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,8 @@ PYTHON := python TEXTFILES := $(shell find ./ -type f -name '*.asm') TEXTQUEUE := +OBJS := pokecrystal.o + PNG_GFX := $(shell find gfx/ -type f -name '*.png') LZ_GFX := $(shell find gfx/ -type f -name '*.lz') TWOBPP_GFX := $(shell find gfx/ -type f -name '*.2bpp') @@ -14,18 +16,21 @@ clean: rm -f pokecrystal.o pokecrystal.gbc @echo 'Removing preprocessed .tx files...' @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 + +baserom.gbc: + @echo "Wait! Need baserom.gbc first. Check README and INSTALL for details." && false + .asm.tx: $(eval TEXTQUEUE := $(TEXTQUEUE) $<) @rm -f $@ -baserom.gbc: - @echo "Wait! Need baserom.gbc first. Check README and INSTALL for details." && false -pokecrystal.gbc: pokecrystal.o - rgblink -n pokecrystal.sym -m pokecrystal.map -o $@ $< +$(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 $@ pngs: -- cgit v1.2.3 From 6a21963799575fa8a88ed55cde5408ef67c92d63 Mon Sep 17 00:00:00 2001 From: yenatch Date: Wed, 11 Sep 2013 01:20:52 -0400 Subject: scan source files for Makefile dependencies preprocessing should work with multiple object files now --- Makefile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index be357d323..614462cf9 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ PYTHON := python .SUFFIXES: .asm .tx .o .gbc .png .2bpp .lz +.SECONDEXPANSION: TEXTFILES := $(shell find ./ -type f -name '*.asm') TEXTQUEUE := @@ -10,6 +11,8 @@ PNG_GFX := $(shell find gfx/ -type f -name '*.png') LZ_GFX := $(shell find gfx/ -type f -name '*.lz') TWOBPP_GFX := $(shell find gfx/ -type f -name '*.2bpp') +$(shell $(foreach obj, $(OBJS), $(eval OBJ_$(obj:.o=) := $(shell $(PYTHON) scan_includes.py $(obj:.o=.asm))))) + all: baserom.gbc pokecrystal.gbc cmp baserom.gbc pokecrystal.gbc clean: @@ -24,9 +27,10 @@ baserom.gbc: $(eval TEXTQUEUE := $(TEXTQUEUE) $<) @rm -f $@ -$(OBJS): $(TEXTFILES:.asm=.tx) $(LZ_GFX) $(TWOBPP_GFX) +$(OBJS): $$(patsubst %.o,%.tx,$$@) $$(patsubst %.asm,%.tx,$$(OBJ_$$(patsubst %.o,%,$$@))) @echo "Preprocessing .asm to .tx..." @$(PYTHON) prequeue.py $(TEXTQUEUE) + $(eval TEXTQUEUE := ) rgbasm -o $@ $(@:.o=.tx) pokecrystal.gbc: $(OBJS) @@ -52,4 +56,7 @@ gfx/trainers/%.lz: gfx/trainers/%.png $(PYTHON) extras/pokemontools/gfx.py png-to-lz $< .png.2bpp: $(PYTHON) extras/pokemontools/gfx.py png-to-lz $< - +%.2bpp: + @: +%.1bpp: + @: -- cgit v1.2.3 From c195276073a9ae9b8ed5acc4de54600820992593 Mon Sep 17 00:00:00 2001 From: yenatch Date: Wed, 11 Sep 2013 01:24:20 -0400 Subject: rename make variables for graphics files --- Makefile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 614462cf9..4b47205a7 100644 --- a/Makefile +++ b/Makefile @@ -7,9 +7,10 @@ TEXTQUEUE := OBJS := pokecrystal.o -PNG_GFX := $(shell find gfx/ -type f -name '*.png') -LZ_GFX := $(shell find gfx/ -type f -name '*.lz') -TWOBPP_GFX := $(shell find gfx/ -type f -name '*.2bpp') +PNGS := $(shell find gfx/ -type f -name '*.png') +LZS := $(shell find gfx/ -type f -name '*.lz') +_2BPPS := $(shell find gfx/ -type f -name '*.2bpp') +_1BPPS := $(shell find gfx/ -type f -name '*.1bpp') $(shell $(foreach obj, $(OBJS), $(eval OBJ_$(obj:.o=) := $(shell $(PYTHON) scan_includes.py $(obj:.o=.asm))))) @@ -41,7 +42,7 @@ pngs: $(PYTHON) extras/pokemontools/gfx.py mass-decompress $(PYTHON) extras/pokemontools/gfx.py dump-pngs -lzs: $(LZ_GFX) $(TWOBPP_GFX) +lzs: $(LZS) $(_2BPPS) $(_1BPPS) @: gfx/pics/%/front.lz: gfx/pics/%/tiles.2bpp gfx/pics/%/front.png @@ -56,6 +57,8 @@ gfx/trainers/%.lz: gfx/trainers/%.png $(PYTHON) extras/pokemontools/gfx.py png-to-lz $< .png.2bpp: $(PYTHON) extras/pokemontools/gfx.py png-to-lz $< +.png.1bpp: + $(PYTHON) extras/pokemontools/gfx.py png-to-lz $< %.2bpp: @: %.1bpp: -- cgit v1.2.3 From 84ba0ffc31ec34fb4a626c4e33732ea8bc22ae38 Mon Sep 17 00:00:00 2001 From: yenatch Date: Wed, 11 Sep 2013 01:25:39 -0400 Subject: rename lzs make target to gfx --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 4b47205a7..7b1f84212 100644 --- a/Makefile +++ b/Makefile @@ -42,7 +42,7 @@ pngs: $(PYTHON) extras/pokemontools/gfx.py mass-decompress $(PYTHON) extras/pokemontools/gfx.py dump-pngs -lzs: $(LZS) $(_2BPPS) $(_1BPPS) +gfx: $(LZS) $(_2BPPS) $(_1BPPS) @: gfx/pics/%/front.lz: gfx/pics/%/tiles.2bpp gfx/pics/%/front.png -- cgit v1.2.3 From 74f8d746dba41e7fd864994ddc7a9019841829e1 Mon Sep 17 00:00:00 2001 From: yenatch Date: Wed, 11 Sep 2013 01:26:51 -0400 Subject: abstract make targets are now phony --- Makefile | 1 + 1 file changed, 1 insertion(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 7b1f84212..7150b4849 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ PYTHON := python .SUFFIXES: .asm .tx .o .gbc .png .2bpp .lz +.PHONY: all clean pngs gfx .SECONDEXPANSION: TEXTFILES := $(shell find ./ -type f -name '*.asm') -- cgit v1.2.3