summaryrefslogtreecommitdiffstats
path: root/testsuite/makefiles/Makefile.okbad
blob: 11ddf95c290be20700f0f54ed8d337b52fd270d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#########################################################################
#                                                                       #
#                                 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