#gawk sort order #export LC_CTYPE=C .PHONY: all clean .SUFFIXES: .asm .o .gbc .SECONDEXPANSION: # Secondary expansion is required for dependency variables in object rules. ROMS := cries.gbc OBJS := cries.o # If your default python is 3, you may want to change this to python27. PYTHON := python # 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 obj, $(OBJS), \ $(eval $(obj:.o=)_dep := $(shell $(PYTHON) scan_includes.py $(obj:.o=.asm))) \ ) all: cries.gbc # 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. $(OBJS): $$*.asm $$($$*_dep) pcm.py @$(PYTHON) pcm.py pcm $(pcmq) rgbasm -h -o $@ $< $(ROMS): $(OBJS) rgbasm -p 0x00 -o cries.o cries.asm rgblink -n cries.sym -o $@ $< rgbfix -p 0x00 -Cjv -k OK -l 0x33 -m 0x1b -p 00 -r 3 -t "CRIES" $@ clean: rm -f cries.o cries.gbc find . \( -iname '*.pcm' \) -exec rm {} + %.pcm: %.wav $(eval pcmq += $<) @rm -f $@