Commit 411008e1 authored by POTTIER Francois's avatar POTTIER Francois
Browse files

Makefile improvements.

parent 245805d5
_ocamlyacc
_menhir
_menhir_code
_menhir_table
_menhir_no_inline
_menhir_inline
*.log
......@@ -11,20 +11,20 @@ MAIN := calc
all:
cd .. && ./build.sh
@ $(OCAMLBUILD) -build-dir _ocamlyacc $(MAIN).native
@ $(OCAMLBUILD) -build-dir _menhir -tag fancy $(MAIN).native \
-use-menhir -menhir "$(MENHIR) $(MENHIRFLAGS) -lc 1 --comment --no-code-inlining"
@ $(OCAMLBUILD) -build-dir _menhir_table -tag fancy $(MAIN).native \
@ $(OCAMLBUILD) -build-dir _ocamlyacc $(MAIN).native
@ $(OCAMLBUILD) -build-dir _menhir_code -tag fancy $(MAIN).native \
-use-menhir -menhir "$(MENHIR) $(MENHIRFLAGS) --no-inline -lc 1 --comment --no-code-inlining"
@ $(OCAMLBUILD) -build-dir _menhir_table -tag fancy $(MAIN).native \
-use-menhir -menhir "$(MENHIR) $(MENHIRFLAGS) --no-inline --table" -package menhirLib
@ $(OCAMLBUILD) -build-dir _menhir_inline -tag fancy $(MAIN).native \
-use-menhir -menhir "$(MENHIR) $(MENHIRFLAGS) --table" -package menhirLib
@ $(OCAMLBUILD) -build-dir _menhir_no_inline -tag fancy $(MAIN).native \
-use-menhir -menhir "$(MENHIR) $(MENHIRFLAGS) --table --no-inline" -package menhirLib
clean:
@ rm -f *~ .*~
@ $(OCAMLBUILD) -build-dir _ocamlyacc -clean
@ $(OCAMLBUILD) -build-dir _menhir -clean
@ $(OCAMLBUILD) -build-dir _menhir_table -clean
@ $(OCAMLBUILD) -build-dir _menhir_no_inline -clean
@ rm -f *~ .*~ *.log
@ $(OCAMLBUILD) -build-dir _ocamlyacc -clean
@ $(OCAMLBUILD) -build-dir _menhir_code -clean
@ $(OCAMLBUILD) -build-dir _menhir_table -clean
@ $(OCAMLBUILD) -build-dir _menhir_inline -clean
# We try every input file whose name matches *.in.
# We parse it using each of the parsers,
......@@ -32,34 +32,26 @@ clean:
test: all
@ for f in *.in ; do \
out=$${f%*.in}.out ; \
log=$${f%*.in}.log ; \
for target in _ocamlyacc _menhir _menhir_table _menhir_no_inline ; do \
base=$${f%*.in} ; \
out=$$base.out ; \
for target in _ocamlyacc _menhir_code _menhir_table _menhir_inline ; do \
$$target/$(MAIN).native < $$f > $$target/$$out ; \
done ; \
if diff _ocamlyacc/$$out _menhir/$$out > $$log ; then \
echo "ocamlyacc versus menhir(code): $$f: OK" ; \
else \
echo "ocamlyacc versus menhir(code): $$f: FAILURE" ; \
cat $$log ; \
fi ; \
if diff _ocamlyacc/$$out _menhir_table/$$out > $$log ; then \
echo "ocamlyacc versus menhir(table): $$f: OK" ; \
else \
echo "ocamlyacc versus menhir(table): $$f: FAILURE" ; \
cat $$log ; \
fi ; \
if diff _menhir/$$out _menhir_table/$$out > $$log ; then \
echo "menhir(code) versus menhir(table): $$f: OK" ; \
else \
echo "menhir(code) versus menhir(table): $$f: FAILURE" ; \
cat $$log ; \
fi ; \
if diff _menhir_table/$$out _menhir_no_inline/$$out > $$log ; then \
echo "menhir(table) versus menhir(table,no-inline): $$f: OK" ; \
else \
echo "menhir(table) versus menhir(table,no-inline): $$f: FAILURE" ; \
cat $$log ; \
fi ; \
for pair in \
_ocamlyacc/_menhir_code \
_ocamlyacc/_menhir_table \
_menhir_code/_menhir_table \
_menhir_table/_menhir_inline \
; do \
left=$${pair%/*} ; \
right=$${pair#*/} ; \
log=$$base.$$left.$$right.log ; \
if diff $$left/$$out $$right/$$out > $$log ; then \
echo "$$left versus $$right: $$f: OK" ; \
else \
echo "$$left versus $$right: $$f: FAILURE" ; \
cat $$log ; \
fi ; \
done ; \
done
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment