better makefile
This commit is contained in:
parent
130d6316aa
commit
cbc088b049
1 changed files with 15 additions and 12 deletions
27
Makefile
27
Makefile
|
|
@ -2,28 +2,31 @@ cl65 ?= cl65
|
||||||
|
|
||||||
.PHONY: build debug clean
|
.PHONY: build debug clean
|
||||||
|
|
||||||
build: smb.nes
|
build: bin/smb.nes
|
||||||
|
|
||||||
debug: OBJ_DEBUG_ARGS = --create-dep obj/nes/smb.d -v -g
|
debug: OBJ_DEBUG_ARGS = --create-dep obj/nes/smb.d -v -g
|
||||||
debug: ROM_DEBUG_ARGS = -Wl --dbgfile,smb.nes.dbg
|
debug: ROM_DEBUG_ARGS = -Wl --dbgfile,smb.nes.dbg
|
||||||
debug: build
|
debug: build
|
||||||
|
|
||||||
obj/nes/smbdishl.o: src/smbdishl.s src/smb_chr.chr
|
obj/nes/smbdishl.o: src/smbdishl.s src/smb_chr.chr obj/nes/
|
||||||
$(cl65) -t none -c $(OBJ_DEBUG_ARGS) --include-dir src -o $@ $<
|
$(cl65) -t none -c $(OBJ_DEBUG_ARGS) --include-dir src -o $@ $<
|
||||||
|
|
||||||
smb.nes smb.map: obj/nes/smbdishl.o src/nes.cfg
|
bin/smb.nes bin/smb.map: obj/nes/smbdishl.o src/nes.cfg bin/
|
||||||
$(cl65) -t none --mapfile smb.map $(ROM_DEBUG_ARGS) -o smb.nes -C src/nes.cfg $<
|
$(cl65) -t none --mapfile bin/smb.map $(ROM_DEBUG_ARGS) -o bin/smb.nes -C src/nes.cfg $<
|
||||||
|
|
||||||
src/smb_chr.chr:
|
src/smb_chr.chr: chr/smb_chr.chr
|
||||||
if [ -s chr/smb_chr.chr ]; then \
|
if [ -s $< ]; then \
|
||||||
if [ -s src/smb_chr.chr ]; then \
|
if [ -s $@ ]; then \
|
||||||
cmp -s $@ chr/smb_chr.chr || cp chr/smb_chr.chr $@ \
|
cmp -s $@ $< || cp $< $@; \
|
||||||
else \
|
else \
|
||||||
cp chr/smb_chr.chr \
|
cp $< $@; \
|
||||||
fi \
|
fi; \
|
||||||
else \
|
else \
|
||||||
[ -s src/smb_chr.chr ] || $(error missing chr)\
|
[ -s $@ ] || { echo "missing chr" >&2; exit 1; };\
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
obj/nes/ bin/:
|
||||||
|
mkdir -p $@
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f smb.nes.dbg smb.map smb.nes smb.nes.ndx obj/nes/smbdishl.o obj/nes/smb.d
|
rm -f smb.nes.dbg bin/ smb.nes.ndx obj/
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue