#	This file is based on the makefile that was
#	part of the software similarity tester SIM.
#	Written by Dick Grune, Vrije Universiteit, Amsterdam.
#
</$objtype/mkfile
CC=pcc -c -B
LD=pcc

BIN=$home/bin/$objtype
TARG=sim
# could add lang to TARG if you need it

TEST =	pass3.c#			# guinea pig

</sys/src/cmd/mkmany
CFLAGS=

CLN_OBJ =	clang.$O	# the C language module
COM_OBJ =	stream.$O idf.$O buff.$O error.$O	# common

# The similarity tester:
SIM_OBJ =	sim.$O pass1.$O hash.$O compare.$O add_run.$O pass2.$O pass3.$O

$O.sim:	top.$O $CLN_OBJ $COM_OBJ $SIM_OBJ
	$LD -o $target $prereq

sim.res:V:	sim $TEST
	sim -hr 20 $TEST

# The language streamliner as a main program:
$O.lang:	main.$O $CLN_OBJ $COM_OBJ
	$LD -o $target $prereq

lang.res:V:	lang $TEST
	lang -1 $TEST >lang1.res
	lang -2 $TEST >lang2.res
	wc lang[12].res $TEST

clang.c:	clang.lx
	lex -t clang.lx >clang.c

test:NV:	sim.res lang.res

clean:V:
	rm -f *.[$OS] clang.c [$OS].$TARG $TARG lang[12].res

nuke:V: clean

add_run.$O: buff.h text.h top.p top.h
buff.$O: buff.h
clang.$O: idf.h stream.h
compare.$O: buff.h text.h top.p top.h
hash.$O: buff.h text.h
idf.$O: idf.h
pass1.$O: buff.h text.h
pass2.$O: text.h top.p top.h debug.h
pass3.$O: params.h text.h top.p top.h debug.h buff.h
sim.$O: params.h
stream.$O: stream.h
top.$O: text.h top.p top.h top.g
