code: 9ferno

ref: b548687a8ed1d0a159c9d3f3f921d93bbb56908e
dir: /mkfiles/mkmany-sh/

View raw version
PROGS=${TARG:%=$O.%}
libs=${LIBS:%=$ROOT/$OBJDIR/lib/lib%.a}

all:V:	$PROGS

install:V:
	for i in $TARG
	do
		mk $MKFLAGS $i.install
	done

installall:V:
	for objtype in $CPUS
	do
		mk $MKFLAGS install
	done

nuke:V:	nuke-std

clean:V:
	rm -f *.[$OS] *.a[$OS] y.tab.? lex.yy.c y.debug y.output [$OS].??* $TARG $CLEANFILES

$O.%:	%.$O $OFILES $libs
	$LD $LDFLAGS -o $target $prereq

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

%.$O:	%.c
	$CC $CFLAGS -I^$ROOT/libinterp $stem.c

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

y.tab.h y.tab.c:	$YFILES
	$YACC $YFLAGS $YFILES

nuke-std:V:	clean-std
	rm -f y.tab.? y.debug y.output

$BIN/%:	$O.%
	rm -f $BIN/$stem && cp $O.$stem $BIN/$stem

tests:V:
	for i in $PROGS
	do
		mk $MKFLAGS $i
		./$i || echo 'status ' $?
	done
	echo '-- limbo test programs --'
	for i in $DISTARG
	do
		limbo $i'.b'
		( set -m; emu -v -d tests/$i'.dis' || echo 'status ' $? )
	done