diff options
-rw-r--r-- | Makefile | 77 | ||||
-rw-r--r-- | blue.asm | 2 | ||||
-rw-r--r-- | blue/audio.asm | 2 | ||||
-rw-r--r-- | blue/main.asm | 2 | ||||
-rw-r--r-- | blue/text.asm | 2 | ||||
-rw-r--r-- | blue/wram.asm | 2 | ||||
-rw-r--r-- | constants.asm | 1 | ||||
-rw-r--r-- | red.asm | 2 | ||||
-rw-r--r-- | red/audio.asm | 2 | ||||
-rw-r--r-- | red/main.asm | 2 | ||||
-rw-r--r-- | red/text.asm | 2 | ||||
-rw-r--r-- | red/wram.asm | 2 | ||||
-rw-r--r-- | text.asm | 1 | ||||
-rw-r--r-- | yellow.asm | 4 | ||||
-rw-r--r-- | yellow/audio.asm | 2 | ||||
-rw-r--r-- | yellow/main.asm | 2 | ||||
-rw-r--r-- | yellow/text.asm | 2 | ||||
-rw-r--r-- | yellow/wram.asm | 2 |
18 files changed, 31 insertions, 80 deletions
@@ -1,48 +1,37 @@ -# python 2.7 PYTHON := python - -# md5sum -c is used to compare rom hashes. The options may vary across platforms. MD5 := md5sum -c --quiet +2bpp := $(PYTHON) extras/pokemontools/gfx.py 2bpp +1bpp := $(PYTHON) extras/pokemontools/gfx.py 1bpp +pic := $(PYTHON) extras/pokemontools/pic.py compress +includes := $(PYTHON) extras/pokemontools/scan_includes.py + +base_obj := \ + audio.o \ + main.o \ + text.o \ + wram.o + +red_obj := $(base_obj:.o=_red.o) +blue_obj := $(base_obj:.o=_blue.o) +all_obj := $(red_obj) $(blue_obj) + +$(foreach obj, $(base_obj:.o=), \ + $(eval $(obj)_dep := $(shell $(includes) $(obj).asm)) \ +) -# Clear the default suffixes. .SUFFIXES: .SUFFIXES: .asm .o .gbc .png .2bpp .1bpp .pic - -# Secondary expansion is required for dependency variables in object rules. .SECONDEXPANSION: - # Suppress annoying intermediate file deletion messages. .PRECIOUS: %.2bpp - .PHONY: all clean red blue compare - -poketools := extras/pokemontools -gfx := $(PYTHON) $(poketools)/gfx.py -2bpp := $(gfx) 2bpp -1bpp := $(gfx) 1bpp -pic := $(PYTHON) $(poketools)/pic.py compress -includes := $(PYTHON) $(poketools)/scan_includes.py - -versions := red blue - -# Collect file dependencies for objects in red/ and blue/. -$(foreach ver, $(versions), \ - $(eval $(ver)_asm := $(shell find $(ver) -iname '*.asm')) \ - $(eval $(ver)_obj := $($(ver)_asm:.asm=.o)) \ - $(eval all_obj += $($(ver)_obj)) \ -) -$(foreach obj, $(all_obj), \ - $(eval $(obj:.o=)_dep := $(shell $(includes) $(obj:.o=.asm))) \ -) - - roms := pokered.gbc pokeblue.gbc -all: $(roms) -red: pokered.gbc -blue: pokeblue.gbc +all: $(roms) +red: pokered.gbc +blue: pokeblue.gbc # For contributors to make sure a change didn't affect the contents of the rom. compare: red blue @@ -52,29 +41,21 @@ clean: rm -f $(roms) $(all_obj) $(roms:.gbc=.sym) find . \( -iname '*.1bpp' -o -iname '*.2bpp' -o -iname '*.pic' \) -exec rm {} + +%.asm: ; +$(red_obj): %_red.o: %.asm $$(%_dep) + rgbasm -D "_RED" -h -o $@ $*.asm +$(blue_obj): %_blue.o: %.asm $$(%_dep) + rgbasm -D "_BLUE" -h -o $@ $*.asm -# Don't fix halts. -asm_opt = -h - -# Make a symfile for debugging. -link_opt = -n poke$*.sym - -# Header options for rgbfix. dmg_opt = -jsv -k 01 -l 0x33 -m 0x13 -p 0 -r 03 red_opt = $(dmg_opt) -t "POKEMON RED" blue_opt = $(dmg_opt) -t "POKEMON BLUE" +poke%.gbc: $$(%_obj) + rgblink -n poke$*.sym -o $@ $^ + rgbfix $($*_opt) $@ %.png: ; %.2bpp: %.png ; @$(2bpp) $< %.1bpp: %.png ; @$(1bpp) $< %.pic: %.2bpp ; @$(pic) $< - -# Assemble source files into objects. -$(all_obj): $$*.asm $$($$*_dep) - rgbasm $(asm_opt) -o $@ $*.asm - -# Link objects to produce a rom. -poke%.gbc: $$(%_obj) - rgblink $(link_opt) -o $@ $^ - rgbfix $($*_opt) $@ diff --git a/blue.asm b/blue.asm deleted file mode 100644 index c8c50a5d..00000000 --- a/blue.asm +++ /dev/null @@ -1,2 +0,0 @@ -_BLUE EQU 1 -INCLUDE "charmap.asm" diff --git a/blue/audio.asm b/blue/audio.asm deleted file mode 100644 index 53e37a2d..00000000 --- a/blue/audio.asm +++ /dev/null @@ -1,2 +0,0 @@ -INCLUDE "blue.asm" -INCLUDE "audio.asm" diff --git a/blue/main.asm b/blue/main.asm deleted file mode 100644 index 3fcef980..00000000 --- a/blue/main.asm +++ /dev/null @@ -1,2 +0,0 @@ -INCLUDE "blue.asm" -INCLUDE "main.asm" diff --git a/blue/text.asm b/blue/text.asm deleted file mode 100644 index ec6d7203..00000000 --- a/blue/text.asm +++ /dev/null @@ -1,2 +0,0 @@ -INCLUDE "blue.asm" -INCLUDE "text.asm" diff --git a/blue/wram.asm b/blue/wram.asm deleted file mode 100644 index 70292177..00000000 --- a/blue/wram.asm +++ /dev/null @@ -1,2 +0,0 @@ -INCLUDE "blue.asm" -INCLUDE "wram.asm" diff --git a/constants.asm b/constants.asm index 090799f9..9f1491c8 100644 --- a/constants.asm +++ b/constants.asm @@ -1,4 +1,5 @@ INCLUDE "macros.asm" +INCLUDE "charmap.asm" INCLUDE "hram.asm" INCLUDE "vram.asm" diff --git a/red.asm b/red.asm deleted file mode 100644 index 901a611a..00000000 --- a/red.asm +++ /dev/null @@ -1,2 +0,0 @@ -_RED EQU 1 -INCLUDE "charmap.asm" diff --git a/red/audio.asm b/red/audio.asm deleted file mode 100644 index 6c90a7c1..00000000 --- a/red/audio.asm +++ /dev/null @@ -1,2 +0,0 @@ -INCLUDE "red.asm" -INCLUDE "audio.asm" diff --git a/red/main.asm b/red/main.asm deleted file mode 100644 index ff8de04f..00000000 --- a/red/main.asm +++ /dev/null @@ -1,2 +0,0 @@ -INCLUDE "red.asm" -INCLUDE "main.asm" diff --git a/red/text.asm b/red/text.asm deleted file mode 100644 index d5d571d7..00000000 --- a/red/text.asm +++ /dev/null @@ -1,2 +0,0 @@ -INCLUDE "red.asm" -INCLUDE "text.asm" diff --git a/red/wram.asm b/red/wram.asm deleted file mode 100644 index 68c3c803..00000000 --- a/red/wram.asm +++ /dev/null @@ -1,2 +0,0 @@ -INCLUDE "red.asm" -INCLUDE "wram.asm" @@ -15,6 +15,7 @@ POKEDEX_TEXT EQU TEXT_11 + 1 MOVE_NAMES EQU POKEDEX_TEXT + 1 INCLUDE "macros.asm" +INCLUDE "charmap.asm" INCLUDE "hram.asm" diff --git a/yellow.asm b/yellow.asm deleted file mode 100644 index 3edffe01..00000000 --- a/yellow.asm +++ /dev/null @@ -1,4 +0,0 @@ -_YELLOW EQU 1 -_OPTION_BEACH_HOUSE EQU 1 -_OPTION_LOWCOST_SAFARI EQU 1 -INCLUDE "charmap.asm" diff --git a/yellow/audio.asm b/yellow/audio.asm deleted file mode 100644 index e94c7db5..00000000 --- a/yellow/audio.asm +++ /dev/null @@ -1,2 +0,0 @@ -INCLUDE "yellow.asm" -INCLUDE "audio.asm" diff --git a/yellow/main.asm b/yellow/main.asm deleted file mode 100644 index 36c88720..00000000 --- a/yellow/main.asm +++ /dev/null @@ -1,2 +0,0 @@ -INCLUDE "yellow.asm" -INCLUDE "main.asm" diff --git a/yellow/text.asm b/yellow/text.asm deleted file mode 100644 index a84a633d..00000000 --- a/yellow/text.asm +++ /dev/null @@ -1,2 +0,0 @@ -INCLUDE "yellow.asm" -INCLUDE "text.asm" diff --git a/yellow/wram.asm b/yellow/wram.asm deleted file mode 100644 index c0b7f781..00000000 --- a/yellow/wram.asm +++ /dev/null @@ -1,2 +0,0 @@ -INCLUDE "yellow.asm" -INCLUDE "wram.asm" |