######################################################################### # # # OCaml # # # # Xavier Clerc, SED, INRIA Rocquencourt # # # # Copyright 2010 Institut National de Recherche en Informatique et # # en Automatique. All rights reserved. This file is distributed # # under the terms of the Q Public License version 1.0. # # # ######################################################################### .PHONY: default default: compile .PHONY: compile compile: @for file in *.ml; do \ printf " ... testing '$$file'"; \ if [ `echo $$file | grep bad` ]; then \ $(OCAMLC) -c -w a $$file 2>/dev/null \ && echo " => failed" || echo " => passed"; \ else \ F="`basename $$file .ml`"; \ test -f $$F.mli && $(OCAMLC) -c -w a $$F.mli; \ $(OCAMLC) -c -w a $$file 2>/dev/null \ && if [ -f $$F.reference ]; then \ rm -f program.byte; \ $(OCAMLC) $$F.cmo -o program.byte \ && $(OCAMLRUN) program.byte >$$F.result \ && $(DIFF) $$F.reference $$F.result >/dev/null; \ fi \ && echo " => passed" || echo " => failed"; \ fi; \ done .PHONY: promote promote: defaultpromote .PHONY: clean clean: defaultclean @rm -f program.byte *.cm* *.result