code: 9ferno

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

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

all:V:	$PROGS

install:V:
	for (i in $TARG)
		mk $MKFLAGS $i.install

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

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){
		mk $MKFLAGS $i
		./$i || echo $i status: $status
		status=()
	}
	echo '-- limbo test programs --'
	for (i in $DISTARG){
		limbo $i^'.b'
		@{ rfork ens; emu -v -d tests/$i^'.dis' || echo $status }
	}