export OCAMLOPT=ocamlopt
LTOP=../../../bin/lurettetop$(EXE)
LIB=../../../lib

MAIN=rabbit

NEW_LURETTETOP=$(LTOP)  \
	  --test-length 5000  --step-mode Inside --local-var  --no-sim2chro   \
	  --do-not-show-step 



%.cmxs: %.ml
	 ocamlopt -shared -o $*.cmxs  -I $(LIB) graphics.cmxa ocamlRM.cmx rif_base.cmx $*.ml 


clean:
	rm -rf *.ec *.cm* *.log *~ .*~ *.o *rif0 *rif Data *.pp_luc *.plot *.gp $(MAIN).opt


test: trace_ivrogne.cmxs
	rm -f test.rif0 .lurette_rc
	$(NEW_LURETTETOP) -go -v 1 --output test.rif0  -seed 3306566  \
	  -rp "sut:ocaml:trace_ivrogne.cmxs:" \
	  -rp 'env:lutin:ivrogne.lut:-main:ivrogne:-L:libm.so:-loc' && \
	grep -v "lurette chronogram" test.rif0  | \
	grep -v "lurette Version"   | \
	grep -v "The execution lasted"| sed -e "s/^M//" > test.rif  &&\
	rm -f test.res && diff -u -i  test.rif.exp test.rif > test.res
	[ ! -s test.res ] && make clean 

test2: trace_ivrogne.cmxs
	rm -f test.rif0 .lurette_rc
	$(NEW_LURETTETOP) -go -v 1 --output test.rif0  -seed 3306566  \
	  -rp "sut:ocaml:trace_ivrogne.cmxs:" \
	  -rp 'env:lutin:ivrogne.lut:-main:ivrogne2:-L:libm.so:-loc' && \
	grep -v "lurette chronogram" test.rif0  | \
	grep -v "lurette Version"   | \
	grep -v "The execution lasted"| sed -e "s/^M//" > test.rif  &&\
	rm -f test.res && diff -u -i  test.rif.exp test.rif > test.res
	[ ! -s test.res ] && make clean 


utest:
	cp $(MAIN).out $(MAIN).out.exp

