2021-04-13 18:38:22 +00:00
|
|
|
</$objtype/mkfile
|
|
|
|
|
2021-05-18 12:40:12 +00:00
|
|
|
TARG=bin/debugger bin/uxnasm bin/uxnemu
|
|
|
|
USM=`{walk -f projects/ | grep '\.usm$' | grep -v blank.usm}
|
2021-04-24 15:14:29 +00:00
|
|
|
ROM=${USM:%.usm=%.rom}
|
2021-04-13 18:38:22 +00:00
|
|
|
CFLAGS=$CFLAGS -I/sys/include/npe
|
|
|
|
HFILES=\
|
|
|
|
/sys/include/npe/stdio.h\
|
2021-05-17 21:55:13 +00:00
|
|
|
src/devices/apu.h\
|
|
|
|
src/devices/mpu.h\
|
|
|
|
src/devices/ppu.h\
|
2021-04-13 18:38:22 +00:00
|
|
|
src/uxn.h\
|
|
|
|
|
2021-05-18 12:40:12 +00:00
|
|
|
CLEANFILES=$TARG $ROM
|
2021-04-13 18:38:22 +00:00
|
|
|
|
|
|
|
default:V: all
|
|
|
|
|
2021-05-18 12:40:12 +00:00
|
|
|
all:V: bin $TARG $ROM
|
2021-04-13 18:38:22 +00:00
|
|
|
|
2021-05-18 12:40:12 +00:00
|
|
|
bin:
|
|
|
|
mkdir -p bin
|
2021-04-13 18:38:22 +00:00
|
|
|
|
|
|
|
/sys/include/npe/stdio.h:
|
|
|
|
hget https://git.sr.ht/~ft/npe/archive/master.tar.gz | tar xz &&
|
|
|
|
cd npe-master &&
|
|
|
|
mk install &&
|
|
|
|
rm -r npe-master
|
|
|
|
|
2021-05-18 12:40:12 +00:00
|
|
|
%.rom:Q: %.usm bin/uxnasm
|
|
|
|
bin/uxnasm $stem.usm $target >/dev/null
|
2021-04-13 18:38:22 +00:00
|
|
|
|
2021-05-18 12:40:12 +00:00
|
|
|
bin/debugger: debugger.$O uxn.$O
|
2021-05-19 07:29:23 +00:00
|
|
|
$LD $LDFLAGS -o $target $prereq
|
2021-04-13 18:38:22 +00:00
|
|
|
|
2021-05-18 12:40:12 +00:00
|
|
|
bin/uxnasm: assembler.$O
|
2021-05-19 07:29:23 +00:00
|
|
|
$LD $LDFLAGS -o $target $prereq
|
2021-04-13 18:38:22 +00:00
|
|
|
|
2021-05-18 12:40:12 +00:00
|
|
|
bin/uxnemu: emulator.$O apu.$O mpu.$O ppu.$O uxn.$O
|
2021-05-19 07:29:23 +00:00
|
|
|
$LD $LDFLAGS -o $target $prereq
|
2021-04-13 18:38:22 +00:00
|
|
|
|
2021-05-17 21:55:13 +00:00
|
|
|
(assembler|debugger|emulator|uxn)\.$O:R: src/\1.c
|
|
|
|
$CC $CFLAGS -Isrc -o $target src/$stem1.c
|
|
|
|
|
|
|
|
(apu|mpu|ppu)\.$O:R: src/devices/\1.c
|
|
|
|
$CC $CFLAGS -Isrc -o $target src/devices/$stem1.c
|
2021-05-18 12:40:12 +00:00
|
|
|
|
|
|
|
nuke:V: clean
|
|
|
|
|
|
|
|
clean:V:
|
|
|
|
rm -f *.[$OS] [$OS].??* $TARG $CLEANFILES
|
|
|
|
|
|
|
|
%.clean:V:
|
|
|
|
rm -f $stem.[$OS] [$OS].$stem $stem
|
|
|
|
|
|
|
|
install:QV: all
|
|
|
|
exit 'Sorry, there is no install rule yet'
|
2021-05-19 07:29:23 +00:00
|
|
|
|
|
|
|
#LDFLAGS=-p
|