~rabbits/uxn

ref: 16f51cb8766fa0610588716be376d0fad9fda712 uxn/mkfile -rw-r--r-- 1.0 KiB
16f51cb8Andrew Alderwick Rewritten asma 6 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
</$objtype/mkfile

TARG=assembler debugger emulator
USM=`{walk -f projects/ | grep '\.usm$' | grep -v blank.usm | grep -v asma.usm}
ROM=${USM:%.usm=%.rom}
CFLAGS=$CFLAGS -I/sys/include/npe
BIN=/$objtype/bin/uxn
HFILES=\
	/sys/include/npe/stdio.h\
	src/apu.h\
	src/mpu.h\
	src/ppu.h\
	src/uxn.h\

CLEANFILES=${TARG:%=bin/%} `{echo $ROM | sed 's,([^ /]+/)+,bin/,g'}

default:V: all

all:V: ${TARG:%=bin/%} $ROM

</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

%.rom: %.usm bin/assembler
	bin/assembler $stem.usm $target && cp $target bin/

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

$O.emulator: emulator.$O apu.$O mpu.$O ppu.$O uxn.$O

%.$O: src/%.c
	$CC $CFLAGS -Isrc -o $target src/$stem.c