2021-04-13 18:38:22 +00:00
|
|
|
</$objtype/mkfile
|
|
|
|
|
|
|
|
TARG=assembler debugger emulator
|
2021-04-26 06:39:03 +00:00
|
|
|
USM=`{walk -f projects/ | grep '\.usm$' | grep -v blank.usm | grep -v asma.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
|
|
|
|
BIN=/$objtype/bin/uxn
|
|
|
|
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-04-24 15:14:29 +00:00
|
|
|
CLEANFILES=${TARG:%=bin/%} `{echo $ROM | sed 's,([^ /]+/)+,bin/,g'}
|
2021-04-13 18:38:22 +00:00
|
|
|
|
|
|
|
default:V: all
|
|
|
|
|
2021-04-24 15:14:29 +00:00
|
|
|
all:V: ${TARG:%=bin/%} $ROM
|
2021-04-13 18:38:22 +00:00
|
|
|
|
|
|
|
</sys/src/cmd/mkmany
|
|
|
|
|
|
|
|
/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-04-24 13:21:15 +00:00
|
|
|
%.rom: %.usm bin/assembler
|
|
|
|
bin/assembler $stem.usm $target && cp $target bin/
|
2021-04-13 18:38:22 +00:00
|
|
|
|
|
|
|
bin/assembler:Q: $O.assembler
|
|
|
|
mkdir -p bin && cp $prereq $target
|
|
|
|
|
|
|
|
bin/debugger:Q: $O.debugger
|
|
|
|
mkdir -p bin && cp $prereq $target
|
|
|
|
|
|
|
|
bin/emulator:Q: $O.emulator
|
|
|
|
mkdir -p bin && cp $prereq $target
|
|
|
|
|
|
|
|
$O.assembler: assembler.$O
|
|
|
|
|
|
|
|
$O.debugger: debugger.$O uxn.$O
|
|
|
|
|
2021-04-26 06:39:03 +00:00
|
|
|
$O.emulator: emulator.$O apu.$O mpu.$O ppu.$O uxn.$O
|
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
|