~pixelherodev/c3lib

ref: ddd789667e0b3f1f92a636752601943924d590c9 c3lib/mkfile -rw-r--r-- 745 bytes
ddd78966Noam Preil tmp 3 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
</$objtype/mkfile

all:V: $O.out.libc3

$O.out.libc3: util.$O stb_ds.$O c3.$O tags.$O dump.$O sema/usage.$O sema/scope.$O sema/serialize.$O sema/type.$O sema/expr.$O codegen/c.$O
	ar ruv $target $prereq

install:V: /$objtype/lib/ape/libc3.a
	mkdir -p /sys/include/ape/c3/sema
	cp *.h /sys/include/ape/c3
	cp sema/scope.h /sys/include/ape/c3/sema

/$objtype/lib/ape/libc3.a: $O.out.libc3
	cp $prereq $target

CFLAGS=$CFLAGS -D _POSIX_SOURCE -D_PLAN9_SOURCE -D_BSD_EXTENSION -D_LIMITS_EXTENSION -D_PLAN9_$objtype

%.$O:Q: %.c `{walk | grep '\.h$' | grep -v '^\.git'}
	echo cc $stem.c
	if(! ~ $mode release)
		pcc -c $CFLAGS $stem.c -DDEBUG -o $target
	if not
		pcc -c $CFLAGS $stem.c -o $target

clean:
	rm -f *.$O codegen/*.$O $O.out.* sema/*.$O