1999-11-17 10:59:06 -08:00
|
|
|
|
#########################################################################
|
|
|
|
|
# #
|
|
|
|
|
# Objective Caml #
|
|
|
|
|
# #
|
|
|
|
|
# Damien Doligez, projet Para, 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-11-02 09:55:06 -08:00
|
|
|
|
# The main Makefile
|
|
|
|
|
|
2000-04-05 11:30:22 -07:00
|
|
|
|
MacVersion = "Mac{MAJOR}.{MINOR}.{BUGFIX}{STAGE}{REV}"
|
1996-11-02 09:55:06 -08:00
|
|
|
|
|
|
|
|
|
CAMLC = :boot:ocamlrun :boot:ocamlc -I :boot:
|
1999-11-08 11:03:57 -08:00
|
|
|
|
COMPFLAGS = {INCLUDES}
|
1996-11-02 09:55:06 -08:00
|
|
|
|
LINKFLAGS =
|
|
|
|
|
CAMLYACC = :boot:ocamlyacc
|
1998-07-04 10:32:15 -07:00
|
|
|
|
YACCFLAGS =
|
1996-11-02 09:55:06 -08:00
|
|
|
|
CAMLLEX = :boot:ocamlrun :boot:ocamllex
|
|
|
|
|
CAMLDEP = :boot:ocamlrun :tools:ocamldep
|
|
|
|
|
DEPFLAGS = {INCLUDES}
|
|
|
|
|
CAMLRUN = :byterun:ocamlrun
|
|
|
|
|
|
|
|
|
|
INCLUDES = -I :utils: -I :parsing: -I :typing: -I :bytecomp: <20>
|
|
|
|
|
-I :driver: -I :toplevel:
|
|
|
|
|
|
2000-04-21 01:09:42 -07:00
|
|
|
|
UTILS = :utils:misc.cmo :utils:tbl.cmo :utils:config.cmo <20>
|
1998-11-06 07:10:29 -08:00
|
|
|
|
:utils:clflags.cmo :utils:terminfo.cmo :utils:ccomp.cmo <20>
|
|
|
|
|
:utils:warnings.cmo
|
1996-11-02 09:55:06 -08:00
|
|
|
|
|
1997-02-04 07:40:22 -08:00
|
|
|
|
PARSING = :parsing:linenum.cmo :parsing:location.cmo :parsing:longident.cmo <20>
|
2001-12-13 05:59:27 -08:00
|
|
|
|
:parsing:syntaxerr.cmo :parsing:parser.cmo <20>
|
1999-11-29 11:04:43 -08:00
|
|
|
|
:parsing:lexer.cmo :parsing:parse.cmo :parsing:printast.cmo
|
1996-11-02 09:55:06 -08:00
|
|
|
|
|
|
|
|
|
TYPING = :typing:ident.cmo :typing:path.cmo <20>
|
|
|
|
|
:typing:primitive.cmo :typing:types.cmo <20>
|
1997-04-01 06:51:29 -08:00
|
|
|
|
:typing:btype.cmo <20>
|
1996-11-02 09:55:06 -08:00
|
|
|
|
:typing:subst.cmo :typing:predef.cmo <20>
|
|
|
|
|
:typing:datarepr.cmo :typing:env.cmo <20>
|
|
|
|
|
:typing:typedtree.cmo <20>
|
|
|
|
|
:typing:ctype.cmo :typing:printtyp.cmo <20>
|
1998-07-04 09:51:51 -07:00
|
|
|
|
:typing:includeclass.cmo <20>
|
1996-11-02 09:55:06 -08:00
|
|
|
|
:typing:mtype.cmo :typing:includecore.cmo <20>
|
|
|
|
|
:typing:includemod.cmo :typing:parmatch.cmo <20>
|
|
|
|
|
:typing:typetexp.cmo :typing:typecore.cmo <20>
|
|
|
|
|
:typing:typedecl.cmo :typing:typeclass.cmo <20>
|
|
|
|
|
:typing:typemod.cmo
|
|
|
|
|
|
|
|
|
|
COMP = :bytecomp:lambda.cmo :bytecomp:printlambda.cmo <20>
|
2001-02-28 09:20:27 -08:00
|
|
|
|
:bytecomp:typeopt.cmo :bytecomp:switch.cmo :bytecomp:matching.cmo <20>
|
1998-07-04 09:51:51 -07:00
|
|
|
|
:bytecomp:translobj.cmo :bytecomp:translcore.cmo <20>
|
1996-11-02 09:55:06 -08:00
|
|
|
|
:bytecomp:translclass.cmo :bytecomp:translmod.cmo <20>
|
|
|
|
|
:bytecomp:simplif.cmo :bytecomp:runtimedef.cmo
|
|
|
|
|
|
|
|
|
|
BYTECOMP = :bytecomp:meta.cmo :bytecomp:instruct.cmo :bytecomp:bytegen.cmo <20>
|
|
|
|
|
:bytecomp:printinstr.cmo :bytecomp:opcodes.cmo :bytecomp:emitcode.cmo <20>
|
2001-12-13 05:59:27 -08:00
|
|
|
|
:bytecomp:bytesections.cmo :bytecomp:dll.cmo <20>
|
2002-04-03 23:19:25 -08:00
|
|
|
|
:bytecomp:symtable.cmo :bytecomp:bytelink.cmo :bytecomp:bytelibrarian.cmo
|
1996-11-02 09:55:06 -08:00
|
|
|
|
|
1998-04-06 09:32:10 -07:00
|
|
|
|
DRIVER = :driver:errors.cmo :driver:compile.cmo :driver:main_args.cmo <20>
|
|
|
|
|
:driver:main.cmo
|
1996-11-02 09:55:06 -08:00
|
|
|
|
|
|
|
|
|
TOPLEVEL = :driver:errors.cmo :driver:compile.cmo <20>
|
2000-11-07 05:18:20 -08:00
|
|
|
|
:toplevel:genprintval.cmo :toplevel:toploop.cmo <20>
|
1996-11-02 09:55:06 -08:00
|
|
|
|
:toplevel:trace.cmo :toplevel:topdirs.cmo
|
|
|
|
|
|
|
|
|
|
TOPLEVELMAIN = :toplevel:topmain.cmo
|
|
|
|
|
|
|
|
|
|
COMPOBJS = {UTILS} {PARSING} {TYPING} {COMP} {BYTECOMP} {DRIVER}
|
|
|
|
|
|
|
|
|
|
TOPLIB = {UTILS} {PARSING} {TYPING} {COMP} {BYTECOMP} {TOPLEVEL}
|
|
|
|
|
|
2000-04-21 04:55:31 -07:00
|
|
|
|
EXPUNGEOBJS = :utils:misc.cmo :utils:tbl.cmo <20>
|
1996-11-02 09:55:06 -08:00
|
|
|
|
:utils:config.cmo :utils:clflags.cmo <20>
|
1998-07-04 09:51:51 -07:00
|
|
|
|
:typing:ident.cmo :typing:path.cmo <20>
|
|
|
|
|
:typing:types.cmo :typing:btype.cmo :typing:predef.cmo <20>
|
2001-12-13 05:59:27 -08:00
|
|
|
|
:bytecomp:runtimedef.cmo :bytecomp:bytesections.cmo <20>
|
|
|
|
|
:bytecomp:dll.cmo :bytecomp:symtable.cmo <20>
|
1996-11-02 09:55:06 -08:00
|
|
|
|
:toplevel:expunge.cmo
|
|
|
|
|
|
1999-03-04 15:39:55 -08:00
|
|
|
|
PERVASIVES = arg array buffer callback char digest filename format gc hashtbl <20>
|
1998-04-30 04:07:22 -07:00
|
|
|
|
lexing list map obj parsing pervasives printexc printf queue random <20>
|
|
|
|
|
set sort stack string stream sys oo genlex topdirs toploop weak lazy <20>
|
2001-08-21 11:50:41 -07:00
|
|
|
|
marshal int32 int64 nativeint outcometree
|
1996-11-02 09:55:06 -08:00
|
|
|
|
|
|
|
|
|
# Recompile the system using the bootstrap compiler
|
1998-10-02 06:02:32 -07:00
|
|
|
|
all <EFBFBD> runtime ocamlc ocamllex ocamlyacc ocamltools library ocaml <EFBFBD>
|
2001-12-13 05:59:27 -08:00
|
|
|
|
otherlibraries camlp4out maccaml
|
1996-11-02 09:55:06 -08:00
|
|
|
|
|
|
|
|
|
# The compilation of ocaml will fail if the runtime has changed.
|
|
|
|
|
# Never mind, just do make bootstrap to reach fixpoint again.
|
|
|
|
|
|
|
|
|
|
# Compile everything the first time
|
|
|
|
|
world <EFBFBD>
|
1996-11-06 08:50:08 -08:00
|
|
|
|
domake coldstart
|
|
|
|
|
domake all
|
1996-11-02 09:55:06 -08:00
|
|
|
|
|
|
|
|
|
# Complete bootstrapping cycle
|
|
|
|
|
bootstrap <EFBFBD>
|
1996-11-06 08:50:08 -08:00
|
|
|
|
# Save the original bootstrap compiler
|
|
|
|
|
domake backup
|
|
|
|
|
# Promote the new compiler but keep the old runtime
|
|
|
|
|
# This compiler runs on :boot:ocamlrun and produces bytecode for
|
|
|
|
|
# :byterun:ocamlrun
|
|
|
|
|
domake promote-cross
|
|
|
|
|
# Rebuild ocamlc and ocamllex (run on :byterun:ocamlrun)
|
1997-02-16 05:36:42 -08:00
|
|
|
|
domake partialclean
|
1996-11-06 08:50:08 -08:00
|
|
|
|
domake ocamlc ocamllex
|
|
|
|
|
# Rebuild the library (using :byterun:ocamlrun :ocamlc)
|
|
|
|
|
domake library-cross
|
|
|
|
|
# Promote the new compiler and the new runtime
|
|
|
|
|
domake promote
|
|
|
|
|
# Rebuild everything, including ocaml and the tools
|
1997-02-16 05:36:42 -08:00
|
|
|
|
domake partialclean
|
1996-11-06 08:50:08 -08:00
|
|
|
|
domake all
|
|
|
|
|
# Check if fixpoint reached
|
|
|
|
|
domake compare
|
1996-11-02 09:55:06 -08:00
|
|
|
|
|
|
|
|
|
LIBFILES = :stdlib.cma :std_exit.cmo :<3A>.cmi camlheader
|
|
|
|
|
|
|
|
|
|
# Start up the system from the distribution compiler
|
|
|
|
|
coldstart <EFBFBD>
|
1996-11-06 08:50:08 -08:00
|
|
|
|
directory :byterun; domake all; directory ::
|
|
|
|
|
duplicate -y :byterun:ocamlrun :boot:ocamlrun
|
|
|
|
|
directory :yacc; domake all; directory ::
|
|
|
|
|
duplicate -y :yacc:ocamlyacc :boot:ocamlyacc
|
|
|
|
|
directory :stdlib
|
|
|
|
|
domake -d COMPILER=::boot:ocamlc all
|
|
|
|
|
duplicate -y {LIBFILES} ::boot:
|
|
|
|
|
directory ::
|
1996-11-02 09:55:06 -08:00
|
|
|
|
|
2000-04-05 11:30:22 -07:00
|
|
|
|
# Build the core system: the minimum needed to make depend and bootstrap
|
|
|
|
|
core <EFBFBD> runtime ocamlc ocamllex ocamlyacc ocamltools library
|
|
|
|
|
|
1996-11-02 09:55:06 -08:00
|
|
|
|
# Save the current bootstrap compiler
|
|
|
|
|
backup <EFBFBD>
|
1996-11-06 08:50:08 -08:00
|
|
|
|
if `exists -d :boot:Saved:` == ""
|
|
|
|
|
newfolder :boot:Saved:
|
|
|
|
|
end
|
|
|
|
|
move :boot:Saved: :boot:Saved.prev:
|
|
|
|
|
newfolder :boot:Saved:
|
|
|
|
|
move :boot:Saved.prev: :boot:Saved:Saved.prev:
|
|
|
|
|
duplicate -y :boot:ocamlrun :boot:Saved:
|
|
|
|
|
move :boot:ocamlc :boot:ocamllex :boot:ocamlyacc :boot:Saved:
|
|
|
|
|
directory :boot; duplicate -y {LIBFILES} :Saved:; directory ::
|
1996-11-02 09:55:06 -08:00
|
|
|
|
|
|
|
|
|
# Promote the newly compiled system to the rank of cross compiler
|
|
|
|
|
# (Runs on the old runtime, produces code for the new runtime)
|
|
|
|
|
promote-cross <EFBFBD>
|
1996-11-06 08:50:08 -08:00
|
|
|
|
duplicate -y :ocamlc :boot:ocamlc
|
|
|
|
|
duplicate -y :lex:ocamllex :boot:ocamllex
|
|
|
|
|
duplicate -y :yacc:ocamlyacc :boot:ocamlyacc
|
|
|
|
|
directory :stdlib
|
|
|
|
|
duplicate -y {LIBFILES} ::boot: || set status 0
|
|
|
|
|
directory ::
|
1996-11-02 09:55:06 -08:00
|
|
|
|
|
|
|
|
|
# Promote the newly compiled system to the rank of bootstrap compiler
|
|
|
|
|
# (Runs on the new runtime, produces code for the new runtime)
|
|
|
|
|
promote <EFBFBD> promote-cross
|
1996-11-06 08:50:08 -08:00
|
|
|
|
duplicate -y :byterun:ocamlrun :boot:ocamlrun
|
1996-11-02 09:55:06 -08:00
|
|
|
|
|
1997-02-16 05:36:42 -08:00
|
|
|
|
clean <EFBFBD><EFBFBD>
|
1996-11-25 07:51:17 -08:00
|
|
|
|
delete -i :boot:<3A>.cm[aio] || set status 0
|
|
|
|
|
delete -i :boot:camlheader :boot:ocamlrun :boot:ocamlyacc
|
|
|
|
|
|
1996-11-02 09:55:06 -08:00
|
|
|
|
# Restore the saved bootstrap compiler if a problem arises
|
|
|
|
|
restore <EFBFBD>
|
1996-11-06 08:50:08 -08:00
|
|
|
|
move -y :boot:Saved:<3A> :boot:
|
|
|
|
|
delete -y :boot:Saved:
|
|
|
|
|
move -y :boot:Saved.prev: :boot:Saved:
|
1996-11-02 09:55:06 -08:00
|
|
|
|
|
|
|
|
|
# Check if fixpoint reached
|
|
|
|
|
compare <EFBFBD>
|
1996-11-06 08:50:08 -08:00
|
|
|
|
set exit 0
|
|
|
|
|
equal -q :boot:ocamlc :ocamlc && equal -q :boot:ocamllex :lex:ocamllex
|
|
|
|
|
if {status}
|
|
|
|
|
echo "<22>nFixpoint not reached, try one more bootstrapping cycle.<2E>n"
|
|
|
|
|
else
|
|
|
|
|
echo "<22>nFixpoint reached, bootstrap succeeded.<2E>n"
|
|
|
|
|
end
|
1996-11-02 09:55:06 -08:00
|
|
|
|
|
|
|
|
|
# Remove old bootstrap compilers
|
|
|
|
|
cleanboot <EFBFBD>
|
1996-11-06 08:50:08 -08:00
|
|
|
|
delete -i -y :boot:Saved:Saved.prev:<3A> || set status 0
|
1996-11-02 09:55:06 -08:00
|
|
|
|
|
1998-10-02 06:02:32 -07:00
|
|
|
|
|
1996-11-02 09:55:06 -08:00
|
|
|
|
install <EFBFBD> $OutOfDate
|
1996-11-06 08:50:08 -08:00
|
|
|
|
flush
|
1998-10-02 06:02:32 -07:00
|
|
|
|
for i in "{BINDIR}" "{LIBDIR}" "{APPLIDIR}" "{APPLIDIR}stdlib:"
|
1996-11-06 08:50:08 -08:00
|
|
|
|
if "`exists -d "{i}"`" == ""
|
1996-12-12 02:52:15 -08:00
|
|
|
|
newfolder "{i}"
|
1996-11-06 08:50:08 -08:00
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
directory :byterun:
|
|
|
|
|
domake install
|
|
|
|
|
directory ::
|
|
|
|
|
duplicate -y :ocamlc "{BINDIR}ocamlc"
|
|
|
|
|
duplicate -y :ocaml "{BINDIR}ocaml"
|
|
|
|
|
directory :stdlib:
|
|
|
|
|
domake install
|
|
|
|
|
directory ::
|
|
|
|
|
duplicate -y :lex:ocamllex "{BINDIR}ocamllex"
|
|
|
|
|
duplicate -y :yacc:ocamlyacc "{BINDIR}ocamlyacc"
|
|
|
|
|
duplicate -y toplevellib.cma expunge "{LIBDIR}"
|
2001-08-21 11:50:41 -07:00
|
|
|
|
duplicate -y :typing:outcometree.cmi :typing:outcometree.mli "{LIBDIR}"
|
1996-11-06 08:50:08 -08:00
|
|
|
|
duplicate -y :toplevel:topmain.cmo "{LIBDIR}topmain.cmo"
|
|
|
|
|
duplicate -y :toplevel:toploop.cmi :toplevel:topdirs.cmi "{LIBDIR}"
|
|
|
|
|
directory :tools:
|
|
|
|
|
domake install
|
|
|
|
|
directory ::
|
2001-12-13 05:59:27 -08:00
|
|
|
|
directory :camlp4:
|
|
|
|
|
execute :config:config.mpw
|
|
|
|
|
domake install -d LIBDIR="{LIBDIR}camlp4:"
|
|
|
|
|
directory ::
|
1996-11-06 08:50:08 -08:00
|
|
|
|
duplicate -y :man:ocaml.help "{HELPFILE}"
|
|
|
|
|
for i in {OTHERLIBRARIES}
|
|
|
|
|
directory :otherlibs:{i}
|
|
|
|
|
domake install
|
|
|
|
|
directory :::
|
|
|
|
|
end
|
1998-10-02 06:02:32 -07:00
|
|
|
|
duplicate -y "{LIBDIR}"<EFBFBD> "{APPLIDIR}stdlib:"
|
2000-04-05 11:30:22 -07:00
|
|
|
|
duplicate -y :test:Moretest:graph_example.ml "{APPLIDIR}"
|
1998-10-02 06:02:32 -07:00
|
|
|
|
directory :maccaml:
|
|
|
|
|
domake install
|
|
|
|
|
directory ::
|
1996-11-02 09:55:06 -08:00
|
|
|
|
|
1997-02-16 05:36:42 -08:00
|
|
|
|
clean <EFBFBD><EFBFBD> partialclean
|
1996-11-02 09:55:06 -08:00
|
|
|
|
|
1998-10-02 06:02:32 -07:00
|
|
|
|
|
1996-11-02 09:55:06 -08:00
|
|
|
|
# The compiler
|
|
|
|
|
|
|
|
|
|
ocamlc <EFBFBD> {COMPOBJS}
|
1996-11-06 08:50:08 -08:00
|
|
|
|
{CAMLC} {LINKFLAGS} -o ocamlc {COMPOBJS}
|
1996-11-02 09:55:06 -08:00
|
|
|
|
|
1997-02-16 05:36:42 -08:00
|
|
|
|
partialclean <EFBFBD><EFBFBD>
|
1996-11-06 08:50:08 -08:00
|
|
|
|
delete -i ocamlc
|
1996-11-02 09:55:06 -08:00
|
|
|
|
|
1998-10-02 06:02:32 -07:00
|
|
|
|
|
1996-11-02 09:55:06 -08:00
|
|
|
|
# The toplevel
|
|
|
|
|
|
|
|
|
|
ocaml <EFBFBD> toplevellib.cma {TOPLEVELMAIN} expunge
|
1996-11-06 08:50:08 -08:00
|
|
|
|
{CAMLC} {LINKFLAGS} -linkall -o ocaml.tmp toplevellib.cma {TOPLEVELMAIN}
|
|
|
|
|
{CAMLRUN} :expunge ocaml.tmp ocaml {PERVASIVES} || set status 0
|
|
|
|
|
delete -i ocaml.tmp
|
1996-11-02 09:55:06 -08:00
|
|
|
|
|
|
|
|
|
toplevellib.cma <EFBFBD> {TOPLIB}
|
1996-11-06 08:50:08 -08:00
|
|
|
|
{CAMLC} -a -o toplevellib.cma {TOPLIB}
|
1996-11-02 09:55:06 -08:00
|
|
|
|
|
1997-02-16 05:36:42 -08:00
|
|
|
|
partialclean <EFBFBD><EFBFBD>
|
1996-11-06 08:50:08 -08:00
|
|
|
|
delete -i ocaml toplevellib.cma
|
1996-11-02 09:55:06 -08:00
|
|
|
|
|
1998-10-02 06:02:32 -07:00
|
|
|
|
|
1996-11-02 09:55:06 -08:00
|
|
|
|
# The configuration file
|
|
|
|
|
|
1996-12-12 02:52:15 -08:00
|
|
|
|
:utils:config.ml <20> :utils:config.mlp :config:config.Mac
|
1996-11-06 08:50:08 -08:00
|
|
|
|
delete -i :utils:config.ml
|
|
|
|
|
streamedit -e "/let version =/ replace /<2F><><EFBFBD>"<EFBFBD>/ <20>"/{MacVersion}<7D><><EFBFBD>"<EFBFBD>"" <20>
|
1998-07-04 09:51:51 -07:00
|
|
|
|
-e "1,$ replace /%%BYTERUN%%/ <20>"{BINDIR}ocamlrun<EFBFBD>"" <20>
|
1996-12-12 02:52:15 -08:00
|
|
|
|
-e "1,$ replace /%%LIBDIR%%/ <20>"{LIBDIR}<EFBFBD>"" <20>
|
|
|
|
|
-e "1,$ replace /%%EXT_OBJ%%/ '.o'" <20>
|
|
|
|
|
-e "1,$ replace /%%EXT_LIB%%/ '.x'" <20>
|
|
|
|
|
:utils:config.mlp > :utils:config.ml
|
1996-11-02 09:55:06 -08:00
|
|
|
|
|
1997-02-16 05:36:42 -08:00
|
|
|
|
partialclean <EFBFBD><EFBFBD>
|
1996-11-06 08:50:08 -08:00
|
|
|
|
delete -i :utils:config.ml
|
1996-11-02 09:55:06 -08:00
|
|
|
|
|
|
|
|
|
beforedepend <20><> :utils:config.ml
|
|
|
|
|
|
1998-10-02 06:02:32 -07:00
|
|
|
|
|
1997-02-04 07:40:22 -08:00
|
|
|
|
# The parser
|
1996-11-02 09:55:06 -08:00
|
|
|
|
|
|
|
|
|
:parsing:parser.mli <20> :parsing:parser.ml
|
1996-11-06 08:50:08 -08:00
|
|
|
|
echo -n
|
1996-11-02 09:55:06 -08:00
|
|
|
|
|
|
|
|
|
:parsing:parser.ml <20> :parsing:parser.mly
|
1996-11-06 08:50:08 -08:00
|
|
|
|
{CAMLYACC} {YACCFLAGS} :parsing:parser.mly
|
1996-11-02 09:55:06 -08:00
|
|
|
|
|
1997-02-16 05:36:42 -08:00
|
|
|
|
partialclean <EFBFBD><EFBFBD>
|
1996-11-06 08:50:08 -08:00
|
|
|
|
delete -i :parsing:parser.mli :parsing:parser.ml :parsing:parser.output
|
1996-11-02 09:55:06 -08:00
|
|
|
|
|
|
|
|
|
beforedepend <20><> :parsing:parser.mli :parsing:parser.ml
|
|
|
|
|
|
1998-10-02 06:02:32 -07:00
|
|
|
|
|
1997-02-04 07:40:22 -08:00
|
|
|
|
# The lexer
|
1996-11-02 09:55:06 -08:00
|
|
|
|
|
|
|
|
|
:parsing:lexer.ml <20> :parsing:lexer.mll
|
2000-06-23 08:08:43 -07:00
|
|
|
|
streamedit -e "1,$ replace /<2F><>''\223'<27><>'-<2D><>''\246'<27><>'/ '' -c <20>" <20>
|
|
|
|
|
-e "1,$ replace /<2F><>''\248'<27><>'-<2D><>''\255'<27><>'/ '' -c <20>" <20>
|
|
|
|
|
-e "1,$ replace /<2F><>''\192'<27><>'-<2D><>''\214'<27><>'/ '' -c <20>" <20>
|
|
|
|
|
-e "1,$ replace /<2F><>''\216'<27><>'-<2D><>''\222'<27><>'/ '' -c <20>" <20>
|
|
|
|
|
-e "1,$ replace /<2F><>''\216'<27><>'-<2D><>''\246'<27><>'/ '' -c <20>" <20>
|
|
|
|
|
<:parsing:lexer.mll >:parsing:lexer_tmp.mll
|
|
|
|
|
{CAMLLEX} :parsing:lexer_tmp.mll
|
|
|
|
|
rename -y :parsing:lexer_tmp.ml :parsing:lexer.ml
|
1996-11-02 09:55:06 -08:00
|
|
|
|
|
1997-02-16 05:36:42 -08:00
|
|
|
|
partialclean <EFBFBD><EFBFBD>
|
1996-11-06 08:50:08 -08:00
|
|
|
|
delete -i :parsing:lexer.ml
|
1996-11-02 09:55:06 -08:00
|
|
|
|
|
|
|
|
|
beforedepend <20><> :parsing:lexer.ml
|
|
|
|
|
|
1998-10-02 06:02:32 -07:00
|
|
|
|
|
1997-02-04 07:40:22 -08:00
|
|
|
|
# The auxiliary lexer for counting line numbers
|
|
|
|
|
|
|
|
|
|
:parsing:linenum.ml <20> :parsing:linenum.mll
|
|
|
|
|
{CAMLLEX} :parsing:linenum.mll
|
|
|
|
|
|
1997-02-16 05:36:42 -08:00
|
|
|
|
partialclean <EFBFBD><EFBFBD>
|
1997-02-04 07:40:22 -08:00
|
|
|
|
delete -i :parsing:linenum.ml
|
|
|
|
|
|
|
|
|
|
beforedepend <20><> :parsing:linenum.ml
|
|
|
|
|
|
1998-10-02 06:02:32 -07:00
|
|
|
|
|
1996-11-02 09:55:06 -08:00
|
|
|
|
# The numeric opcodes
|
|
|
|
|
|
|
|
|
|
:bytecomp:opcodes.ml <20> :byterun:instruct.h
|
1996-11-06 08:50:08 -08:00
|
|
|
|
:tools:make-opcodes.Mac :byterun:instruct.h :bytecomp:opcodes.ml
|
1996-11-02 09:55:06 -08:00
|
|
|
|
|
1997-02-16 05:36:42 -08:00
|
|
|
|
partialclean <EFBFBD><EFBFBD>
|
1996-11-06 08:50:08 -08:00
|
|
|
|
delete -i :bytecomp:opcodes.ml
|
1996-11-02 09:55:06 -08:00
|
|
|
|
|
|
|
|
|
beforedepend <20><> :bytecomp:opcodes.ml
|
|
|
|
|
|
1998-10-02 06:02:32 -07:00
|
|
|
|
|
1996-11-02 09:55:06 -08:00
|
|
|
|
# The predefined exceptions and primitives
|
|
|
|
|
|
|
|
|
|
:byterun:primitives <20>
|
1996-11-06 08:50:08 -08:00
|
|
|
|
directory :byterun:
|
|
|
|
|
domake primitives
|
|
|
|
|
directory ::
|
1996-11-02 09:55:06 -08:00
|
|
|
|
|
|
|
|
|
:bytecomp:runtimedef.ml <20> :byterun:primitives :byterun:fail.h
|
1996-11-06 08:50:08 -08:00
|
|
|
|
(echo 'let builtin_exceptions = [|' ; <20>
|
1996-11-02 09:55:06 -08:00
|
|
|
|
streamedit -d -e '/<2F>/<2F>* (<28>"[A-Za-z_]*<2A>")<29>0 <20>*<2A>/<2F>/ print <20>0 ";"' :byterun:fail.h | <20>
|
1996-11-06 08:50:08 -08:00
|
|
|
|
streamedit -e '$ replace /;<3B>/ "|]"'; <20>
|
|
|
|
|
echo 'let builtin_primitives = [|'; <20>
|
|
|
|
|
streamedit -e "1,$ replace /(<28>)<29>0/ ' <20>"' <20>0 '<EFBFBD>";'" -e '$ replace /;<3B>/ "|]"' :byterun:primitives; <20>
|
1996-11-02 09:55:06 -08:00
|
|
|
|
) > :bytecomp:runtimedef.ml
|
|
|
|
|
|
1997-02-16 05:36:42 -08:00
|
|
|
|
partialclean <EFBFBD><EFBFBD>
|
1996-11-06 08:50:08 -08:00
|
|
|
|
delete -i :bytecomp:runtimedef.ml
|
1996-11-02 09:55:06 -08:00
|
|
|
|
|
|
|
|
|
beforedepend <20><> :bytecomp:runtimedef.ml
|
|
|
|
|
|
1998-10-02 06:02:32 -07:00
|
|
|
|
|
1996-11-02 09:55:06 -08:00
|
|
|
|
# The "expunge" utility
|
|
|
|
|
|
|
|
|
|
expunge <EFBFBD> {EXPUNGEOBJS}
|
1996-11-06 08:50:08 -08:00
|
|
|
|
{CAMLC} {LINKFLAGS} -o expunge {EXPUNGEOBJS}
|
1996-11-02 09:55:06 -08:00
|
|
|
|
|
1997-02-16 05:36:42 -08:00
|
|
|
|
partialclean <EFBFBD><EFBFBD>
|
1996-11-06 08:50:08 -08:00
|
|
|
|
delete -i expunge
|
1996-11-02 09:55:06 -08:00
|
|
|
|
|
1998-10-02 06:02:32 -07:00
|
|
|
|
|
1996-11-02 09:55:06 -08:00
|
|
|
|
# The runtime system for the bytecode compiler
|
|
|
|
|
|
|
|
|
|
runtime <EFBFBD>
|
1996-11-06 08:50:08 -08:00
|
|
|
|
directory :byterun:; domake all; directory ::
|
1997-02-16 05:36:42 -08:00
|
|
|
|
clean <EFBFBD><EFBFBD>
|
1996-11-06 08:50:08 -08:00
|
|
|
|
directory :byterun:; domake clean; directory ::
|
1996-11-02 09:55:06 -08:00
|
|
|
|
alldepend <EFBFBD><EFBFBD>
|
1996-11-06 08:50:08 -08:00
|
|
|
|
directory :byterun:; domake depend; directory ::
|
1996-11-02 09:55:06 -08:00
|
|
|
|
|
1998-10-02 06:02:32 -07:00
|
|
|
|
|
1996-11-02 09:55:06 -08:00
|
|
|
|
# The library
|
|
|
|
|
|
1998-07-04 09:51:51 -07:00
|
|
|
|
library <EFBFBD> ocamlc
|
1996-11-06 08:50:08 -08:00
|
|
|
|
directory :stdlib; domake all; directory ::
|
1996-11-02 09:55:06 -08:00
|
|
|
|
library-cross <EFBFBD>
|
1996-11-06 08:50:08 -08:00
|
|
|
|
directory :stdlib; domake -d RUNTIME=::byterun:ocamlrun all; directory ::
|
1997-02-16 05:36:42 -08:00
|
|
|
|
partialclean <EFBFBD><EFBFBD>
|
1996-11-06 08:50:08 -08:00
|
|
|
|
directory :stdlib; domake clean; directory ::
|
1996-11-02 09:55:06 -08:00
|
|
|
|
alldepend <EFBFBD><EFBFBD>
|
1996-11-06 08:50:08 -08:00
|
|
|
|
directory :stdlib; domake depend; directory ::
|
1996-11-02 09:55:06 -08:00
|
|
|
|
|
1998-10-02 06:02:32 -07:00
|
|
|
|
|
1996-11-02 09:55:06 -08:00
|
|
|
|
# The lexer and parser generators
|
|
|
|
|
|
1998-07-04 09:51:51 -07:00
|
|
|
|
ocamllex <EFBFBD> ocamlyacc ocamlc
|
1996-11-06 08:50:08 -08:00
|
|
|
|
directory :lex; domake all; directory ::
|
1997-02-16 05:36:42 -08:00
|
|
|
|
partialclean <EFBFBD><EFBFBD>
|
1996-11-06 08:50:08 -08:00
|
|
|
|
directory :lex; domake clean; directory ::
|
1996-11-02 09:55:06 -08:00
|
|
|
|
alldepend <EFBFBD><EFBFBD>
|
1996-11-06 08:50:08 -08:00
|
|
|
|
directory :lex; domake depend; directory ::
|
1996-11-02 09:55:06 -08:00
|
|
|
|
|
|
|
|
|
ocamlyacc <EFBFBD>
|
1996-11-06 08:50:08 -08:00
|
|
|
|
directory :yacc; domake all; directory ::
|
1997-02-16 05:36:42 -08:00
|
|
|
|
clean <EFBFBD><EFBFBD>
|
1996-11-06 08:50:08 -08:00
|
|
|
|
directory :yacc; domake clean; directory ::
|
1996-11-02 09:55:06 -08:00
|
|
|
|
|
1998-10-02 06:02:32 -07:00
|
|
|
|
|
1996-11-02 09:55:06 -08:00
|
|
|
|
# Tools
|
|
|
|
|
|
1998-07-04 09:51:51 -07:00
|
|
|
|
ocamltools <EFBFBD> ocamlc ocamlyacc ocamllex
|
1996-11-06 08:50:08 -08:00
|
|
|
|
directory :tools; domake all; directory ::
|
1997-02-16 05:36:42 -08:00
|
|
|
|
partialclean <EFBFBD><EFBFBD>
|
1996-11-06 08:50:08 -08:00
|
|
|
|
directory :tools; domake clean; directory ::
|
1996-11-02 09:55:06 -08:00
|
|
|
|
alldepend <EFBFBD><EFBFBD>
|
1996-11-06 08:50:08 -08:00
|
|
|
|
directory :tools; domake depend; directory ::
|
1996-11-02 09:55:06 -08:00
|
|
|
|
|
1998-10-02 06:02:32 -07:00
|
|
|
|
|
1996-11-02 09:55:06 -08:00
|
|
|
|
# The extra libraries
|
|
|
|
|
|
|
|
|
|
otherlibraries <EFBFBD>
|
1996-11-06 08:50:08 -08:00
|
|
|
|
for i in {OTHERLIBRARIES}
|
|
|
|
|
directory :otherlibs:{i}; domake all; directory :::
|
|
|
|
|
end
|
1997-02-16 05:36:42 -08:00
|
|
|
|
partialclean <EFBFBD><EFBFBD>
|
1996-11-06 08:50:08 -08:00
|
|
|
|
for i in {OTHERLIBRARIES}
|
1997-02-16 05:36:42 -08:00
|
|
|
|
directory :otherlibs:{i}; domake partialclean; directory :::
|
1996-11-06 08:50:08 -08:00
|
|
|
|
end
|
1997-02-16 05:36:42 -08:00
|
|
|
|
clean <EFBFBD><EFBFBD>
|
1996-11-06 08:50:08 -08:00
|
|
|
|
for i in {OTHERLIBRARIES}
|
1997-02-16 05:36:42 -08:00
|
|
|
|
directory :otherlibs:{i}; domake clean; directory :::
|
1996-11-06 08:50:08 -08:00
|
|
|
|
end
|
1996-11-02 09:55:06 -08:00
|
|
|
|
alldepend <EFBFBD><EFBFBD>
|
1996-11-06 08:50:08 -08:00
|
|
|
|
for i in {OTHERLIBRARIES}
|
|
|
|
|
directory :otherlibs:{i}; domake depend; directory :::
|
|
|
|
|
end
|
|
|
|
|
|
1998-10-02 06:02:32 -07:00
|
|
|
|
|
2001-12-13 05:59:27 -08:00
|
|
|
|
# Camlp4
|
|
|
|
|
|
|
|
|
|
camlp4out <EFBFBD> ocamlc
|
|
|
|
|
directory :camlp4:
|
|
|
|
|
execute :config:config.mpw
|
|
|
|
|
domake all
|
|
|
|
|
directory ::
|
|
|
|
|
|
|
|
|
|
partialclean <EFBFBD><EFBFBD>
|
|
|
|
|
directory :camlp4:
|
|
|
|
|
execute :config:config.mpw
|
|
|
|
|
domake clean
|
|
|
|
|
directory ::
|
|
|
|
|
|
|
|
|
|
alldepend <EFBFBD><EFBFBD>
|
|
|
|
|
directory :camlp4:
|
|
|
|
|
execute :config:config.mpw
|
|
|
|
|
domake depend
|
|
|
|
|
directory ::
|
|
|
|
|
|
1998-10-02 06:02:32 -07:00
|
|
|
|
# The standalone application
|
|
|
|
|
|
|
|
|
|
maccaml <EFBFBD>
|
|
|
|
|
directory :maccaml:; domake all; directory ::
|
1998-11-06 07:10:29 -08:00
|
|
|
|
partialclean <EFBFBD><EFBFBD>
|
|
|
|
|
directory :maccaml:; domake partialclean; directory ::
|
1998-10-02 06:02:32 -07:00
|
|
|
|
clean <EFBFBD><EFBFBD>
|
|
|
|
|
directory :maccaml:; domake clean; directory ::
|
|
|
|
|
alldepend <EFBFBD><EFBFBD>
|
|
|
|
|
directory :maccaml:; domake depend; directory ::
|
|
|
|
|
|
|
|
|
|
|
1996-11-06 08:50:08 -08:00
|
|
|
|
# Clean up the test directory
|
|
|
|
|
|
|
|
|
|
clean <EFBFBD><EFBFBD>
|
1998-10-02 06:02:32 -07:00
|
|
|
|
if `exists :test:`
|
|
|
|
|
directory :test:; domake clean; directory ::
|
1997-03-13 08:24:05 -08:00
|
|
|
|
end
|
1996-11-02 09:55:06 -08:00
|
|
|
|
|
1998-10-02 06:02:32 -07:00
|
|
|
|
|
1996-11-02 09:55:06 -08:00
|
|
|
|
# Default rules
|
|
|
|
|
|
|
|
|
|
.cmo <EFBFBD> .ml
|
1996-11-06 08:50:08 -08:00
|
|
|
|
{CAMLC} {COMPFLAGS} -c {depdir}{default}.ml
|
1996-11-02 09:55:06 -08:00
|
|
|
|
|
|
|
|
|
.cmi <EFBFBD> .mli
|
1996-11-06 08:50:08 -08:00
|
|
|
|
{CAMLC} {COMPFLAGS} -c {depdir}{default}.mli
|
1996-11-02 09:55:06 -08:00
|
|
|
|
|
1997-02-16 05:36:42 -08:00
|
|
|
|
partialclean <EFBFBD><EFBFBD>
|
1996-11-06 08:50:08 -08:00
|
|
|
|
for i in utils parsing typing bytecomp driver toplevel tools
|
|
|
|
|
delete -i :{i}:<3A>.cm[io] || set status 0
|
|
|
|
|
end
|
1996-11-02 09:55:06 -08:00
|
|
|
|
|
|
|
|
|
depend <EFBFBD> beforedepend
|
1996-11-06 08:50:08 -08:00
|
|
|
|
for d in utils parsing typing bytecomp driver toplevel
|
1996-11-02 09:55:06 -08:00
|
|
|
|
{CAMLDEP} {DEPFLAGS} :{d}:<3A>.mli :{d}:<3A>.ml
|
|
|
|
|
end > Makefile.Mac.depend
|
|
|
|
|
|
|
|
|
|
alldepend <EFBFBD><EFBFBD> depend
|
1996-11-06 08:50:08 -08:00
|
|
|
|
|
1998-10-02 06:02:32 -07:00
|
|
|
|
|
1996-11-06 08:50:08 -08:00
|
|
|
|
# Make sure the config file was executed
|
|
|
|
|
dummy <EFBFBD> {OTHERLIBRARIES}
|