ocaml/test/Makefile.Mac

126 lines
3.5 KiB
Makefile
Raw Normal View History

#########################################################################
# #
# Objective Caml #
# #
# Damien Doligez, projet Para, INRIA Rocquencourt #
# #
# Copyright 1999 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. #
# #
#########################################################################
# $Id$
CAMLC = ::boot:ocamlrun ::ocamlc -I ::stdlib: -I :KB: -I :Lex:
CAMLYACC = ::yacc:ocamlyacc
CAMLLEX = ::boot:ocamlrun ::lex:ocamllex
CAMLDEP = ::boot:ocamlrun ::tools:ocamldep
CAMLRUN = ::byterun:ocamlrun
BYTE_EXE = fib.byt takc.byt taku.byt sieve.byt quicksort.byt <20>
quicksort.fast.byt <20>
fft.byt fft.fast.byt soli.byt soli.fast.byt boyer.byt kb.byt <20>
nucleic.byt genlex.byt bdd.byt
all <EFBFBD> test
# KB
BYTE_KB = :KB:terms.cmo :KB:equations.cmo :KB:kb.cmo :KB:orderings.cmo <20>
:KB:kbmain.cmo
kb.byt <EFBFBD> {BYTE_KB}
{CAMLC} {BYTE_KB} -o kb.byt
clean <EFBFBD><EFBFBD>
delete -i :KB:<3A>.cm[io] || set status 0
# Genlex
BYTE_GENLEX = :Lex:syntax.cmo :Lex:scan_aux.cmo :Lex:scanner.cmo <20>
:Lex:gram_aux.cmo :Lex:grammar.cmo :Lex:lexgen.cmo :Lex:output.cmo :Lex:main.cmo
genlex.byt <EFBFBD> {BYTE_GENLEX}
{CAMLC} {BYTE_GENLEX} -o genlex.byt
clean <EFBFBD><EFBFBD>
delete -i :Lex:<3A>.cm[io] || set status 0
:Lex:grammar.mli <20> :Lex:grammar.ml
echo -n
:Lex:grammar.ml <20> :Lex:grammar.mly ::yacc:ocamlyacc
{CAMLYACC} {YACCFLAGS} :Lex:grammar.mly
clean <EFBFBD><EFBFBD>
delete -i :Lex:grammar.ml :Lex:grammar.mli
beforedepend <20><> :Lex:grammar.ml :Lex:grammar.mli
:Lex:scanner.ml <20> :Lex:scanner.mll ::lex:ocamllex
{CAMLLEX} :Lex:scanner.mll
clean <EFBFBD><EFBFBD>
delete -i :Lex:scanner.ml
beforedepend <20><> :Lex:scanner.ml
# Common rules
.byt <EFBFBD> .ml
{CAMLC} -o {targdir}{default}.byt {depdir}{default}.ml
.fast.byt <EFBFBD> .ml
{CAMLC} -unsafe -o {targdir}{default}.fast.byt {depdir}{default}.ml
.cmi <EFBFBD> .mli
{CAMLC} -c {depdir}{default}.mli
.cmo <EFBFBD> .ml
{CAMLC} -c {depdir}{default}.ml
{BYTE_EXE} {BYTE_KB} {BYTE_GENLEX} <20> ::ocamlc
{BYTE_EXE} <20> ::stdlib:stdlib.cma
clean <EFBFBD><EFBFBD>
delete -i <20>.byt || set status 0
delete -i <20>.cm[io] || set status 0
directory :Moretest; domake clean; directory ::
# Regression test
test <EFBFBD> {BYTE_EXE}
set echo 0
for prog in `echo {BYTE_EXE} | streamedit -e '1 replace /.byt/ "" -c <20>'`
echo {prog}
if "`exists :Results:{prog}.runtest.Mac`"
:Results:{prog}.runtest.Mac test {CAMLRUN} {prog}.byt
else
{CAMLRUN} {prog}.byt > "{tempfolder}ocaml-test"
equal -d "{tempfolder}ocaml-test" :Results:{prog}.out
end
end
clean <EFBFBD><EFBFBD>
delete -i :Lex:testscanner.ml "{tempfolder}ocaml-test"
# Benchmark
bench <EFBFBD> {BYTE_EXE}
set echo 0
for prog in `echo {BYTE_EXE} | streamedit -e '1 replace /.byt/ "" -c <20>'`
echo {prog}
if "`exists :Results:{prog}.runtest.Mac`"
:Results:{prog}.runtest.Mac bench {CAMLRUN} {prog}.byt
else
time "{CAMLRUN} {prog}.byt <20>dev:null"
end
end
# Dependencies
depend <EFBFBD> beforedepend
{CAMLDEP} -I :KB: -I :Lex: <20>.ml :KB:<3A>.mli :KB:<3A>.ml :Lex:<3A>.mli <20>
:Lex:<3A>.ml > Makefile.Mac.depend