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 #
|
2001-12-07 05:41:02 -08:00
|
|
|
# under the terms of the GNU Library General Public License, with #
|
|
|
|
# the special exception on linking described in file ../LICENSE. #
|
1999-11-17 10:59:06 -08:00
|
|
|
# #
|
|
|
|
#########################################################################
|
|
|
|
|
|
|
|
# $Id$
|
|
|
|
|
1996-02-13 08:29:09 -08:00
|
|
|
include ../config/Makefile
|
1995-05-04 03:15:53 -07:00
|
|
|
|
1996-04-30 07:53:58 -07:00
|
|
|
RUNTIME=../boot/ocamlrun
|
|
|
|
COMPILER=../ocamlc
|
1995-06-18 07:45:56 -07:00
|
|
|
CAMLC=$(RUNTIME) $(COMPILER)
|
2002-02-14 07:17:11 -08:00
|
|
|
COMPFLAGS=-g -warn-error A -nostdlib
|
1996-04-30 07:53:58 -07:00
|
|
|
OPTCOMPILER=../ocamlopt
|
1995-07-10 02:48:27 -07:00
|
|
|
CAMLOPT=$(RUNTIME) $(OPTCOMPILER)
|
2002-02-14 07:17:11 -08:00
|
|
|
OPTCOMPFLAGS=-warn-error A -nostdlib
|
1996-04-30 07:53:58 -07:00
|
|
|
CAMLDEP=../boot/ocamlrun ../tools/ocamldep
|
1995-05-04 03:15:53 -07:00
|
|
|
|
2001-09-06 01:52:32 -07:00
|
|
|
BASIC=pervasives.cmo array.cmo list.cmo char.cmo string.cmo sys.cmo \
|
1999-11-29 11:04:04 -08:00
|
|
|
hashtbl.cmo sort.cmo marshal.cmo obj.cmo \
|
2003-06-12 09:49:32 -07:00
|
|
|
int32.cmo int64.cmo nativeint.cmo \
|
1997-10-28 05:17:11 -08:00
|
|
|
lexing.cmo parsing.cmo \
|
2002-05-07 00:41:12 -07:00
|
|
|
set.cmo map.cmo stack.cmo queue.cmo stream.cmo buffer.cmo \
|
2002-05-27 15:01:05 -07:00
|
|
|
printf.cmo format.cmo scanf.cmo \
|
2002-05-07 00:41:12 -07:00
|
|
|
arg.cmo printexc.cmo gc.cmo \
|
2002-04-24 02:49:06 -07:00
|
|
|
digest.cmo random.cmo camlinternalOO.cmo oo.cmo \
|
|
|
|
genlex.cmo callback.cmo weak.cmo \
|
2003-06-12 09:49:32 -07:00
|
|
|
lazy.cmo filename.cmo complex.cmo
|
2001-10-03 05:21:22 -07:00
|
|
|
LABELLED=arrayLabels.ml listLabels.ml stringLabels.ml moreLabels.ml
|
2001-09-06 01:52:32 -07:00
|
|
|
|
|
|
|
OBJS=$(BASIC) labelled.cmo stdLabels.cmo
|
|
|
|
ALLOBJS=$(BASIC) $(LABELLED:.ml=.cmo) stdLabels.cmo
|
1995-05-04 03:15:53 -07:00
|
|
|
|
1998-06-01 07:53:28 -07:00
|
|
|
all: stdlib.cma std_exit.cmo camlheader camlheader_ur
|
1995-05-04 03:15:53 -07:00
|
|
|
|
1998-11-06 07:39:18 -08:00
|
|
|
allopt: stdlib.cmxa std_exit.cmx allopt-$(PROFILING)
|
|
|
|
|
|
|
|
allopt-noprof:
|
|
|
|
|
|
|
|
allopt-prof: stdlib.p.cmxa std_exit.p.cmx
|
1995-07-21 02:03:58 -07:00
|
|
|
|
1995-05-04 03:15:53 -07:00
|
|
|
install:
|
2002-06-05 05:08:38 -07:00
|
|
|
cp stdlib.cma std_exit.cmo *.cmi *.mli *.ml camlheader camlheader_ur \
|
|
|
|
$(LIBDIR)
|
1995-05-04 03:15:53 -07:00
|
|
|
|
1998-11-06 07:39:18 -08:00
|
|
|
installopt: installopt-default installopt-$(PROFILING)
|
|
|
|
|
|
|
|
installopt-default:
|
1995-10-26 09:25:03 -07:00
|
|
|
cp stdlib.cmxa stdlib.a std_exit.o *.cmx $(LIBDIR)
|
1998-11-06 07:39:18 -08:00
|
|
|
cd $(LIBDIR); $(RANLIB) stdlib.a
|
|
|
|
|
|
|
|
installopt-noprof:
|
1999-01-27 02:53:29 -08:00
|
|
|
rm -f $(LIBDIR)/stdlib.p.cmxa; ln -s stdlib.cmxa $(LIBDIR)/stdlib.p.cmxa
|
|
|
|
rm -f $(LIBDIR)/stdlib.p.a; ln -s stdlib.a $(LIBDIR)/stdlib.p.a
|
2002-06-05 05:08:38 -07:00
|
|
|
rm -f $(LIBDIR)/std_exit.p.cmx; \
|
|
|
|
ln -s std_exit.cmx $(LIBDIR)/std_exit.p.cmx
|
1999-01-27 02:53:29 -08:00
|
|
|
rm -f $(LIBDIR)/std_exit.p.o; ln -s std_exit.o $(LIBDIR)/std_exit.p.o
|
1998-11-06 07:39:18 -08:00
|
|
|
|
|
|
|
installopt-prof:
|
|
|
|
cp stdlib.p.cmxa stdlib.p.a std_exit.p.cmx std_exit.p.o $(LIBDIR)
|
|
|
|
cd $(LIBDIR); $(RANLIB) stdlib.p.a
|
1995-07-21 02:03:58 -07:00
|
|
|
|
1995-05-04 03:15:53 -07:00
|
|
|
stdlib.cma: $(OBJS)
|
2001-09-06 01:52:32 -07:00
|
|
|
$(CAMLC) -a -o stdlib.cma $(ALLOBJS)
|
1995-05-04 03:15:53 -07:00
|
|
|
|
1995-07-11 11:08:25 -07:00
|
|
|
stdlib.cmxa: $(OBJS:.cmo=.cmx)
|
2001-09-06 01:52:32 -07:00
|
|
|
$(CAMLOPT) -a -o stdlib.cmxa $(ALLOBJS:.cmo=.cmx)
|
1995-07-10 02:48:27 -07:00
|
|
|
|
1998-08-06 06:27:38 -07:00
|
|
|
stdlib.p.cmxa: $(OBJS:.cmo=.p.cmx)
|
2001-09-06 01:52:32 -07:00
|
|
|
$(CAMLOPT) -a -o stdlib.p.cmxa $(ALLOBJS:.cmo=.p.cmx)
|
1998-08-06 06:27:38 -07:00
|
|
|
|
1998-06-01 07:53:28 -07:00
|
|
|
camlheader camlheader_ur: header.c ../config/Makefile
|
|
|
|
if $(SHARPBANGSCRIPTS); then \
|
1998-09-02 11:21:28 -07:00
|
|
|
echo '#!$(BINDIR)/ocamlrun' > camlheader && \
|
|
|
|
echo '#!' | tr -d '\012' > camlheader_ur; \
|
1998-06-01 07:53:28 -07:00
|
|
|
else \
|
2002-06-05 05:08:38 -07:00
|
|
|
$(BYTECC) $(BYTECCCOMPOPTS) $(BYTECCLINKOPTS) \
|
|
|
|
-DRUNTIME_NAME='"$(BINDIR)/ocamlrun"' \
|
|
|
|
header.c -o tmpheader$(EXE) && \
|
2000-08-10 02:58:08 -07:00
|
|
|
strip tmpheader$(EXE) && \
|
|
|
|
mv tmpheader$(EXE) camlheader && \
|
1998-06-01 07:53:28 -07:00
|
|
|
cp camlheader camlheader_ur; \
|
1997-03-04 02:21:27 -08:00
|
|
|
fi
|
1995-05-04 03:15:53 -07:00
|
|
|
|
1996-02-15 08:19:09 -08:00
|
|
|
clean::
|
1998-06-01 07:53:28 -07:00
|
|
|
rm -f camlheader camlheader_ur
|
1996-02-15 08:19:09 -08:00
|
|
|
|
1995-05-04 03:15:53 -07:00
|
|
|
pervasives.cmi: pervasives.mli
|
1995-07-18 01:43:50 -07:00
|
|
|
$(CAMLC) $(COMPFLAGS) -nopervasives -c pervasives.mli
|
1995-05-04 03:15:53 -07:00
|
|
|
|
|
|
|
pervasives.cmo: pervasives.ml
|
1995-07-18 01:43:50 -07:00
|
|
|
$(CAMLC) $(COMPFLAGS) -nopervasives -c pervasives.ml
|
1995-05-04 03:15:53 -07:00
|
|
|
|
1995-07-10 02:48:27 -07:00
|
|
|
pervasives.cmx: pervasives.ml
|
1997-02-19 08:10:57 -08:00
|
|
|
$(CAMLOPT) $(OPTCOMPFLAGS) -nopervasives -c pervasives.ml
|
1995-07-10 02:48:27 -07:00
|
|
|
|
1998-08-06 06:27:38 -07:00
|
|
|
pervasives.p.cmx: pervasives.ml
|
2002-06-05 05:08:38 -07:00
|
|
|
@if test -f pervasives.cmx; \
|
|
|
|
then mv pervasives.cmx pervasives.n.cmx; else :; fi
|
|
|
|
@if test -f pervasives.o; \
|
|
|
|
then mv pervasives.o pervasives.n.o; else :; fi
|
1998-08-06 06:27:38 -07:00
|
|
|
$(CAMLOPT) $(OPTCOMPFLAGS) -p -nopervasives -c pervasives.ml
|
|
|
|
mv pervasives.cmx pervasives.p.cmx
|
|
|
|
mv pervasives.o pervasives.p.o
|
2002-06-05 05:08:38 -07:00
|
|
|
@if test -f pervasives.n.cmx; \
|
|
|
|
then mv pervasives.n.cmx pervasives.cmx; else :; fi
|
|
|
|
@if test -f pervasives.n.o; \
|
|
|
|
then mv pervasives.n.o pervasives.o; else :; fi
|
1998-08-06 06:27:38 -07:00
|
|
|
|
2002-04-24 02:49:06 -07:00
|
|
|
# camlinternalOO.cmi must be compiled with -nopervasives for applets
|
|
|
|
camlinternalOO.cmi: camlinternalOO.mli
|
|
|
|
$(CAMLC) $(COMPFLAGS) -nopervasives -c camlinternalOO.mli
|
1997-09-30 03:15:06 -07:00
|
|
|
|
2001-09-06 01:52:32 -07:00
|
|
|
# labelled modules require the -nolabels flag
|
|
|
|
labelled.cmo:
|
2002-06-05 05:08:38 -07:00
|
|
|
$(MAKE) EXTRAFLAGS=-nolabels RUNTIME=$(RUNTIME) \
|
|
|
|
COMPILER=$(COMPILER) $(LABELLED:.ml=.cmo)
|
2001-09-06 01:52:32 -07:00
|
|
|
touch $@
|
|
|
|
labelled.cmx:
|
|
|
|
$(MAKE) EXTRAFLAGS=-nolabels $(LABELLED:.ml=.cmx)
|
|
|
|
touch $@
|
|
|
|
labelled.p.cmx:
|
|
|
|
$(MAKE) EXTRAFLAGS=-nolabels $(LABELLED:.ml=.p.cmx)
|
|
|
|
touch $@
|
|
|
|
|
1998-08-06 06:27:38 -07:00
|
|
|
.SUFFIXES: .mli .ml .cmi .cmo .cmx .p.cmx
|
1995-05-04 03:15:53 -07:00
|
|
|
|
|
|
|
.mli.cmi:
|
2001-09-06 01:52:32 -07:00
|
|
|
$(CAMLC) $(COMPFLAGS) $(EXTRAFLAGS) -c $<
|
1995-05-04 03:15:53 -07:00
|
|
|
|
|
|
|
.ml.cmo:
|
2001-09-06 01:52:32 -07:00
|
|
|
$(CAMLC) $(COMPFLAGS) $(EXTRAFLAGS) -c $<
|
1995-05-04 03:15:53 -07:00
|
|
|
|
1995-07-10 02:48:27 -07:00
|
|
|
.ml.cmx:
|
2001-09-06 01:52:32 -07:00
|
|
|
$(CAMLOPT) $(OPTCOMPFLAGS) $(EXTRAFLAGS) -c $<
|
1995-07-10 02:48:27 -07:00
|
|
|
|
1998-08-06 06:27:38 -07:00
|
|
|
.ml.p.cmx:
|
|
|
|
@if test -f $*.cmx; then mv $*.cmx $*.n.cmx; else :; fi
|
|
|
|
@if test -f $*.o; then mv $*.o $*.n.o; else :; fi
|
2001-09-06 01:52:32 -07:00
|
|
|
$(CAMLOPT) $(OPTCOMPFLAGS) $(EXTRAFLAGS) -p -c $<
|
1998-08-06 06:27:38 -07:00
|
|
|
mv $*.cmx $*.p.cmx
|
|
|
|
mv $*.o $*.p.o
|
|
|
|
@if test -f $*.n.cmx; then mv $*.n.cmx $*.cmx; else :; fi
|
|
|
|
@if test -f $*.n.o; then mv $*.n.o $*.o; else :; fi
|
|
|
|
|
2001-09-06 01:52:32 -07:00
|
|
|
$(ALLOBJS) labelled.cmo std_exit.cmo: pervasives.cmi $(COMPILER)
|
|
|
|
$(ALLOBJS:.cmo=.cmx) labelled.cmx std_exit.cmx: pervasives.cmi $(OPTCOMPILER)
|
|
|
|
$(ALLOBJS:.cmo=.p.cmx) labelled.p.cmx std_exit.p.cmx: pervasives.cmi $(OPTCOMPILER)
|
|
|
|
$(ALLOBJS:.cmo=.cmi) std_exit.cmi: $(COMPILER)
|
|
|
|
labelled.cmo labelled.cmx labelled.p.cmx: $(LABELLED) $(LABELLED:.ml=.mli)
|
1995-05-04 03:15:53 -07:00
|
|
|
|
1996-02-15 08:19:09 -08:00
|
|
|
clean::
|
1995-11-26 12:23:16 -08:00
|
|
|
rm -f *.cm* *.o *.a
|
1995-05-04 03:15:53 -07:00
|
|
|
rm -f *~
|
|
|
|
|
|
|
|
include .depend
|
|
|
|
|
1996-11-08 06:47:14 -08:00
|
|
|
depend:
|
1995-05-04 03:15:53 -07:00
|
|
|
$(CAMLDEP) *.mli *.ml > .depend
|