uxn/mkfile

65 lines
1.5 KiB
Plaintext
Raw Permalink Normal View History

2021-04-13 14:38:22 -04:00
</$objtype/mkfile
BIN=/$objtype/bin/games
TARG=bin/uxncli bin/uxnasm bin/uxnemu
2021-12-09 16:52:34 -05:00
USM=`{walk -f projects/ | grep '\.tal$' | grep -v blank.tal | grep -v /assets/ | grep -v /library/}
2021-05-31 17:50:36 -04:00
ROM=${USM:%.tal=%.rom}
CFLAGS=$CFLAGS -p -D__plan9__ -I/sys/include/npe -I/sys/include/npe/SDL2
2021-04-13 14:38:22 -04:00
HFILES=\
/sys/include/npe/stdio.h\
2021-12-28 16:47:35 -05:00
src/devices/audio.h\
2021-12-29 12:07:28 -05:00
src/devices/controller.h\
2022-01-07 17:58:48 -05:00
src/devices/datetime.h\
src/devices/file.h\
2021-12-29 12:07:28 -05:00
src/devices/mouse.h\
2021-12-28 16:37:26 -05:00
src/devices/screen.h\
src/devices/system.h\
2023-08-08 17:13:07 -04:00
src/devices/console.h\
2021-04-13 14:38:22 -04:00
src/uxn.h\
CLEANFILES=$TARG $ROM
2021-04-13 14:38:22 -04:00
default:V: all
all:V: bin $TARG $ROM
2021-04-13 14:38:22 -04:00
bin:
mkdir -p bin
2021-04-13 14:38:22 -04: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-31 17:50:36 -04:00
%.rom:Q: %.tal bin/uxnasm
bin/uxnasm $stem.tal $target >/dev/null
2021-04-13 14:38:22 -04:00
2023-08-08 17:13:07 -04:00
bin/uxncli: file.$O datetime.$O system.$O console.$O uxncli.$O uxn.$O
$LD $LDFLAGS -o $target $prereq
2021-04-13 14:38:22 -04:00
bin/uxnasm: uxnasm.$O
$LD $LDFLAGS -o $target $prereq
2021-04-13 14:38:22 -04:00
2023-08-08 17:13:07 -04:00
bin/uxnemu: audio.$O controller.$O datetime.$O file.$O mouse.$O screen.$O system.$O console.$O uxn.$O uxnemu.$O
$LD $LDFLAGS -o $target $prereq
2021-04-13 14:38:22 -04:00
(uxnasm|uxncli|uxnemu|uxn)\.$O:R: src/\1.c
2021-05-17 17:55:13 -04:00
$CC $CFLAGS -Isrc -o $target src/$stem1.c
2023-08-08 17:13:07 -04:00
(audio|controller|datetime|file|mouse|screen|system|console)\.$O:R: src/devices/\1.c
2021-05-17 17:55:13 -04:00
$CC $CFLAGS -Isrc -o $target src/devices/$stem1.c
nuke:V: clean
clean:V:
rm -f *.[$OS] [$OS].??* $TARG $CLEANFILES
%.clean:V:
rm -f $stem.[$OS] [$OS].$stem $stem
install:V: all
cp $TARG $BIN/
#LDFLAGS=-p