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-12-20 02:39:12 -08:00
|
|
|
|
2009-05-20 04:52:42 -07:00
|
|
|
CAMLC=../../boot/ocamlrun ../../ocamlc -I ../../stdlib -I ../../otherlibs/unix
|
2008-03-14 06:47:24 -07:00
|
|
|
BYTEFLAGS=-g
|
2009-05-20 04:52:42 -07:00
|
|
|
CAMLOPT=../../boot/ocamlrun ../../ocamlopt -I ../../stdlib -I ../../otherlibs/unix
|
2007-01-29 04:11:18 -08:00
|
|
|
OPTFLAGS=-S -g
|
1996-04-30 07:53:58 -07:00
|
|
|
CAMLDEP=../../boot/ocamlrun ../../tools/ocamldep
|
|
|
|
CAMLRUN=../../byterun/ocamlrun
|
1999-11-18 09:57:48 -08:00
|
|
|
CODERUNPARAMS=OCAMLRUNPARAM='o=100'
|
1995-12-20 02:39:12 -08:00
|
|
|
|
2008-09-09 01:09:26 -07:00
|
|
|
#FORTRANC=g77
|
|
|
|
#FORTRANLIB=g2c
|
|
|
|
FORTRANC=gfortran
|
|
|
|
FORTRANLIB=gfortran
|
|
|
|
|
2008-08-07 02:29:57 -07:00
|
|
|
OUTS=backtrace2.bin callback.bin manyargs.bin \
|
2007-11-06 13:06:18 -08:00
|
|
|
cm.byt cmlinked.bin cm.bin \
|
|
|
|
bigarrays.bin bigarrf.bin fftba.bin globroots.bin float.bin intext.bin \
|
2008-09-09 01:48:24 -07:00
|
|
|
printf scanf regexp.byt regexp.bin md5.bin recmod.bin
|
2007-10-09 03:29:37 -07:00
|
|
|
|
2008-09-09 01:09:26 -07:00
|
|
|
BROKENS=
|
2007-10-09 03:29:37 -07:00
|
|
|
|
2008-08-07 02:29:57 -07:00
|
|
|
all: $(OUTS:.bin=.byt) $(OUTS) recmods
|
2007-10-09 03:29:37 -07:00
|
|
|
|
2008-09-09 01:09:26 -07:00
|
|
|
callback.byt: tcallback.cmo callbackprim.o
|
2008-09-08 23:40:06 -07:00
|
|
|
$(CAMLC) -o callback.byt \
|
2008-09-09 01:09:26 -07:00
|
|
|
-custom tcallback.cmo callbackprim.o ../../otherlibs/unix/libunix.a
|
|
|
|
callback.bin: tcallback.cmx callbackprim.o
|
|
|
|
$(CAMLOPT) -o tcallback.bin tcallback.cmx \
|
2008-09-08 23:40:06 -07:00
|
|
|
callbackprim.o ../../otherlibs/unix/libunix.a
|
1995-12-20 02:39:12 -08:00
|
|
|
|
|
|
|
manyargs.byt: manyargs.cmo manyargsprim.o
|
|
|
|
$(CAMLC) -o manyargs.byt -custom manyargs.cmo manyargsprim.o
|
2007-11-06 13:06:18 -08:00
|
|
|
manyargs.bin: manyargs.cmx manyargsprim.o
|
|
|
|
$(CAMLOPT) -inline 0 -o manyargs.bin manyargs.cmx manyargsprim.o
|
1995-12-20 02:39:12 -08:00
|
|
|
|
2008-09-09 01:09:26 -07:00
|
|
|
multdef.byt: multdef.cmo usemultdef.cmo
|
|
|
|
$(CAMLC) -o multdef.byt multdef.cmo usemultdef.cmo
|
2007-11-06 13:06:18 -08:00
|
|
|
multdef.bin: multdef.cmx usemultdef.cmx
|
|
|
|
$(CAMLOPT) -o multdef.bin multdef.cmx usemultdef.cmx
|
1996-03-20 02:51:37 -08:00
|
|
|
|
1997-03-17 02:18:39 -08:00
|
|
|
cm.byt: cmcaml.ml cmstub.c cmmain.c
|
1997-02-02 06:54:33 -08:00
|
|
|
$(CAMLC) -custom -o cm.byt cmcaml.ml cmstub.c cmmain.c
|
1996-11-08 06:47:40 -08:00
|
|
|
|
2007-11-06 13:06:18 -08:00
|
|
|
cmlinked.bin: cmcaml.ml cmstub.c cmmain.c
|
1997-02-02 06:54:33 -08:00
|
|
|
$(CAMLC) -output-obj -o cm.o cmcaml.ml
|
2008-09-09 01:09:26 -07:00
|
|
|
$(BYTECC) -g -o cmlinked.bin cm.o \
|
2008-09-09 01:43:37 -07:00
|
|
|
-I../../asmrun -I/usr/local/lib/ocaml \
|
2008-09-09 01:09:26 -07:00
|
|
|
-DNO_BYTECODE_FILE cmstub.c cmmain.c \
|
|
|
|
../../byterun/libcamlrun.a $(BYTECCLIBS)
|
|
|
|
cmlinked.byt: cmcaml.ml cmstub.c cmmain.c
|
|
|
|
$(CAMLC) -output-obj -o cm.o cmcaml.ml
|
|
|
|
$(BYTECC) -g -o cmlinked.byt cm.o \
|
|
|
|
-I../../byterun -I/usr/local/lib/ocaml \
|
2008-09-08 23:40:06 -07:00
|
|
|
-DNO_BYTECODE_FILE cmstub.c cmmain.c \
|
|
|
|
../../byterun/libcamlrun.a $(BYTECCLIBS)
|
1996-11-08 06:47:40 -08:00
|
|
|
|
2007-11-06 13:06:18 -08:00
|
|
|
cm.bin: cmcaml.ml cmstub.c cmmain.c
|
1997-02-02 06:54:33 -08:00
|
|
|
$(CAMLOPT) -output-obj -o cm.o cmcaml.ml
|
2008-09-08 23:40:06 -07:00
|
|
|
$(NATIVECC) -g -o cm.bin cm.o -I$(LIBDIR) \
|
|
|
|
-DNO_BYTECODE_FILE cmstub.c cmmain.c \
|
|
|
|
../../asmrun/libasmrun.a $(NATIVECCLIBS)
|
1996-11-08 06:47:40 -08:00
|
|
|
|
2000-02-29 09:41:12 -08:00
|
|
|
bigarrays.byt: ../../otherlibs/bigarray/bigarray.cma \
|
2000-02-22 09:34:55 -08:00
|
|
|
../../otherlibs/bigarray/libbigarray.a bigarrays.ml
|
2002-12-09 06:06:08 -08:00
|
|
|
$(CAMLC) -custom -o bigarrays.byt \
|
2000-02-25 05:46:11 -08:00
|
|
|
-I ../../otherlibs/bigarray \
|
|
|
|
-I ../../otherlibs/unix \
|
2000-04-16 07:36:44 -07:00
|
|
|
unix.cma bigarray.cma bigarrays.ml
|
2000-02-22 09:34:55 -08:00
|
|
|
|
2007-11-06 13:06:18 -08:00
|
|
|
bigarrays.bin: ../../otherlibs/bigarray/bigarray.cmxa \
|
2000-02-22 09:34:55 -08:00
|
|
|
../../otherlibs/bigarray/libbigarray.a bigarrays.ml
|
2007-11-06 13:06:18 -08:00
|
|
|
$(CAMLOPT) $(OPTFLAGS) -o bigarrays.bin \
|
2000-02-25 05:46:11 -08:00
|
|
|
-I ../../otherlibs/bigarray \
|
|
|
|
-I ../../otherlibs/unix \
|
2000-04-16 07:36:44 -07:00
|
|
|
unix.cmxa bigarray.cmxa bigarrays.ml
|
2000-02-29 09:41:12 -08:00
|
|
|
|
|
|
|
bigarrf.byt: bigarrf.o bigarrfstub.o \
|
|
|
|
../../otherlibs/bigarray/bigarray.cma \
|
|
|
|
../../otherlibs/bigarray/libbigarray.a bigarrfml.ml
|
|
|
|
$(CAMLC) -custom -o bigarrf.byt \
|
|
|
|
-I ../../otherlibs/bigarray \
|
|
|
|
-I ../../otherlibs/unix \
|
2008-09-09 01:09:26 -07:00
|
|
|
unix.cma bigarray.cma bigarrfml.ml \
|
2000-02-29 01:11:26 -08:00
|
|
|
bigarrf.o bigarrfstub.o \
|
2008-09-09 01:09:26 -07:00
|
|
|
../../byterun/libcamlrun.a -cclib -l$(FORTRANLIB)
|
2000-02-29 09:41:12 -08:00
|
|
|
|
2007-11-06 13:06:18 -08:00
|
|
|
bigarrf.bin: bigarrf.o bigarrfstub.o \
|
2000-02-29 09:41:12 -08:00
|
|
|
../../otherlibs/bigarray/bigarray.cma \
|
|
|
|
../../otherlibs/bigarray/libbigarray.a bigarrfml.ml
|
2007-11-06 13:06:18 -08:00
|
|
|
$(CAMLOPT) $(OPTFLAGS) -o bigarrf.bin \
|
2000-02-29 09:41:12 -08:00
|
|
|
-I ../../otherlibs/bigarray \
|
|
|
|
-I ../../otherlibs/unix \
|
2008-09-09 01:43:37 -07:00
|
|
|
unix.cmxa bigarray.cmxa bigarrfml.ml \
|
2000-02-29 09:41:12 -08:00
|
|
|
bigarrf.o bigarrfstub.o \
|
2008-09-09 01:43:37 -07:00
|
|
|
../../asmrun/libasmrun.a -cclib -l$(FORTRANLIB)
|
2000-02-29 01:11:26 -08:00
|
|
|
|
|
|
|
bigarrf.o: bigarrf.f
|
2008-09-09 01:09:26 -07:00
|
|
|
$(FORTRANC) -c bigarrf.f
|
2000-02-29 01:11:26 -08:00
|
|
|
|
|
|
|
bigarrfstub.o: bigarrfstub.c
|
2008-09-08 23:40:06 -07:00
|
|
|
$(NATIVECC) $(NATIVECCCOMPOPTS) -I../../byterun \
|
|
|
|
-I../../otherlibs/bigarray -c bigarrfstub.c
|
2000-02-22 09:34:55 -08:00
|
|
|
|
2000-03-10 06:54:41 -08:00
|
|
|
fftba.byt: fftba.ml
|
|
|
|
$(CAMLC) -o fftba.byt -I ../../otherlibs/bigarray \
|
2000-04-16 07:36:44 -07:00
|
|
|
bigarray.cma fftba.ml
|
2000-03-10 06:54:41 -08:00
|
|
|
|
2007-11-06 13:06:18 -08:00
|
|
|
fftba.bin: fftba.ml
|
|
|
|
$(CAMLOPT) $(OPTFLAGS) -o fftba.bin -I ../../otherlibs/bigarray \
|
2000-04-16 07:36:44 -07:00
|
|
|
bigarray.cmxa fftba.ml
|
2000-03-10 06:54:41 -08:00
|
|
|
|
2001-08-11 10:36:38 -07:00
|
|
|
globroots.byt: globroots.ml globrootsprim.o
|
|
|
|
$(CAMLC) -custom -o globroots.byt globroots.ml globrootsprim.o
|
|
|
|
|
2007-11-06 13:06:18 -08:00
|
|
|
globroots.bin: globroots.ml globrootsprim.o
|
|
|
|
$(CAMLOPT) -o globroots.bin globroots.ml globrootsprim.o
|
2001-08-11 10:36:38 -07:00
|
|
|
|
|
|
|
globrootsprim.o: globrootsprim.c
|
|
|
|
$(BYTECC) $(BYTECCCOMPOPTS) -I../../byterun -c globrootsprim.c
|
|
|
|
|
2001-11-27 07:07:33 -08:00
|
|
|
float.byt: float.cmo
|
|
|
|
${CAMLC} -o float.byt float.cmo
|
2007-11-06 13:06:18 -08:00
|
|
|
float.bin: float.cmx
|
|
|
|
${CAMLOPT} -o float.bin float.cmx
|
2001-11-27 07:07:33 -08:00
|
|
|
|
2001-12-03 07:46:36 -08:00
|
|
|
intext.byt: intext.cmo intextaux.o
|
|
|
|
${CAMLC} -o intext.byt -custom intext.cmo intextaux.o
|
2007-11-06 13:06:18 -08:00
|
|
|
intext.bin: intext.cmx intextaux.o
|
|
|
|
${CAMLOPT} -o intext.bin intext.cmx intextaux.o
|
2001-12-03 07:46:36 -08:00
|
|
|
|
2006-01-20 02:14:47 -08:00
|
|
|
tprintf.byt: testing.cmo tprintf.cmo
|
|
|
|
${CAMLC} -o tprintf.byt testing.cmo tprintf.cmo
|
2007-11-06 13:06:18 -08:00
|
|
|
tprintf.bin: testing.cmx tprintf.cmx
|
|
|
|
${CAMLOPT} -o tprintf.bin testing.cmx tprintf.cmx
|
2006-01-20 02:14:47 -08:00
|
|
|
|
2007-11-06 13:06:18 -08:00
|
|
|
printf: tprintf.byt tprintf.bin
|
2006-01-20 02:14:47 -08:00
|
|
|
./tprintf.byt
|
2007-11-06 13:06:18 -08:00
|
|
|
./tprintf.bin
|
2006-01-20 02:14:47 -08:00
|
|
|
|
2009-05-20 04:52:42 -07:00
|
|
|
tformat.byt: testing.cmo tformat.cmo
|
|
|
|
${CAMLC} -o tformat.byt testing.cmo tformat.cmo
|
|
|
|
tformat.bin: testing.cmx tformat.cmx
|
|
|
|
${CAMLOPT} -o tformat.bin testing.cmx tformat.cmx
|
|
|
|
|
|
|
|
format: tformat.byt tformat.bin
|
|
|
|
./tformat.byt
|
|
|
|
./tformat.bin
|
|
|
|
|
2008-09-08 23:40:06 -07:00
|
|
|
tbuffer.byt: testing.cmo tbuffer.cmo
|
|
|
|
${CAMLC} -o tbuffer.byt testing.cmo tbuffer.cmo
|
|
|
|
tbuffer.bin: testing.cmx tbuffer.cmx
|
|
|
|
${CAMLOPT} -o tbuffer.bin testing.cmx tbuffer.cmx
|
|
|
|
|
|
|
|
buffer: tscanf.byt tscanf.bin
|
|
|
|
./tbuffer.byt
|
|
|
|
./tbuffer.bin
|
|
|
|
|
2006-01-20 02:14:47 -08:00
|
|
|
tscanf.byt: testing.cmo tscanf.cmo
|
|
|
|
${CAMLC} -o tscanf.byt testing.cmo tscanf.cmo
|
2007-11-06 13:06:18 -08:00
|
|
|
tscanf.bin: testing.cmx tscanf.cmx
|
|
|
|
${CAMLOPT} -o tscanf.bin testing.cmx tscanf.cmx
|
2002-10-10 03:44:12 -07:00
|
|
|
|
2005-07-01 05:39:43 -07:00
|
|
|
tscanf2.byt: tscanf2_io.cmo tscanf2_slave.cmo tscanf2_master.cmo
|
|
|
|
${CAMLC} -o tscanf2_slave.byt tscanf2_io.cmo tscanf2_slave.cmo
|
|
|
|
${CAMLC} -o tscanf2_master.byt unix.cma \
|
|
|
|
tscanf2_io.cmo tscanf2_master.cmo
|
2007-11-06 13:06:18 -08:00
|
|
|
tscanf2.bin: tscanf2_io.cmx tscanf2_slave.cmx tscanf2_master.cmx
|
|
|
|
${CAMLOPT} -o tscanf2_slave.bin tscanf2_io.cmx tscanf2_slave.cmx
|
|
|
|
${CAMLOPT} -o tscanf2_master.bin unix.cmxa \
|
2005-07-01 05:39:43 -07:00
|
|
|
tscanf2_io.cmx tscanf2_master.cmx
|
|
|
|
|
2007-11-06 13:06:18 -08:00
|
|
|
scanf: tscanf.byt tscanf.bin tscanf2.byt tscanf2.bin
|
2002-12-08 08:05:32 -08:00
|
|
|
./tscanf.byt
|
2007-11-06 13:06:18 -08:00
|
|
|
./tscanf.bin
|
2005-07-01 05:39:43 -07:00
|
|
|
./tscanf2_master.byt ./tscanf2_slave.byt
|
2007-11-06 13:06:18 -08:00
|
|
|
./tscanf2_master.bin ./tscanf2_slave.bin
|
2002-12-08 08:05:32 -08:00
|
|
|
|
2002-12-09 06:06:08 -08:00
|
|
|
regexp.byt: ../../otherlibs/str/str.cma regexp.ml
|
|
|
|
$(CAMLC) -custom -I ../../otherlibs/str -o regexp.byt str.cma regexp.ml
|
2008-09-09 01:48:24 -07:00
|
|
|
regexp.bin: ../../otherlibs/str/str.cmxa regexp.ml
|
|
|
|
$(CAMLOPT) -I ../../otherlibs/str -o regexp.bin str.cmxa regexp.ml
|
2002-12-09 06:06:08 -08:00
|
|
|
|
2007-11-06 13:06:18 -08:00
|
|
|
md5.bin: md5.ml
|
|
|
|
$(CAMLOPT) -unsafe -inline 100 -o md5.bin md5.ml
|
2003-04-25 05:27:31 -07:00
|
|
|
|
2004-08-12 05:59:45 -07:00
|
|
|
recmod.byt: recmod.cmo
|
|
|
|
$(CAMLC) -o recmod.byt recmod.cmo
|
|
|
|
|
2007-11-06 13:06:18 -08:00
|
|
|
recmod.bin: recmod.cmx
|
|
|
|
$(CAMLOPT) -o recmod.bin recmod.cmx
|
2004-08-12 05:59:45 -07:00
|
|
|
|
2008-08-07 02:29:57 -07:00
|
|
|
recmods:
|
|
|
|
set -e; \
|
|
|
|
for i in recmod/*.ml; do \
|
|
|
|
case $$i in \
|
|
|
|
*ok.ml) \
|
|
|
|
echo "$$i (should succeed)"; \
|
|
|
|
$(CAMLC) -c $$i;; \
|
|
|
|
*bad.ml) \
|
|
|
|
echo "$$i (should fail)"; \
|
|
|
|
if $(CAMLC) -c $$i; then exit 2; else :; fi;; \
|
|
|
|
esac; \
|
|
|
|
done
|
|
|
|
|
|
|
|
clean::
|
|
|
|
rm -f recmods/*.cm[io]
|
|
|
|
|
2007-11-28 14:22:35 -08:00
|
|
|
length.cmo: length.cmi
|
|
|
|
tlength.cmo: length.cmo
|
|
|
|
|
|
|
|
tlength.byt: length.cmo tlength.cmo
|
|
|
|
$(CAMLC) -g -o tlength.byt length.cmo tlength.cmo
|
|
|
|
|
|
|
|
float_record.cmo: float_record.cmi
|
|
|
|
tfloat_record.cmo: float_record.cmo
|
|
|
|
tfloat_record.byt: float_record.cmo tfloat_record.cmo
|
|
|
|
$(CAMLC) -g -o tfloat_record.byt float_record.cmo tfloat_record.cmo
|
|
|
|
|
1995-12-20 02:39:12 -08:00
|
|
|
# Common rules
|
|
|
|
|
|
|
|
.SUFFIXES:
|
2007-11-06 13:06:18 -08:00
|
|
|
.SUFFIXES: .mli .ml .cmi .cmo .cmx .byt .fast.byt .bin .fast.bin .c .o
|
1995-12-20 02:39:12 -08:00
|
|
|
|
|
|
|
.ml.byt:
|
2008-03-14 06:47:24 -07:00
|
|
|
$(CAMLC) $(BYTEFLAGS) -o $*.byt $<
|
1995-12-20 02:39:12 -08:00
|
|
|
|
|
|
|
.ml.fast.byt:
|
|
|
|
cp $*.ml $*_fast.ml
|
2008-03-14 06:47:24 -07:00
|
|
|
$(CAMLC) $(BYTEFLAGS) -unsafe -o $*.fast.byt $*_fast.ml
|
1995-12-20 02:39:12 -08:00
|
|
|
rm -f $*_fast.ml
|
|
|
|
|
2007-11-06 13:06:18 -08:00
|
|
|
.ml.bin:
|
|
|
|
$(CAMLOPT) $(OPTFLAGS) -o $*.bin $<
|
1995-12-20 02:39:12 -08:00
|
|
|
|
2007-11-06 13:06:18 -08:00
|
|
|
.ml.fast.bin:
|
1995-12-20 02:39:12 -08:00
|
|
|
cp $*.ml $*_fast.ml
|
2007-11-06 13:06:18 -08:00
|
|
|
$(CAMLOPT) $(OPTFLAGS) -unsafe -o $*.fast.bin $*_fast.ml
|
1995-12-20 02:39:12 -08:00
|
|
|
rm -f $*_fast.ml
|
|
|
|
|
|
|
|
.mli.cmi:
|
|
|
|
$(CAMLC) -c $<
|
|
|
|
|
|
|
|
.ml.cmo:
|
2008-03-14 06:47:24 -07:00
|
|
|
$(CAMLC) $(BYTEFLAGS) -c -g $<
|
1995-12-20 02:39:12 -08:00
|
|
|
|
|
|
|
.ml.cmx:
|
|
|
|
$(CAMLOPT) $(OPTFLAGS) -c $<
|
|
|
|
|
|
|
|
.c.o:
|
1997-02-03 06:41:42 -08:00
|
|
|
$(NATIVECC) $(NATIVECCCOMPOPTS) -I../../byterun -c $<
|
1995-12-20 02:39:12 -08:00
|
|
|
|
|
|
|
clean::
|
2008-09-08 23:40:06 -07:00
|
|
|
rm -f *.byt *.bin a.out
|
1995-12-20 02:39:12 -08:00
|
|
|
rm -f *.cm[iox] *.[os]
|
|
|
|
rm -f *~
|
1996-04-01 07:26:56 -08:00
|
|
|
rm -f intext.data
|
1995-12-20 02:39:12 -08:00
|
|
|
|
|
|
|
# Dependencies
|
|
|
|
|
2006-01-20 02:14:47 -08:00
|
|
|
#depend:
|
|
|
|
# $(CAMLDEP) *.mli *.ml > .depend
|
1995-12-20 02:39:12 -08:00
|
|
|
|
|
|
|
include .depend
|