summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorluckytyphlosion <alan.rj.huang@gmail.com>2015-10-25 13:06:58 -0400
committerluckytyphlosion <alan.rj.huang@gmail.com>2015-10-25 13:06:58 -0400
commitf48a34c93cd5eef445d94e98de3016728a10e663 (patch)
tree72fe85a773b0f6c5fa713e5b1139354f50a7ad12 /Makefile
parent41d6702a411b6201dec812902c4cb2628d43a17a (diff)
parentfca114aaa7963fd5811a800ad7fea8c376f8f468 (diff)
Merge branch 'master' of https://github.com/pret/pokeyellow
Conflicts: .gitignore
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile33
1 files changed, 13 insertions, 20 deletions
diff --git a/Makefile b/Makefile
index ecbeb32a..06ffef32 100644
--- a/Makefile
+++ b/Makefile
@@ -16,7 +16,6 @@ cgb_opt = -cjsv -k 01 -l 0x33 -m 0x1b -p 0 -r 03
yellow_opt = $(cgb_opt) -t "POKEMON YELLOW"
-
# If your default python is 3, you may want to change this to python27.
PYTHON := python
@@ -33,7 +32,7 @@ compare: yellow
# Clear the default suffixes.
.SUFFIXES:
-.SUFFIXES: .asm .o .gbc .png .2bpp .1bpp .pic
+.SUFFIXES: .asm .o .gbc .png .2bpp .1bpp .pic .wav .pcm
# Secondary expansion is required for dependency variables in object rules.
.SECONDEXPANSION:
@@ -44,13 +43,12 @@ compare: yellow
# Filepath shortcuts to avoid overly long recipes.
poketools := extras/pokemontools
gfx := $(PYTHON) $(poketools)/gfx.py
+pcm := $(PYTHON) $(poketools)/pcm.py
pic := $(PYTHON) $(poketools)/pic.py
includes := $(PYTHON) $(poketools)/scan_includes.py
-
# Collect file dependencies for objects in yellow/.
-# These aren't provided by rgbds by default, so we have to look for file includes ourselves.
$(foreach ver, $(versions), \
$(eval $(ver)_asm := $(shell find $(ver) -iname '*.asm')) \
$(eval $(ver)_obj := $($(ver)_asm:.asm=.o)) \
@@ -61,32 +59,27 @@ $(foreach obj, $(all_obj), \
)
-# Image files are added to a queue to reduce build time. They're converted when building parent objects.
-%.png: ;
-%.2bpp: %.png ; $(eval 2bppq += $<) @rm -f $@
-%.1bpp: %.png ; $(eval 1bppq += $<) @rm -f $@
-%.pic: %.2bpp ; $(eval picq += $<) @rm -f $@
+%.png: ;
+%.2bpp: %.png ; @$(gfx) 2bpp $<
+%.1bpp: %.png ; @$(gfx) 1bpp $<
+%.pic: %.2bpp ; @$(pic) compress $<
+
+%.wav: ;
+%.pcm: %.wav $(poketools)/pcm.py ; @$(pcm) pcm $<
# Assemble source files into objects.
-# Queue payloads are here. These are made silent since there may be hundreds of targets.
-# Use rgbasm -h to use halts without nops.
$(all_obj): $$*.asm $$($$*_dep)
- @$(gfx) 2bpp $(2bppq); $(eval 2bppq :=)
- @$(gfx) 1bpp $(1bppq); $(eval 1bppq :=)
- @$(pic) compress $(picq); $(eval picq :=)
rgbasm -h -o $@ $*.asm
-
-# Link objects together to build a rom.
-
# Make a symfile for debugging.
-link = rgblink -n poke$*.sym
+link_opt = -n poke$*.sym
+# Link objects together to build a rom.
poke%.gbc: $$(%_obj)
- $(link) -o $@ $^
+ rgblink $(link_opt) -o $@ $^
rgbfix $($*_opt) $@
clean:
rm -f $(roms) $(all_obj) poke*.sym
- find . \( -iname '*.1bpp' -o -iname '*.2bpp' -o -iname '*.pic' \) -exec rm {} + \ No newline at end of file
+ find . \( -iname '*.1bpp' -o -iname '*.2bpp' -o -iname '*.pic' -o -iname '*.pcm' \) -exec rm {} +