1999-11-17 10:59:06 -08:00
|
|
|
#########################################################################
|
|
|
|
# #
|
|
|
|
# Objective Caml #
|
|
|
|
# #
|
|
|
|
# Xavier Leroy, projet Cristal, 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$
|
|
|
|
|
1996-02-13 08:29:09 -08:00
|
|
|
include ../config/Makefile
|
1995-11-05 09:32:12 -08:00
|
|
|
|
1998-04-30 05:13:17 -07:00
|
|
|
CAMLC=../boot/ocamlrun ../ocamlc
|
|
|
|
CAMLOPT=../boot/ocamlrun ../ocamlopt
|
|
|
|
COMPFLAGS=-I ../stdlib -I KB -I Lex
|
1995-07-19 12:38:48 -07:00
|
|
|
OPTFLAGS=-S
|
1996-04-30 07:53:58 -07:00
|
|
|
CAMLYACC=../yacc/ocamlyacc
|
|
|
|
CAMLLEX=../boot/ocamlrun ../lex/ocamllex
|
|
|
|
CAMLDEP=../boot/ocamlrun ../tools/ocamldep
|
|
|
|
CAMLRUN=../byterun/ocamlrun
|
1999-11-18 09:57:48 -08:00
|
|
|
CODERUNPARAMS=OCAMLRUNPARAM='o=100'
|
1995-05-04 03:15:53 -07:00
|
|
|
|
1995-07-19 12:38:48 -07:00
|
|
|
BYTE_EXE=fib.byt takc.byt taku.byt sieve.byt quicksort.byt quicksort.fast.byt \
|
|
|
|
fft.byt fft.fast.byt soli.byt soli.fast.byt boyer.byt kb.byt \
|
1996-11-07 03:00:36 -08:00
|
|
|
nucleic.byt genlex.byt bdd.byt
|
1995-05-04 03:15:53 -07:00
|
|
|
|
1995-07-19 12:38:48 -07:00
|
|
|
CODE_EXE=$(BYTE_EXE:.byt=.out)
|
|
|
|
|
1998-06-29 01:50:09 -07:00
|
|
|
default: all codetest bytetest
|
1997-10-31 05:00:00 -08:00
|
|
|
|
1995-07-19 12:38:48 -07:00
|
|
|
all: $(BYTE_EXE) $(CODE_EXE)
|
1995-05-04 03:15:53 -07:00
|
|
|
|
1995-11-05 09:32:12 -08:00
|
|
|
# Nucleic
|
|
|
|
|
|
|
|
nucleic.out: nucleic.ml
|
|
|
|
case $(ARCH) in \
|
|
|
|
i386) sed -e '/<HAND_CSE>/,/<\/HAND_CSE>/d' -e '/NO_CSE>/d' \
|
|
|
|
nucleic.ml > nucleic.mlt; \
|
1998-04-30 05:13:17 -07:00
|
|
|
$(CAMLOPT) $(COMPFLAGS) $(OPTFLAGS) -o nucleic.out nucleic.mlt; \
|
1995-11-05 09:32:12 -08:00
|
|
|
rm -f nucleic.mlt;; \
|
1998-04-30 05:13:17 -07:00
|
|
|
*) $(CAMLOPT) $(COMPFLAGS) $(OPTFLAGS) -o nucleic.out nucleic.ml;; \
|
1995-11-05 09:32:12 -08:00
|
|
|
esac
|
|
|
|
|
1995-05-04 03:15:53 -07:00
|
|
|
# KB
|
|
|
|
|
1995-07-19 12:38:48 -07:00
|
|
|
BYTE_KB=KB/terms.cmo KB/equations.cmo KB/kb.cmo KB/orderings.cmo KB/kbmain.cmo
|
|
|
|
CODE_KB=$(BYTE_KB:.cmo=.cmx)
|
1995-05-04 03:15:53 -07:00
|
|
|
|
1995-07-19 12:38:48 -07:00
|
|
|
kb.byt: $(BYTE_KB)
|
1998-04-30 05:13:17 -07:00
|
|
|
$(CAMLC) $(COMPFLAGS) $(BYTE_KB) -o kb.byt
|
1995-07-19 12:38:48 -07:00
|
|
|
kb.out: $(CODE_KB)
|
1998-04-30 05:13:17 -07:00
|
|
|
$(CAMLOPT) $(COMPFLAGS) $(OPTFLAGS) $(CODE_KB) -o kb.out
|
1995-05-04 03:15:53 -07:00
|
|
|
|
|
|
|
clean::
|
1995-07-19 12:38:48 -07:00
|
|
|
rm -f KB/*.cm[iox] KB/*.[os]
|
1995-05-04 03:15:53 -07:00
|
|
|
rm -f KB/*~
|
|
|
|
|
|
|
|
# Genlex
|
|
|
|
|
1995-07-19 12:38:48 -07:00
|
|
|
BYTE_GENLEX=Lex/syntax.cmo Lex/scan_aux.cmo Lex/scanner.cmo Lex/gram_aux.cmo \
|
|
|
|
Lex/grammar.cmo Lex/lexgen.cmo Lex/output.cmo Lex/main.cmo
|
|
|
|
CODE_GENLEX=$(BYTE_GENLEX:.cmo=.cmx)
|
1995-05-04 03:15:53 -07:00
|
|
|
|
1995-07-19 12:38:48 -07:00
|
|
|
genlex.byt: $(BYTE_GENLEX)
|
1998-04-30 05:13:17 -07:00
|
|
|
$(CAMLC) $(COMPFLAGS) $(BYTE_GENLEX) -o genlex.byt
|
1995-07-19 12:38:48 -07:00
|
|
|
genlex.out: $(CODE_GENLEX)
|
1998-04-30 05:13:17 -07:00
|
|
|
$(CAMLOPT) $(COMPFLAGS) $(OPTFLAGS) $(CODE_GENLEX) -o genlex.out
|
1995-05-04 03:15:53 -07:00
|
|
|
|
|
|
|
clean::
|
1995-07-19 12:38:48 -07:00
|
|
|
rm -f Lex/*.cm[iox] Lex/*.[os]
|
1995-05-04 03:15:53 -07:00
|
|
|
rm -f Lex/*~
|
|
|
|
|
1996-04-30 07:53:58 -07:00
|
|
|
Lex/grammar.ml Lex/grammar.mli: Lex/grammar.mly ../yacc/ocamlyacc
|
1995-05-04 03:15:53 -07:00
|
|
|
$(CAMLYACC) $(YACCFLAGS) Lex/grammar.mly
|
|
|
|
|
|
|
|
clean::
|
|
|
|
rm -f Lex/grammar.ml Lex/grammar.mli
|
1995-07-19 12:38:48 -07:00
|
|
|
beforedepend:: Lex/grammar.ml Lex/grammar.mli
|
1995-05-04 03:15:53 -07:00
|
|
|
|
1996-04-30 07:53:58 -07:00
|
|
|
Lex/scanner.ml: Lex/scanner.mll ../lex/ocamllex
|
1995-05-04 03:15:53 -07:00
|
|
|
$(CAMLLEX) Lex/scanner.mll
|
|
|
|
|
|
|
|
clean::
|
|
|
|
rm -f Lex/scanner.ml
|
1995-07-19 12:38:48 -07:00
|
|
|
beforedepend:: Lex/scanner.ml
|
1995-05-04 03:15:53 -07:00
|
|
|
|
|
|
|
# Common rules
|
|
|
|
|
1995-07-19 12:38:48 -07:00
|
|
|
.SUFFIXES:
|
|
|
|
.SUFFIXES: .mli .ml .cmi .cmo .cmx .byt .fast.byt .out .fast.out
|
|
|
|
|
|
|
|
.ml.byt:
|
1998-04-30 05:13:17 -07:00
|
|
|
$(CAMLC) $(COMPFLAGS) -o $*.byt $<
|
1995-07-19 12:38:48 -07:00
|
|
|
|
|
|
|
.ml.fast.byt:
|
1995-07-27 10:44:51 -07:00
|
|
|
cp $*.ml $*_fast.ml
|
1998-04-30 05:13:17 -07:00
|
|
|
$(CAMLC) $(COMPFLAGS) -unsafe -o $*.fast.byt $*_fast.ml
|
1995-07-27 10:44:51 -07:00
|
|
|
rm -f $*_fast.ml
|
1995-05-04 03:15:53 -07:00
|
|
|
|
1995-07-19 12:38:48 -07:00
|
|
|
.ml.out:
|
1998-04-30 05:13:17 -07:00
|
|
|
$(CAMLOPT) $(COMPFLAGS) $(OPTFLAGS) -o $*.out $<
|
1995-05-04 03:15:53 -07:00
|
|
|
|
1995-07-19 12:38:48 -07:00
|
|
|
.ml.fast.out:
|
1995-07-27 10:44:51 -07:00
|
|
|
cp $*.ml $*_fast.ml
|
1998-04-30 05:13:17 -07:00
|
|
|
$(CAMLOPT) $(COMPFLAGS) $(OPTFLAGS) -unsafe -o $*.fast.out $*_fast.ml
|
1995-07-27 10:44:51 -07:00
|
|
|
rm -f $*_fast.ml
|
1995-05-04 03:15:53 -07:00
|
|
|
|
|
|
|
.mli.cmi:
|
1998-04-30 05:13:17 -07:00
|
|
|
$(CAMLC) $(COMPFLAGS) -c $<
|
1995-05-04 03:15:53 -07:00
|
|
|
|
|
|
|
.ml.cmo:
|
1998-04-30 05:13:17 -07:00
|
|
|
$(CAMLC) $(COMPFLAGS) -c $<
|
1995-05-04 03:15:53 -07:00
|
|
|
|
1995-07-19 12:38:48 -07:00
|
|
|
.ml.cmx:
|
1998-04-30 05:13:17 -07:00
|
|
|
$(CAMLOPT) $(COMPFLAGS) $(OPTFLAGS) -c $<
|
1995-07-19 12:38:48 -07:00
|
|
|
|
1996-04-30 07:53:58 -07:00
|
|
|
$(BYTE_EXE) $(BYTE_KB) $(BYTE_GENLEX): ../ocamlc
|
1995-07-19 12:38:48 -07:00
|
|
|
$(BYTE_EXE): ../stdlib/stdlib.cma
|
1996-04-30 07:53:58 -07:00
|
|
|
$(CODE_EXE) $(CODE_KB) $(CODE_GENLEX): ../ocamlopt
|
1995-07-20 01:30:16 -07:00
|
|
|
$(CODE_EXE): ../stdlib/stdlib.cmxa ../stdlib/libasmrun.a
|
1995-05-04 03:15:53 -07:00
|
|
|
|
|
|
|
clean::
|
1995-07-19 12:38:48 -07:00
|
|
|
rm -f *.byt *.out
|
|
|
|
rm -f *.cm[iox] *.[os]
|
1995-05-04 03:15:53 -07:00
|
|
|
rm -f *~
|
|
|
|
|
|
|
|
# Regression test
|
|
|
|
|
1995-07-19 12:38:48 -07:00
|
|
|
test: codetest
|
|
|
|
|
|
|
|
bytetest:
|
|
|
|
set -e; \
|
|
|
|
for prog in $(BYTE_EXE:.byt=); do \
|
|
|
|
echo $$prog; \
|
|
|
|
if test -f Results/$$prog.runtest; then \
|
|
|
|
sh Results/$$prog.runtest test $(CAMLRUN) $$prog.byt; \
|
1995-08-25 03:00:46 -07:00
|
|
|
else \
|
1995-07-19 12:38:48 -07:00
|
|
|
$(CAMLRUN) $$prog.byt | cmp - Results/$$prog.out; \
|
|
|
|
fi; \
|
|
|
|
done
|
|
|
|
|
|
|
|
codetest:
|
1995-05-04 03:15:53 -07:00
|
|
|
set -e; \
|
1995-07-19 12:38:48 -07:00
|
|
|
for prog in $(CODE_EXE:.out=); do \
|
1995-05-04 03:15:53 -07:00
|
|
|
echo $$prog; \
|
|
|
|
if test -f Results/$$prog.runtest; then \
|
1996-11-03 08:55:51 -08:00
|
|
|
sh Results/$$prog.runtest test ./$$prog.out; \
|
1995-08-25 03:00:46 -07:00
|
|
|
else \
|
1996-11-03 08:36:45 -08:00
|
|
|
./$$prog.out | cmp - Results/$$prog.out; \
|
1995-05-04 03:15:53 -07:00
|
|
|
fi; \
|
|
|
|
done
|
|
|
|
|
|
|
|
clean::
|
|
|
|
rm -f Lex/testscanner.ml
|
|
|
|
|
|
|
|
# Benchmark
|
|
|
|
|
1995-07-19 12:38:48 -07:00
|
|
|
bench: codebench
|
|
|
|
|
|
|
|
bytebench:
|
1995-05-04 03:15:53 -07:00
|
|
|
set -e; \
|
1995-07-19 12:38:48 -07:00
|
|
|
for prog in $(BYTE_EXE:.byt=); do \
|
1998-08-27 05:13:20 -07:00
|
|
|
echo "$$prog " | tr -d '\012'; \
|
1995-07-19 12:38:48 -07:00
|
|
|
if test -f Results/$$prog.runtest; then \
|
1995-07-24 05:47:53 -07:00
|
|
|
sh Results/$$prog.runtest bench $(CAMLRUN) $$prog.byt; \
|
1995-07-19 12:38:48 -07:00
|
|
|
else \
|
|
|
|
xtime -o /dev/null -e /dev/null $(CAMLRUN) $$prog.byt; \
|
|
|
|
fi; \
|
|
|
|
done
|
|
|
|
|
|
|
|
codebench:
|
|
|
|
set -e; \
|
|
|
|
for prog in $(CODE_EXE:.out=); do \
|
1998-08-27 05:13:20 -07:00
|
|
|
echo "$$prog " | tr -d '\012'; \
|
1995-05-04 03:15:53 -07:00
|
|
|
if test -f Results/$$prog.runtest; then \
|
1996-11-03 08:55:51 -08:00
|
|
|
$(CODERUNPARAMS) sh Results/$$prog.runtest bench ./$$prog.out; \
|
1995-05-04 03:15:53 -07:00
|
|
|
else \
|
1996-11-03 08:55:51 -08:00
|
|
|
$(CODERUNPARAMS) xtime -repeat 3 -o /dev/null -e /dev/null ./$$prog.out; \
|
1995-05-04 03:15:53 -07:00
|
|
|
fi; \
|
|
|
|
done
|
1995-07-19 12:38:48 -07:00
|
|
|
|
|
|
|
# Dependencies
|
|
|
|
|
|
|
|
depend: beforedepend
|
|
|
|
$(CAMLDEP) -I KB -I Lex *.mli *.ml KB/*.mli KB/*.ml Lex/*.mli Lex/*.ml > .depend
|
|
|
|
|
|
|
|
include .depend
|
|
|
|
|