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-10-24 08:46:19 -07:00
|
|
|
|
1996-04-30 07:53:58 -07:00
|
|
|
CAMLRUN=../boot/ocamlrun
|
2002-11-01 09:06:47 -08:00
|
|
|
CAMLC=$(CAMLRUN) ../boot/ocamlc -nostdlib -I ../boot
|
|
|
|
CAMLOPT=$(CAMLRUN) ../ocamlopt -nostdlib -I ../stdlib
|
1996-04-30 07:53:58 -07:00
|
|
|
CAMLLEX=$(CAMLRUN) ../boot/ocamllex
|
1998-04-06 09:34:56 -07:00
|
|
|
INCLUDES=-I ../utils -I ../parsing -I ../typing -I ../bytecomp -I ../asmcomp \
|
|
|
|
-I ../driver
|
2002-11-01 09:06:47 -08:00
|
|
|
COMPFLAGS= -warn-error A $(INCLUDES)
|
1995-05-04 03:15:53 -07:00
|
|
|
LINKFLAGS=$(INCLUDES)
|
|
|
|
|
2006-01-04 08:55:50 -08:00
|
|
|
all: ocamldep ocamlprof ocamlcp ocamlmktop ocamlmklib scrapelabels addlabels \
|
|
|
|
dumpobj
|
1995-10-24 08:46:19 -07:00
|
|
|
|
2002-11-15 08:16:07 -08:00
|
|
|
opt.opt: ocamldep.opt
|
2002-03-18 08:44:54 -08:00
|
|
|
|
1995-10-24 08:46:19 -07:00
|
|
|
# The dependency generator
|
1995-08-25 06:54:58 -07:00
|
|
|
|
2002-03-18 07:08:53 -08:00
|
|
|
CAMLDEP_OBJ=depend.cmo ocamldep.cmo
|
2000-04-21 01:13:22 -07:00
|
|
|
CAMLDEP_IMPORTS=misc.cmo config.cmo clflags.cmo terminfo.cmo \
|
2001-09-09 04:39:34 -07:00
|
|
|
linenum.cmo warnings.cmo location.cmo longident.cmo \
|
1999-01-27 02:53:54 -08:00
|
|
|
syntaxerr.cmo parser.cmo lexer.cmo parse.cmo
|
1995-08-25 06:54:58 -07:00
|
|
|
|
2002-03-18 07:08:53 -08:00
|
|
|
ocamldep: depend.cmi $(CAMLDEP_OBJ)
|
2000-10-02 07:18:05 -07:00
|
|
|
$(CAMLC) $(LINKFLAGS) -o ocamldep $(CAMLDEP_IMPORTS) $(CAMLDEP_OBJ)
|
1995-08-25 06:54:58 -07:00
|
|
|
|
2002-11-15 08:16:07 -08:00
|
|
|
ocamldep.opt: depend.cmi $(CAMLDEP_OBJ:.cmo=.cmx)
|
|
|
|
$(CAMLOPT) $(LINKFLAGS) -o ocamldep.opt $(CAMLDEP_IMPORTS:.cmo=.cmx) \
|
|
|
|
$(CAMLDEP_OBJ:.cmo=.cmx)
|
2002-03-18 08:44:54 -08:00
|
|
|
|
2002-11-15 08:16:07 -08:00
|
|
|
# ocamldep is precious: sometimes we are stuck in the middle of a
|
|
|
|
# bootstrap and we need to remake the dependencies
|
1995-08-25 06:54:58 -07:00
|
|
|
clean::
|
2002-11-26 09:14:01 -08:00
|
|
|
if test -f ocamldep; then mv -f ocamldep ocamldep.bak; else :; fi
|
2002-11-15 08:16:07 -08:00
|
|
|
rm -f ocamldep.opt
|
1995-08-25 06:54:58 -07:00
|
|
|
|
1995-10-24 08:46:19 -07:00
|
|
|
install::
|
2000-08-10 02:58:08 -07:00
|
|
|
cp ocamldep $(BINDIR)/ocamldep$(EXE)
|
2002-11-15 08:16:07 -08:00
|
|
|
if test -f ocamldep.opt; \
|
|
|
|
then cp ocamldep.opt $(BINDIR)/ocamldep.opt$(EXE); else :; fi
|
1995-10-24 08:46:19 -07:00
|
|
|
|
|
|
|
# The profiler
|
|
|
|
|
1996-04-30 07:53:58 -07:00
|
|
|
CSLPROF=ocamlprof.cmo
|
2000-04-21 01:13:22 -07:00
|
|
|
CSLPROF_IMPORTS=misc.cmo config.cmo clflags.cmo terminfo.cmo \
|
2001-09-09 04:39:34 -07:00
|
|
|
linenum.cmo warnings.cmo location.cmo longident.cmo \
|
1997-08-22 01:55:41 -07:00
|
|
|
syntaxerr.cmo parser.cmo lexer.cmo parse.cmo
|
1995-10-24 08:46:19 -07:00
|
|
|
|
1996-04-30 07:53:58 -07:00
|
|
|
ocamlprof: $(CSLPROF) profiling.cmo
|
|
|
|
$(CAMLC) $(LINKFLAGS) -o ocamlprof $(CSLPROF_IMPORTS) $(CSLPROF)
|
1995-10-24 08:46:19 -07:00
|
|
|
|
1998-04-06 09:34:56 -07:00
|
|
|
ocamlcp: ocamlcp.cmo
|
|
|
|
$(CAMLC) $(LINKFLAGS) -o ocamlcp main_args.cmo ocamlcp.cmo
|
|
|
|
|
1995-10-24 08:46:19 -07:00
|
|
|
install::
|
2000-08-10 02:58:08 -07:00
|
|
|
cp ocamlprof $(BINDIR)/ocamlprof$(EXE)
|
|
|
|
cp ocamlcp $(BINDIR)/ocamlcp$(EXE)
|
1995-11-13 06:25:17 -08:00
|
|
|
cp profiling.cmi profiling.cmo $(LIBDIR)
|
1995-10-24 08:46:19 -07:00
|
|
|
|
|
|
|
clean::
|
1998-04-06 09:34:56 -07:00
|
|
|
rm -f ocamlprof ocamlcp
|
1995-10-24 08:46:19 -07:00
|
|
|
|
|
|
|
# To make custom toplevels
|
|
|
|
|
1998-10-20 05:52:02 -07:00
|
|
|
ocamlmktop: ocamlmktop.tpl ../config/Makefile
|
|
|
|
sed -e 's|%%BINDIR%%|$(BINDIR)|' ocamlmktop.tpl > ocamlmktop
|
|
|
|
chmod +x ocamlmktop
|
|
|
|
|
1995-10-24 08:46:19 -07:00
|
|
|
install::
|
1996-04-30 07:53:58 -07:00
|
|
|
cp ocamlmktop $(BINDIR)/ocamlmktop
|
1995-10-24 08:46:19 -07:00
|
|
|
|
1998-10-20 05:52:02 -07:00
|
|
|
clean::
|
|
|
|
rm -f ocamlmktop
|
|
|
|
|
2001-08-28 07:47:48 -07:00
|
|
|
# To help building mixed-mode libraries (Caml + C)
|
|
|
|
|
2001-10-30 01:31:01 -08:00
|
|
|
ocamlmklib: ocamlmklib.cmo
|
|
|
|
$(CAMLC) $(LINKFLAGS) -o ocamlmklib ocamlmklib.cmo
|
|
|
|
|
|
|
|
install::
|
|
|
|
cp ocamlmklib $(BINDIR)/ocamlmklib
|
|
|
|
|
|
|
|
clean::
|
|
|
|
rm -f ocamlmklib
|
|
|
|
|
|
|
|
ocamlmklib.ml: ocamlmklib.mlp ../config/Makefile
|
2004-04-15 09:06:39 -07:00
|
|
|
echo '(* THIS FILE IS GENERATED FROM ocamlmklib.mlp *)' >ocamlmklib.ml
|
2001-08-30 03:11:51 -07:00
|
|
|
sed -e "s|%%BINDIR%%|$(BINDIR)|" \
|
|
|
|
-e "s|%%SUPPORTS_SHARED_LIBRARIES%%|$(SUPPORTS_SHARED_LIBRARIES)|" \
|
|
|
|
-e "s|%%MKSHAREDLIB%%|$(MKSHAREDLIB)|" \
|
2001-10-30 01:31:01 -08:00
|
|
|
-e "s|%%BYTECCRPATH%%|$(BYTECCRPATH)|" \
|
|
|
|
-e "s|%%NATIVECCRPATH%%|$(NATIVECCRPATH)|" \
|
|
|
|
-e "s|%%MKSHAREDLIBRPATH%%|$(MKSHAREDLIBRPATH)|" \
|
2001-08-30 03:11:51 -07:00
|
|
|
-e "s|%%RANLIB%%|$(RANLIB)|" \
|
2004-04-15 09:06:39 -07:00
|
|
|
ocamlmklib.mlp >> ocamlmklib.ml
|
2001-08-28 07:47:48 -07:00
|
|
|
|
2001-10-30 01:31:01 -08:00
|
|
|
beforedepend:: ocamlmklib.ml
|
2001-08-28 07:47:48 -07:00
|
|
|
|
|
|
|
clean::
|
2001-10-30 01:31:01 -08:00
|
|
|
rm -f ocamlmklib.ml
|
2001-08-28 07:47:48 -07:00
|
|
|
|
2001-09-06 01:52:32 -07:00
|
|
|
# Converter olabl/ocaml 2.99 to ocaml 3
|
1999-12-17 02:04:52 -08:00
|
|
|
|
2000-04-12 02:55:05 -07:00
|
|
|
OCAML299TO3= lexer299.cmo ocaml299to3.cmo
|
|
|
|
LIBRARY3= misc.cmo warnings.cmo linenum.cmo location.cmo
|
1999-12-17 02:04:52 -08:00
|
|
|
|
2000-04-12 02:55:05 -07:00
|
|
|
ocaml299to3: $(OCAML299TO3)
|
|
|
|
$(CAMLC) $(LINKFLAGS) -o ocaml299to3 $(LIBRARY3) $(OCAML299TO3)
|
1999-12-17 02:04:52 -08:00
|
|
|
|
2000-04-12 02:55:05 -07:00
|
|
|
lexer299.ml: lexer299.mll
|
|
|
|
$(CAMLLEX) lexer299.mll
|
1999-12-17 02:04:52 -08:00
|
|
|
|
2001-09-15 06:57:43 -07:00
|
|
|
#install::
|
|
|
|
# cp ocaml299to3 $(BINDIR)/ocaml299to3$(EXE)
|
|
|
|
|
|
|
|
clean::
|
|
|
|
rm -f ocaml299to3 lexer299.ml
|
|
|
|
|
2001-09-06 01:52:32 -07:00
|
|
|
# Label remover for interface files (upgrade 3.02 to 3.03)
|
|
|
|
|
|
|
|
SCRAPELABELS= lexer301.cmo scrapelabels.cmo
|
|
|
|
|
|
|
|
scrapelabels: $(SCRAPELABELS)
|
|
|
|
$(CAMLC) $(LINKFLAGS) -o scrapelabels $(LIBRARY3) $(SCRAPELABELS)
|
|
|
|
|
|
|
|
lexer301.ml: lexer301.mll
|
|
|
|
$(CAMLLEX) lexer301.mll
|
|
|
|
|
2001-10-03 19:00:12 -07:00
|
|
|
install::
|
|
|
|
cp scrapelabels $(LIBDIR)
|
|
|
|
|
2001-09-15 06:57:43 -07:00
|
|
|
clean::
|
|
|
|
rm -f scrapelabels lexer301.ml
|
|
|
|
|
|
|
|
# Insert labels following an interface file (upgrade 3.02 to 3.03)
|
|
|
|
|
|
|
|
ADDLABELS_IMPORTS=misc.cmo config.cmo clflags.cmo terminfo.cmo \
|
|
|
|
linenum.cmo warnings.cmo location.cmo longident.cmo \
|
|
|
|
syntaxerr.cmo parser.cmo lexer.cmo parse.cmo
|
|
|
|
|
|
|
|
addlabels: addlabels.ml
|
|
|
|
$(CAMLC) $(LINKFLAGS) -w sl -o addlabels \
|
|
|
|
$(ADDLABELS_IMPORTS) addlabels.ml
|
1999-12-17 02:04:52 -08:00
|
|
|
|
2001-10-03 19:00:12 -07:00
|
|
|
install::
|
|
|
|
cp addlabels $(LIBDIR)
|
|
|
|
|
1999-12-17 02:04:52 -08:00
|
|
|
clean::
|
2001-09-15 06:57:43 -07:00
|
|
|
rm -f addlabels
|
1999-12-17 02:04:52 -08:00
|
|
|
|
1996-10-07 06:20:28 -07:00
|
|
|
# The preprocessor for asm generators
|
|
|
|
|
|
|
|
CVT_EMIT=cvt_emit.cmo
|
|
|
|
|
|
|
|
cvt_emit: $(CVT_EMIT)
|
|
|
|
$(CAMLC) $(LINKFLAGS) -o cvt_emit $(CVT_EMIT)
|
|
|
|
|
2003-04-01 17:17:58 -08:00
|
|
|
# cvt_emit is precious: sometimes we are stuck in the middle of a
|
|
|
|
# bootstrap and we need to remake the dependencies
|
1996-10-07 06:20:28 -07:00
|
|
|
clean::
|
2003-04-01 17:17:58 -08:00
|
|
|
if test -f cvt_emit; then mv -f cvt_emit cvt_emit.bak; else :; fi
|
1996-10-07 06:20:28 -07:00
|
|
|
|
|
|
|
cvt_emit.ml: cvt_emit.mll
|
|
|
|
$(CAMLLEX) cvt_emit.mll
|
|
|
|
|
|
|
|
clean::
|
|
|
|
rm -f cvt_emit.ml
|
|
|
|
|
|
|
|
beforedepend:: cvt_emit.ml
|
|
|
|
|
1995-10-24 08:46:19 -07:00
|
|
|
# The bytecode disassembler
|
|
|
|
|
1995-05-22 08:43:44 -07:00
|
|
|
DUMPOBJ=opnames.cmo dumpobj.cmo
|
1995-05-04 03:15:53 -07:00
|
|
|
|
|
|
|
dumpobj: $(DUMPOBJ)
|
1999-11-10 04:48:47 -08:00
|
|
|
$(CAMLC) $(LINKFLAGS) -o dumpobj \
|
2000-04-21 01:13:22 -07:00
|
|
|
misc.cmo tbl.cmo config.cmo ident.cmo \
|
2000-03-05 11:18:50 -08:00
|
|
|
opcodes.cmo bytesections.cmo $(DUMPOBJ)
|
1995-05-04 03:15:53 -07:00
|
|
|
|
|
|
|
clean::
|
|
|
|
rm -f dumpobj
|
|
|
|
|
|
|
|
opnames.ml: ../byterun/instruct.h
|
2001-12-07 06:25:00 -08:00
|
|
|
unset LC_ALL LC_CTYPE LC_COLLATE LANG; \
|
1995-05-04 03:15:53 -07:00
|
|
|
sed -e '/\/\*/d' \
|
1997-01-01 07:38:23 -08:00
|
|
|
-e '/^#/d' \
|
1995-05-04 03:15:53 -07:00
|
|
|
-e 's/enum \(.*\) {/let names_of_\1 = [|/' \
|
|
|
|
-e 's/};$$/ |]/' \
|
|
|
|
-e 's/\([A-Z][A-Z_0-9a-z]*\)/"\1"/g' \
|
|
|
|
-e 's/,/;/g' \
|
|
|
|
../byterun/instruct.h > opnames.ml
|
|
|
|
|
|
|
|
clean::
|
|
|
|
rm -f opnames.ml
|
|
|
|
|
|
|
|
beforedepend:: opnames.ml
|
|
|
|
|
1995-10-24 08:46:19 -07:00
|
|
|
# Dump .cmx files
|
|
|
|
|
1995-07-02 09:47:48 -07:00
|
|
|
dumpapprox: dumpapprox.cmo
|
|
|
|
$(CAMLC) $(LINKFLAGS) -o dumpapprox config.cmo dumpapprox.cmo
|
|
|
|
|
|
|
|
clean::
|
|
|
|
rm -f dumpapprox
|
|
|
|
|
1995-10-24 08:46:19 -07:00
|
|
|
# Print imported interfaces for .cmo files
|
|
|
|
|
1995-10-09 06:37:11 -07:00
|
|
|
objinfo: objinfo.cmo
|
|
|
|
$(CAMLC) $(LINKFLAGS) -o objinfo config.cmo objinfo.cmo
|
|
|
|
|
|
|
|
clean::
|
|
|
|
rm -f objinfo
|
|
|
|
|
1999-03-14 05:14:35 -08:00
|
|
|
# Scan object files for required primitives
|
|
|
|
|
|
|
|
PRIMREQ=primreq.cmo
|
|
|
|
|
|
|
|
primreq: $(PRIMREQ)
|
|
|
|
$(CAMLC) $(LINKFLAGS) -o primreq config.cmo $(PRIMREQ)
|
|
|
|
|
|
|
|
clean::
|
|
|
|
rm -f primreq
|
|
|
|
|
1995-10-24 08:46:19 -07:00
|
|
|
# Common stuff
|
|
|
|
|
1995-05-04 03:15:53 -07:00
|
|
|
.SUFFIXES:
|
2002-11-15 08:16:07 -08:00
|
|
|
.SUFFIXES: .ml .cmo .mli .cmi .cmx
|
1995-05-04 03:15:53 -07:00
|
|
|
|
1995-05-22 08:43:44 -07:00
|
|
|
.ml.cmo:
|
1995-05-04 03:15:53 -07:00
|
|
|
$(CAMLC) -c $(COMPFLAGS) $<
|
|
|
|
|
1995-05-22 08:43:44 -07:00
|
|
|
.mli.cmi:
|
1995-05-04 03:15:53 -07:00
|
|
|
$(CAMLC) -c $(COMPFLAGS) $<
|
|
|
|
|
2002-11-15 08:16:07 -08:00
|
|
|
.ml.cmx:
|
|
|
|
$(CAMLOPT) $(COMPFLAGS) -c $<
|
|
|
|
|
1995-05-04 03:15:53 -07:00
|
|
|
clean::
|
1995-05-22 08:43:44 -07:00
|
|
|
rm -f *.cmo *.cmi
|
1995-05-04 03:15:53 -07:00
|
|
|
|
|
|
|
depend: beforedepend
|
1996-04-30 07:53:58 -07:00
|
|
|
$(CAMLRUN) ./ocamldep $(INCLUDES) *.mli *.ml > .depend
|
1995-05-04 03:15:53 -07:00
|
|
|
|
|
|
|
include .depend
|