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$
|
|
|
|
|
2002-06-07 02:49:45 -07:00
|
|
|
include ../config/Makefile
|
|
|
|
|
|
|
|
CAMLRUN=../boot/ocamlrun
|
|
|
|
CAMLC=$(CAMLRUN) ../boot/ocamlc -I ../boot
|
|
|
|
CAMLOPT=$(CAMLRUN) ../ocamlopt
|
|
|
|
CAMLLEX=$(CAMLRUN) ../boot/ocamllex
|
|
|
|
INCLUDES=-I ../utils -I ../parsing -I ../typing -I ../bytecomp -I ../asmcomp \
|
|
|
|
-I ../driver
|
1996-02-21 02:49:46 -08:00
|
|
|
COMPFLAGS=$(INCLUDES)
|
|
|
|
LINKFLAGS=$(INCLUDES)
|
|
|
|
|
1999-03-14 05:14:35 -08:00
|
|
|
all: ocamldep ocamlprof ocamlcp.exe ocamlmktop.exe primreq
|
1996-02-21 02:49:46 -08:00
|
|
|
|
2002-03-18 08:44:54 -08:00
|
|
|
opt.opt: depend.cmx
|
|
|
|
|
1996-02-21 02:49:46 -08:00
|
|
|
# The dependency generator
|
|
|
|
|
2002-03-18 07:08:53 -08:00
|
|
|
CAMLDEP=depend.cmo ocamldep.cmo
|
2000-04-21 01:13:22 -07:00
|
|
|
CAMLDEP_IMPORTS=misc.cmo config.cmo clflags.cmo terminfo.cmo \
|
2001-09-10 08:26:29 -07:00
|
|
|
linenum.cmo warnings.cmo location.cmo longident.cmo \
|
1999-02-12 08:29:36 -08:00
|
|
|
syntaxerr.cmo parser.cmo lexer.cmo parse.cmo
|
1996-02-21 02:49:46 -08:00
|
|
|
|
2002-03-18 07:08:53 -08:00
|
|
|
ocamldep: depend.cmi $(CAMLDEP)
|
1999-02-12 08:29:36 -08:00
|
|
|
$(CAMLC) $(LINKFLAGS) -o ocamldep $(CAMLDEP_IMPORTS) $(CAMLDEP)
|
1996-02-21 02:49:46 -08:00
|
|
|
|
2002-03-18 08:44:54 -08:00
|
|
|
depend.cmx: depend.ml
|
2002-03-19 01:36:24 -08:00
|
|
|
$(CAMLOPT) $(INCLUDES) -I ../stdlib depend.ml
|
2002-03-18 08:44:54 -08:00
|
|
|
|
1996-02-21 02:49:46 -08:00
|
|
|
clean::
|
1996-04-30 07:53:58 -07:00
|
|
|
rm -f ocamldep
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
install::
|
2002-06-07 02:49:45 -07:00
|
|
|
cp ocamldep $(BINDIR)/ocamldep.exe
|
1996-02-21 02:49:46 -08:00
|
|
|
|
1996-10-07 06:20:28 -07:00
|
|
|
beforedepend:: ocamldep.ml
|
1996-02-21 02:49:46 -08: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-10 08:26:29 -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
|
1996-02-21 02:49:46 -08:00
|
|
|
|
1996-04-30 07:53:58 -07:00
|
|
|
ocamlprof: $(CSLPROF) profiling.cmo
|
|
|
|
$(CAMLC) $(LINKFLAGS) -o ocamlprof $(CSLPROF_IMPORTS) $(CSLPROF)
|
1996-02-21 02:49:46 -08:00
|
|
|
|
1996-04-30 07:53:58 -07:00
|
|
|
ocamlcp.exe: ocamlcp.cmo
|
1998-04-06 09:34:56 -07:00
|
|
|
$(CAMLC) $(LINKFLAGS) -o ocamlcp.exe main_args.cmo ocamlcp.cmo
|
1996-03-05 01:57:50 -08:00
|
|
|
|
1996-02-21 02:49:46 -08:00
|
|
|
install::
|
2002-06-07 02:49:45 -07:00
|
|
|
cp ocamlprof $(BINDIR)/ocamlprof.exe
|
|
|
|
cp ocamlcp.exe $(BINDIR)/ocamlcp.exe
|
1996-02-21 02:49:46 -08:00
|
|
|
cp profiling.cmi profiling.cmo $(LIBDIR)
|
|
|
|
|
|
|
|
clean::
|
1996-04-30 07:53:58 -07:00
|
|
|
rm -f ocamlprof ocamlcp.exe
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
# To make custom toplevels
|
|
|
|
|
1996-04-30 07:53:58 -07:00
|
|
|
ocamlmktop.exe: ocamlmktop.cmo
|
|
|
|
$(CAMLC) $(LINKFLAGS) -o ocamlmktop.exe ocamlmktop.cmo
|
1996-03-05 01:57:50 -08:00
|
|
|
|
1996-02-21 02:49:46 -08:00
|
|
|
install::
|
2002-06-07 02:49:45 -07:00
|
|
|
cp ocamlmktop.exe $(BINDIR)/ocamlmktop.exe
|
1996-03-05 01:57:50 -08:00
|
|
|
|
|
|
|
clean::
|
1996-04-30 07:53:58 -07:00
|
|
|
rm -f ocamlmktop.exe
|
1996-02-21 02:49:46 -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)
|
|
|
|
|
|
|
|
clean::
|
|
|
|
rm -f cvt_emit
|
|
|
|
|
|
|
|
cvt_emit.ml: cvt_emit.mll
|
|
|
|
$(CAMLLEX) cvt_emit.mll
|
|
|
|
|
|
|
|
clean::
|
|
|
|
rm -f cvt_emit.ml
|
|
|
|
|
|
|
|
beforedepend:: cvt_emit.ml
|
|
|
|
|
1996-02-21 02:49:46 -08:00
|
|
|
# The bytecode disassembler
|
|
|
|
|
|
|
|
DUMPOBJ=opnames.cmo dumpobj.cmo
|
|
|
|
|
|
|
|
dumpobj: $(DUMPOBJ)
|
2000-03-16 05:35:20 -08:00
|
|
|
$(CAMLC) $(LINKFLAGS) -o dumpobj \
|
2000-04-21 01:13:22 -07:00
|
|
|
misc.cmo tbl.cmo config.cmo ident.cmo \
|
2000-03-16 05:35:20 -08:00
|
|
|
opcodes.cmo bytesections.cmo $(DUMPOBJ)
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
clean::
|
|
|
|
rm -f dumpobj
|
|
|
|
|
2002-06-07 02:49:45 -07:00
|
|
|
opnames.ml: ../byterun/instruct.h
|
|
|
|
sed -e '////*/d' \
|
|
|
|
-e 's/enum /(.*/) {/let names_of_/1 = [|/' \
|
1996-02-21 02:49:46 -08:00
|
|
|
-e 's/};$$/ |]/' \
|
2002-06-07 02:49:45 -07:00
|
|
|
-e 's//([A-Z][A-Z_0-9a-z]*/)/"/1"/g' \
|
1996-02-21 02:49:46 -08:00
|
|
|
-e 's/,/;/g' \
|
2002-06-07 02:49:45 -07:00
|
|
|
../byterun/instruct.h > opnames.ml
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
clean::
|
|
|
|
rm -f opnames.ml
|
|
|
|
|
|
|
|
beforedepend:: opnames.ml
|
|
|
|
|
|
|
|
# Dump .cmx files
|
|
|
|
|
|
|
|
dumpapprox: dumpapprox.cmo
|
|
|
|
$(CAMLC) $(LINKFLAGS) -o dumpapprox config.cmo dumpapprox.cmo
|
|
|
|
|
|
|
|
clean::
|
|
|
|
rm -f dumpapprox
|
|
|
|
|
|
|
|
# Print imported interfaces for .cmo files
|
|
|
|
|
|
|
|
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
|
|
|
|
|
1996-02-21 02:49:46 -08:00
|
|
|
# Common stuff
|
|
|
|
|
|
|
|
.SUFFIXES:
|
|
|
|
.SUFFIXES: .ml .cmo .mli .cmi
|
|
|
|
|
|
|
|
.ml.cmo:
|
|
|
|
$(CAMLC) -c $(COMPFLAGS) $<
|
|
|
|
|
|
|
|
.mli.cmi:
|
|
|
|
$(CAMLC) -c $(COMPFLAGS) $<
|
|
|
|
|
|
|
|
clean::
|
|
|
|
rm -f *.cmo *.cmi
|
|
|
|
|
|
|
|
depend: beforedepend
|
2002-06-07 02:49:45 -07:00
|
|
|
$(CAMLRUN) ./ocamldep $(INCLUDES) *.mli *.ml > .depend
|
1996-02-21 02:49:46 -08:00
|
|
|
|
2002-06-07 02:49:45 -07:00
|
|
|
include .depend
|