mirror of
https://github.com/thornAvery/kep-hack.git
synced 2025-11-12 16:24:52 +13:00
Reorganize the makefile and remove yellow targets.
This commit is contained in:
parent
ed48f56e98
commit
8e96cf2ba3
91
Makefile
91
Makefile
|
|
@ -1,41 +1,10 @@
|
||||||
# Build Red/Blue. Yellow is WIP.
|
# python 2.7
|
||||||
roms := pokered.gbc pokeblue.gbc
|
|
||||||
|
|
||||||
|
|
||||||
.PHONY: all clean red blue yellow compare
|
|
||||||
|
|
||||||
all: $(roms)
|
|
||||||
red: pokered.gbc
|
|
||||||
blue: pokeblue.gbc
|
|
||||||
yellow: pokeyellow.gbc
|
|
||||||
|
|
||||||
versions := red blue yellow
|
|
||||||
|
|
||||||
|
|
||||||
# Header options for rgbfix.
|
|
||||||
dmg_opt = -jsv -k 01 -l 0x33 -m 0x13 -p 0 -r 03
|
|
||||||
cgb_opt = -cjsv -k 01 -l 0x33 -m 0x1b -p 0 -r 03
|
|
||||||
|
|
||||||
red_opt = $(dmg_opt) -t "POKEMON RED"
|
|
||||||
blue_opt = $(dmg_opt) -t "POKEMON BLUE"
|
|
||||||
yellow_opt = $(cgb_opt) -t "POKEMON YELLOW"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# If your default python is 3, you may want to change this to python27.
|
|
||||||
PYTHON := python
|
PYTHON := python
|
||||||
|
|
||||||
# md5sum -c is used to compare rom hashes. The options may vary across platforms.
|
# md5sum -c is used to compare rom hashes. The options may vary across platforms.
|
||||||
MD5 := md5sum -c --quiet
|
MD5 := md5sum -c --quiet
|
||||||
|
|
||||||
|
|
||||||
# The compare target is a shortcut to check that the build matches the original roms exactly.
|
|
||||||
# This is for contributors to make sure a change didn't affect the contents of the rom.
|
|
||||||
# More thorough comparison can be made by diffing the output of hexdump -C against both roms.
|
|
||||||
compare: red blue
|
|
||||||
@$(MD5) roms.md5
|
|
||||||
|
|
||||||
|
|
||||||
# Clear the default suffixes.
|
# Clear the default suffixes.
|
||||||
.SUFFIXES:
|
.SUFFIXES:
|
||||||
.SUFFIXES: .asm .o .gbc .png .2bpp .1bpp .pic
|
.SUFFIXES: .asm .o .gbc .png .2bpp .1bpp .pic
|
||||||
|
|
@ -46,16 +15,19 @@ compare: red blue
|
||||||
# Suppress annoying intermediate file deletion messages.
|
# Suppress annoying intermediate file deletion messages.
|
||||||
.PRECIOUS: %.2bpp
|
.PRECIOUS: %.2bpp
|
||||||
|
|
||||||
# Filepath shortcuts to avoid overly long recipes.
|
.PHONY: all clean red blue compare
|
||||||
|
|
||||||
|
|
||||||
poketools := extras/pokemontools
|
poketools := extras/pokemontools
|
||||||
gfx := $(PYTHON) $(poketools)/gfx.py
|
gfx := $(PYTHON) $(poketools)/gfx.py
|
||||||
pic := $(PYTHON) $(poketools)/pic.py
|
2bpp := $(gfx) 2bpp
|
||||||
|
1bpp := $(gfx) 1bpp
|
||||||
|
pic := $(PYTHON) $(poketools)/pic.py compress
|
||||||
includes := $(PYTHON) $(poketools)/scan_includes.py
|
includes := $(PYTHON) $(poketools)/scan_includes.py
|
||||||
|
|
||||||
|
versions := red blue
|
||||||
|
|
||||||
|
# Collect file dependencies for objects in red/ and blue/.
|
||||||
# Collect file dependencies for objects in red/, blue/ and yellow/.
|
|
||||||
# These aren't provided by rgbds by default, so we have to look for file includes ourselves.
|
|
||||||
$(foreach ver, $(versions), \
|
$(foreach ver, $(versions), \
|
||||||
$(eval $(ver)_asm := $(shell find $(ver) -iname '*.asm')) \
|
$(eval $(ver)_asm := $(shell find $(ver) -iname '*.asm')) \
|
||||||
$(eval $(ver)_obj := $($(ver)_asm:.asm=.o)) \
|
$(eval $(ver)_obj := $($(ver)_asm:.asm=.o)) \
|
||||||
|
|
@ -66,24 +38,43 @@ $(foreach obj, $(all_obj), \
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
%.png: ;
|
roms := pokered.gbc pokeblue.gbc
|
||||||
%.2bpp: %.png ; @$(gfx) 2bpp $<
|
|
||||||
%.1bpp: %.png ; @$(gfx) 1bpp $<
|
|
||||||
%.pic: %.2bpp ; @$(pic) compress $<
|
|
||||||
|
|
||||||
# Assemble source files into objects.
|
all: $(roms)
|
||||||
$(all_obj): $$*.asm $$($$*_dep)
|
red: pokered.gbc
|
||||||
rgbasm -h -o $@ $*.asm
|
blue: pokeblue.gbc
|
||||||
|
|
||||||
|
# For contributors to make sure a change didn't affect the contents of the rom.
|
||||||
|
compare: red blue
|
||||||
|
@$(MD5) roms.md5
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f $(roms) $(all_obj) $(roms:.gbc=.sym)
|
||||||
|
find . \( -iname '*.1bpp' -o -iname '*.2bpp' -o -iname '*.pic' \) -exec rm {} +
|
||||||
|
|
||||||
|
|
||||||
|
# Don't fix halts.
|
||||||
|
asm_opt = -h
|
||||||
|
|
||||||
# Make a symfile for debugging.
|
# Make a symfile for debugging.
|
||||||
link_opt = -n poke$*.sym
|
link_opt = -n poke$*.sym
|
||||||
|
|
||||||
# Link objects together to build a rom.
|
# 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"
|
||||||
|
|
||||||
|
|
||||||
|
%.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)
|
poke%.gbc: $$(%_obj)
|
||||||
rgblink $(link_opt) -o $@ $^
|
rgblink $(link_opt) -o $@ $^
|
||||||
rgbfix $($*_opt) $@
|
rgbfix $($*_opt) $@
|
||||||
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f $(roms) $(all_obj) poke*.sym
|
|
||||||
find . \( -iname '*.1bpp' -o -iname '*.2bpp' -o -iname '*.pic' \) -exec rm {} +
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue