summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile59
1 files changed, 28 insertions, 31 deletions
diff --git a/Makefile b/Makefile
index 04a08e05..27363d87 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,9 @@
-roms := pokered.gbc pokeblue.gbc
+PYTHON := python
+pcm := $(PYTHON) tools/pokemontools/pcm.py pcm
-pokered_obj := audio_red.o main_red.o text_red.o wram_red.o
-pokeblue_obj := audio_blue.o main_blue.o text_blue.o wram_blue.o
+rom := pokeyellow.gbc
+
+objs := audio.o main.o text.o wram.o
### Build tools
@@ -21,23 +23,22 @@ RGBLINK ?= $(RGBDS)rgblink
.SECONDEXPANSION:
.PRECIOUS:
.SECONDARY:
-.PHONY: all red blue clean tidy compare tools
+.PHONY: all yellow clean tidy compare tools
-all: $(roms)
-red: pokered.gbc
-blue: pokeblue.gbc
+all: $(rom)
+yellow: $(rom)
# For contributors to make sure a change didn't affect the contents of the rom.
-compare: $(roms)
+compare: $(rom)
@$(MD5) roms.md5
clean:
- rm -f $(roms) $(pokered_obj) $(pokeblue_obj) $(roms:.gbc=.sym)
- find . \( -iname '*.1bpp' -o -iname '*.2bpp' -o -iname '*.pic' \) -exec rm {} +
+ rm -f $(rom) $(objs) $(rom:.gbc=.sym)
+ find . \( -iname '*.1bpp' -o -iname '*.2bpp' -o -iname '*.pic' -o -iname '*.pcm' \) -exec rm {} +
$(MAKE) clean -C tools/
tidy:
- rm -f $(roms) $(pokered_obj) $(pokeblue_obj) $(roms:.gbc=.sym)
+ rm -f $(rom) $(objs) $(rom:.gbc=.sym)
$(MAKE) clean -C tools/
tools:
@@ -53,35 +54,27 @@ endif
%.asm: ;
-%_red.o: dep = $(shell tools/scan_includes $(@D)/$*.asm)
-$(pokered_obj): %_red.o: %.asm $$(dep)
- $(RGBASM) -D _RED -h -o $@ $*.asm
-
-%_blue.o: dep = $(shell tools/scan_includes $(@D)/$*.asm)
-$(pokeblue_obj): %_blue.o: %.asm $$(dep)
- $(RGBASM) -D _BLUE -h -o $@ $*.asm
+%.o: dep = $(shell tools/scan_includes $(@D)/$*.asm)
+$(objs): %.o: %.asm $$(dep)
+ $(RGBASM) -h -o $@ $*.asm
-pokered_opt = -jsv -k 01 -l 0x33 -m 0x13 -p 0 -r 03 -t "POKEMON RED"
-pokeblue_opt = -jsv -k 01 -l 0x33 -m 0x13 -p 0 -r 03 -t "POKEMON BLUE"
+opts = -cjsv -k 01 -l 0x33 -m 0x1b -p 0 -r 03 -t "POKEMON YELLOW"
-%.gbc: $$(%_obj)
- $(RGBLINK) -d -n $*.sym -l pokered.link -o $@ $^
- $(RGBFIX) $($*_opt) $@
- sort $*.sym -o $*.sym
+$(rom): $(objs)
+ $(RGBLINK) -n pokeyellow.sym -l pokeyellow.link -o $@ $^
+ $(RGBFIX) $(opts) $@
+ sort $(rom:.gbc=.sym) -o $(rom:.gbc=.sym)
### Misc file-specific graphics rules
-gfx/blue/intro_purin_1.2bpp: $(RGBGFX) += -h
-gfx/blue/intro_purin_2.2bpp: $(RGBGFX) += -h
-gfx/blue/intro_purin_3.2bpp: $(RGBGFX) += -h
-gfx/red/intro_nido_1.2bpp: $(RGBGFX) += -h
-gfx/red/intro_nido_2.2bpp: $(RGBGFX) += -h
-gfx/red/intro_nido_3.2bpp: $(RGBGFX) += -h
-
gfx/game_boy.2bpp: tools/gfx += --remove-duplicates
gfx/theend.2bpp: tools/gfx += --interleave --png=$<
gfx/tilesets/%.2bpp: tools/gfx += --trim-whitespace
+gfx/pokemon_yellow.2bpp: tools/gfx += --trim-whitespace
+gfx/surfing_pikachu_1c.2bpp: tools/gfx += --trim-whitespace
+gfx/surfing_pikachu_3.2bpp: tools/gfx += --trim-whitespace
+gfx/surfing_pikachu_1.2bpp: tools/gfx += --trim-whitespace
### Catch-all graphics rules
@@ -100,3 +93,7 @@ gfx/tilesets/%.2bpp: tools/gfx += --trim-whitespace
%.pic: %.2bpp
tools/pkmncompress $< $@
+
+
+%.wav: ;
+%.pcm: %.wav ; @$(pcm) $<