Makefile 2.47 KB
Newer Older
1
export OCAMLOPT=ocamlopt
2
LTOP=lurette_old
3
4
LIB= `ocamlfind query -r rdbg-plugin -i-format` \
	  `ocamlfind query -r lutin -i-format`  
5

6

7
8
MAIN=rabbit

9
10
LURETTETOP=$(LTOP)   --precision 2 \
	  --test-length 500  --step-mode Inside --local-var --no-gnuplot --no-sim2chro   \
11
	  --do-not-show-step -v 2 
12

13
14
15
EXPDIR=`$(LTOP) --ocaml-version`
$(EXPDIR):
	[ -d $(EXPDIR) ] || (mkdir -p $(EXPDIR) ; make utest)
16

17

18
19
CMXA=$(shell ocamlfind query lutin -a-format -r -predicates native) 

20
%.cmxs: %.ml
21
	 ocamlfind ocamlopt -shared -o $*.cmxs  $(LIB) $(CMXA) graphics.cmxa  $*.ml 
22
23


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


28
29
30
test_old.rif:$(EXPDIR) rabbit.cmxs
	rm -f test_old.rif0 .lurette_rc
	$(LURETTETOP) -go  --output test_old.rif0  \
31
	  -rp "sut:ocaml:rabbit.cmxs:" \
32
	  -rp 'env:lutin:rabbit.lut:-main:rabbit:-seed:34:-L:libm.so.6:-loc' && \
33
	grep -v "lurette chronogram" test_old.rif0  | \
34
	grep -v "lurette Version"   | \
35
	grep -v "#seed"   | \
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
	grep -v "The execution lasted"| sed -e "s/^M//" > test_old.rif 


test_old: test_old.rif $(EXPDIR)
	rm -f test_old1.res
	diff -B -u -i  $(EXPDIR)/test_old.rif.exp test_old.rif > test_old.res || true
	cat test_old.res
	[ ! -s test_old.res ]  && make clean

utest_old:test_old.rif
	cp test_old.rif $(EXPDIR)/test_old.rif.exp

#XXX do the same as in ~/rdbg/exemples/ocaml/Makefile or extend rdbg so that it
# handle ocaml plugins ans generates files that looks like ~/rdbg/exemples/ocaml/test.ml
test_new.rif:$(EXPDIR) rabbit.cmxs
	rm -f test_new.rif0 .lurette_rc
	rdbg -lurette  --output test_new.rif0  \
	  -sut "ocaml:rabbit.cmxs:" \
	  -env "lutin rabbit.lut -main rabbit -seed 34 -L libm.so.6 -loc" && \
	grep -v "lurette chronogram" test_new.rif0  | \
	grep -v "lurette Version"   | \
	grep -v "#seed"   | \
	grep -v "The execution lasted"| sed -e "s/^M//" > test_new.rif 
59

60

61
62
63
64
65
test_new: test_new.rif $(EXPDIR)
	rm -f test_new_old.res
	diff -B -u -i  $(EXPDIR)/test_new.rif.exp test_new.rif > test_new.res || true
	cat test_new.res
	[ ! -s test_new.res ]  && make clean
66

67
68
utest_new:test_new.rif
	cp test_new.rif $(EXPDIR)/test_new.rif.exp
69

70
71
test: test_old # test_new
utest: utest_old # utest_new
72
73
74
75
76
77
78
79


# A FAIRE
#
# 1 - determiner les sommets de l'obstacle avec get_vertices pour pouvoir afficher le vrai obstacle
# 2 - Colorer l'obstacle en bleu pour pouvoir remettre les anciens points de
# la trajectoire
# 3 - Faire se ballader l'obstacle un peu plus aleatoirement
80
#