shithub: riscv

ref: 61cc0694649a4d4b109d168032f431751f57f083
dir: /sys/src/cmd/mklib/

View raw version
AFLAGS=
YFLAGS=-d

LIBOBJ=${OFILES:%=$LIB(%)}
LIBDIR=.

default:V:	$LIB

all:V:	$LIB

$LIB:	$LIBOBJ
	ar vu $LIB $newmember

%.$O:	$HFILES		# don't combine with following %.$O rules

%.$O:	%.c
	$CC $CFLAGS $stem.c

%.$O:	%.s
	$AS $AFLAGS $stem.s

y.tab.h y.tab.c:	$YFILES
	yacc $YFLAGS $prereq

$LIB(%.$O):N:	%.$O

install:VQ:	$LIB
	~ $LIBDIR '.' || cp $LIB $LIBDIR/$LIB

installall:V:
	for (objtype in $CPUS)
		mk install

%.all:V:
	for (objtype in $CPUS)
		mk $stem

nuke:V:
	rm -f *.[$OS] y.tab.? y.output y.error $CLEANFILES $LIB

clean:V:
	rm -f *.[$OS] *.a[$OS] y.tab.? y.output y.error $CLEANFILES

%.acid:V:
	$CC $CFLAGS -a `{basename $stem .$objtype}^.c >$target

update:V:
	update $UPDATEFLAGS $UPDATE

test:VQ: $LIB
	if(test -d ./test)
		cd test && mk $MKFLAGS test
	if not
		status=()