1999-11-17 10:59:06 -08:00
|
|
|
#########################################################################
|
|
|
|
# #
|
2011-07-27 07:17:02 -07:00
|
|
|
# OCaml #
|
1999-11-17 10:59:06 -08:00
|
|
|
# #
|
|
|
|
# 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. #
|
|
|
|
# #
|
|
|
|
#########################################################################
|
|
|
|
|
1996-02-21 02:49:46 -08:00
|
|
|
# The main Makefile
|
|
|
|
|
2002-06-07 02:49:45 -07:00
|
|
|
include config/Makefile
|
2002-11-17 08:42:12 -08:00
|
|
|
include stdlib/StdlibModules
|
1996-02-21 02:49:46 -08:00
|
|
|
|
2010-05-19 07:52:34 -07:00
|
|
|
CAMLC=boot/ocamlrun boot/ocamlc -nostdlib -I boot
|
|
|
|
CAMLOPT=boot/ocamlrun ./ocamlopt -nostdlib -I stdlib -I otherlibs/dynlink
|
|
|
|
COMPFLAGS=-strict-sequence -warn-error A $(INCLUDES)
|
1996-02-21 02:49:46 -08:00
|
|
|
LINKFLAGS=
|
2002-06-07 02:49:45 -07:00
|
|
|
CAMLYACC=boot/ocamlyacc
|
1996-02-21 02:49:46 -08:00
|
|
|
YACCFLAGS=
|
2002-06-07 02:49:45 -07:00
|
|
|
CAMLLEX=boot/ocamlrun boot/ocamllex
|
|
|
|
CAMLDEP=boot/ocamlrun tools/ocamldep
|
1996-02-21 02:49:46 -08:00
|
|
|
DEPFLAGS=$(INCLUDES)
|
2002-06-07 02:49:45 -07:00
|
|
|
CAMLRUN=byterun/ocamlrun
|
1996-02-21 02:49:46 -08:00
|
|
|
|
2012-04-04 05:56:49 -07:00
|
|
|
CAMLP4OUT=$(CAMLP4:=out)
|
|
|
|
CAMLP4OPT=$(CAMLP4:=opt)
|
|
|
|
|
2008-01-11 08:13:18 -08:00
|
|
|
INCLUDES=-I utils -I parsing -I typing -I bytecomp -I asmcomp -I driver \
|
2010-01-22 04:48:24 -08:00
|
|
|
-I toplevel
|
1996-02-21 02:49:46 -08:00
|
|
|
|
2002-06-07 02:49:45 -07:00
|
|
|
UTILS=utils/misc.cmo utils/tbl.cmo utils/config.cmo \
|
2003-03-24 07:23:50 -08:00
|
|
|
utils/clflags.cmo utils/terminfo.cmo utils/ccomp.cmo utils/warnings.cmo \
|
|
|
|
utils/consistbl.cmo
|
1996-02-21 02:49:46 -08:00
|
|
|
|
2011-09-15 06:38:45 -07:00
|
|
|
PARSING=parsing/location.cmo parsing/longident.cmo \
|
2002-06-07 02:49:45 -07:00
|
|
|
parsing/syntaxerr.cmo parsing/parser.cmo \
|
2012-10-17 08:50:07 -07:00
|
|
|
parsing/lexer.cmo parsing/parse.cmo parsing/printast.cmo \
|
2013-01-16 08:10:29 -08:00
|
|
|
parsing/pprintast.cmo \
|
|
|
|
parsing/ast_mapper.cmo
|
2002-06-07 02:49:45 -07:00
|
|
|
|
2012-01-18 10:50:31 -08:00
|
|
|
TYPING=typing/ident.cmo typing/path.cmo \
|
2002-06-07 02:49:45 -07:00
|
|
|
typing/primitive.cmo typing/types.cmo \
|
|
|
|
typing/btype.cmo typing/oprint.cmo \
|
|
|
|
typing/subst.cmo typing/predef.cmo \
|
2012-05-30 07:52:37 -07:00
|
|
|
typing/datarepr.cmo typing/cmi_format.cmo typing/env.cmo \
|
2012-10-02 02:46:39 -07:00
|
|
|
typing/typedtree.cmo typing/printtyped.cmo typing/ctype.cmo \
|
2002-06-07 02:49:45 -07:00
|
|
|
typing/printtyp.cmo typing/includeclass.cmo \
|
2012-07-12 04:02:18 -07:00
|
|
|
typing/mtype.cmo typing/envaux.cmo typing/includecore.cmo \
|
2012-10-02 02:46:39 -07:00
|
|
|
typing/includemod.cmo typing/typetexp.cmo typing/parmatch.cmo \
|
2012-07-12 04:02:18 -07:00
|
|
|
typing/typedtreeIter.cmo typing/typedtreeMap.cmo typing/cmt_format.cmo \
|
|
|
|
typing/stypes.cmo typing/typecore.cmo \
|
2002-06-07 02:49:45 -07:00
|
|
|
typing/typedecl.cmo typing/typeclass.cmo \
|
|
|
|
typing/typemod.cmo
|
|
|
|
|
|
|
|
COMP=bytecomp/lambda.cmo bytecomp/printlambda.cmo \
|
|
|
|
bytecomp/typeopt.cmo bytecomp/switch.cmo bytecomp/matching.cmo \
|
|
|
|
bytecomp/translobj.cmo bytecomp/translcore.cmo \
|
|
|
|
bytecomp/translclass.cmo bytecomp/translmod.cmo \
|
2012-05-29 03:48:19 -07:00
|
|
|
bytecomp/simplif.cmo bytecomp/runtimedef.cmo \
|
|
|
|
driver/pparse.cmo driver/main_args.cmo
|
|
|
|
|
|
|
|
COMMON=$(UTILS) $(PARSING) $(TYPING) $(COMP)
|
2002-06-07 02:49:45 -07:00
|
|
|
|
|
|
|
BYTECOMP=bytecomp/meta.cmo bytecomp/instruct.cmo bytecomp/bytegen.cmo \
|
|
|
|
bytecomp/printinstr.cmo bytecomp/opcodes.cmo bytecomp/emitcode.cmo \
|
|
|
|
bytecomp/bytesections.cmo bytecomp/dll.cmo bytecomp/symtable.cmo \
|
2012-05-29 03:48:19 -07:00
|
|
|
bytecomp/bytelink.cmo bytecomp/bytelibrarian.cmo bytecomp/bytepackager.cmo \
|
|
|
|
driver/errors.cmo driver/compile.cmo
|
2002-06-07 02:49:45 -07:00
|
|
|
|
2007-01-29 04:11:18 -08:00
|
|
|
ASMCOMP=asmcomp/arch.cmo asmcomp/debuginfo.cmo \
|
|
|
|
asmcomp/cmm.cmo asmcomp/printcmm.cmo \
|
2002-06-07 02:49:45 -07:00
|
|
|
asmcomp/reg.cmo asmcomp/mach.cmo asmcomp/proc.cmo \
|
2012-10-02 02:46:39 -07:00
|
|
|
asmcomp/clambda.cmo asmcomp/printclambda.cmo asmcomp/compilenv.cmo \
|
2002-06-07 02:49:45 -07:00
|
|
|
asmcomp/closure.cmo asmcomp/cmmgen.cmo \
|
|
|
|
asmcomp/printmach.cmo asmcomp/selectgen.cmo asmcomp/selection.cmo \
|
|
|
|
asmcomp/comballoc.cmo asmcomp/liveness.cmo \
|
|
|
|
asmcomp/spill.cmo asmcomp/split.cmo \
|
|
|
|
asmcomp/interf.cmo asmcomp/coloring.cmo \
|
|
|
|
asmcomp/reloadgen.cmo asmcomp/reload.cmo \
|
|
|
|
asmcomp/printlinear.cmo asmcomp/linearize.cmo \
|
|
|
|
asmcomp/schedgen.cmo asmcomp/scheduling.cmo \
|
|
|
|
asmcomp/emitaux.cmo asmcomp/emit.cmo asmcomp/asmgen.cmo \
|
2012-05-29 03:48:19 -07:00
|
|
|
asmcomp/asmlink.cmo asmcomp/asmlibrarian.cmo asmcomp/asmpackager.cmo \
|
|
|
|
driver/opterrors.cmo driver/optcompile.cmo
|
2002-06-07 02:49:45 -07:00
|
|
|
|
2012-05-29 03:48:19 -07:00
|
|
|
TOPLEVEL=toplevel/genprintval.cmo toplevel/toploop.cmo \
|
2002-06-07 02:49:45 -07:00
|
|
|
toplevel/trace.cmo toplevel/topdirs.cmo toplevel/topmain.cmo
|
|
|
|
|
2012-05-29 03:48:19 -07:00
|
|
|
BYTESTART=driver/main.cmo
|
1996-02-21 02:49:46 -08:00
|
|
|
|
2012-05-29 03:48:19 -07:00
|
|
|
OPTSTART=driver/optmain.cmo
|
2007-11-06 07:16:56 -08:00
|
|
|
|
2012-05-29 03:48:19 -07:00
|
|
|
TOPLEVELSTART=toplevel/topstart.cmo
|
1996-02-21 02:49:46 -08:00
|
|
|
|
2012-10-02 02:46:39 -07:00
|
|
|
PERVASIVES=$(STDLIB_MODULES) outcometree topdirs toploop
|
2002-11-22 07:10:40 -08:00
|
|
|
|
2001-12-03 02:13:14 -08:00
|
|
|
# For users who don't read the INSTALL file
|
|
|
|
defaultentry:
|
|
|
|
@echo "Please refer to the installation instructions in file README.win32."
|
|
|
|
|
1996-02-21 02:49:46 -08:00
|
|
|
# Recompile the system using the bootstrap compiler
|
2012-04-04 05:56:49 -07:00
|
|
|
all: runtime ocamlc ocamllex ocamlyacc ocamltools library ocaml \
|
2012-05-30 07:52:37 -07:00
|
|
|
otherlibraries ocamldoc.byte ocamlbuild.byte $(CAMLP4OUT) $(DEBUGGER)
|
1996-02-21 02:49:46 -08:00
|
|
|
|
1996-04-30 07:53:58 -07:00
|
|
|
# The compilation of ocaml will fail if the runtime has changed.
|
1996-02-21 02:49:46 -08:00
|
|
|
# Never mind, just do make bootstrap to reach fixpoint again.
|
|
|
|
|
|
|
|
# Compile everything the first time
|
1997-02-16 05:36:42 -08:00
|
|
|
world: coldstart all
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
# Complete bootstrapping cycle
|
|
|
|
bootstrap:
|
|
|
|
# Save the original bootstrap compiler
|
|
|
|
$(MAKEREC) backup
|
|
|
|
# Promote the new compiler but keep the old runtime
|
2002-06-07 02:49:45 -07:00
|
|
|
# This compiler runs on boot/ocamlrun and produces bytecode for byterun/ocamlrun
|
1996-02-21 02:49:46 -08:00
|
|
|
$(MAKEREC) promote-cross
|
2002-06-07 02:49:45 -07:00
|
|
|
# Rebuild ocamlc and ocamllex (run on byterun/ocamlrun)
|
1997-02-16 05:36:42 -08:00
|
|
|
$(MAKEREC) partialclean
|
2007-10-08 07:19:34 -07:00
|
|
|
$(MAKEREC) ocamlc ocamllex ocamltools
|
2002-06-07 02:49:45 -07:00
|
|
|
# Rebuild the library (using byterun/ocamlrun ./ocamlc)
|
1996-02-21 02:49:46 -08:00
|
|
|
$(MAKEREC) library-cross
|
|
|
|
# Promote the new compiler and the new runtime
|
|
|
|
$(MAKEREC) promote
|
1996-04-30 07:53:58 -07:00
|
|
|
# Rebuild everything, including ocaml and the tools
|
1997-02-16 05:36:42 -08:00
|
|
|
$(MAKEREC) partialclean
|
1996-02-21 02:49:46 -08:00
|
|
|
$(MAKEREC) all
|
|
|
|
# Check if fixpoint reached
|
|
|
|
$(MAKEREC) compare
|
|
|
|
|
1996-05-07 06:08:11 -07:00
|
|
|
LIBFILES=stdlib.cma std_exit.cmo *.cmi camlheader
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
# Start up the system from the distribution compiler
|
|
|
|
coldstart:
|
2002-06-07 02:49:45 -07:00
|
|
|
cd byterun ; $(MAKEREC) all
|
|
|
|
cp byterun/ocamlrun.exe boot/ocamlrun.exe
|
|
|
|
cd yacc ; $(MAKEREC) all
|
|
|
|
cp yacc/ocamlyacc.exe boot/ocamlyacc.exe
|
|
|
|
cd stdlib ; $(MAKEREC) COMPILER=../boot/ocamlc all
|
|
|
|
cd stdlib ; cp $(LIBFILES) ../boot
|
1996-02-21 02:49:46 -08:00
|
|
|
|
2000-04-05 11:30:22 -07:00
|
|
|
# Build the core system: the minimum needed to make depend and bootstrap
|
|
|
|
core : runtime ocamlc ocamllex ocamlyacc ocamltools library
|
|
|
|
|
1996-02-21 02:49:46 -08:00
|
|
|
# Save the current bootstrap compiler
|
2002-06-07 02:49:45 -07:00
|
|
|
MAXSAVED=boot/Saved/Saved.prev/Saved.prev/Saved.prev/Saved.prev/Saved.prev
|
1996-02-21 02:49:46 -08:00
|
|
|
backup:
|
2002-06-07 06:31:21 -07:00
|
|
|
mkdir -p boot/Saved
|
|
|
|
if test -d $(MAXSAVED); then rm -r $(MAXSAVED); fi
|
2002-06-07 02:49:45 -07:00
|
|
|
mv boot/Saved boot/Saved.prev
|
|
|
|
mkdir boot/Saved
|
|
|
|
mv boot/Saved.prev boot/Saved/Saved.prev
|
|
|
|
cp boot/ocamlrun.exe boot/Saved/ocamlrun.exe
|
2007-10-08 07:19:34 -07:00
|
|
|
cd boot ; mv ocamlc ocamllex ocamldep ocamlyacc.exe Saved
|
2002-06-07 02:49:45 -07:00
|
|
|
cd boot ; cp $(LIBFILES) Saved
|
1996-02-21 02:49:46 -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:
|
2002-06-07 02:49:45 -07:00
|
|
|
cp ocamlc boot/ocamlc
|
|
|
|
cp lex/ocamllex boot/ocamllex
|
|
|
|
cp yacc/ocamlyacc.exe boot/ocamlyacc.exe
|
2007-10-08 07:19:34 -07:00
|
|
|
cp tools/ocamldep boot/ocamldep
|
2002-06-07 02:49:45 -07:00
|
|
|
cd stdlib ; cp $(LIBFILES) ../boot
|
1996-02-21 02:49:46 -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: promote-cross
|
2002-06-07 02:49:45 -07:00
|
|
|
cp byterun/ocamlrun.exe boot/ocamlrun.exe
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
# Restore the saved bootstrap compiler if a problem arises
|
|
|
|
restore:
|
2002-06-07 02:49:45 -07:00
|
|
|
cd boot/Saved ; mv * ..
|
|
|
|
rmdir boot/Saved
|
|
|
|
mv boot/Saved.prev boot/Saved
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
# Check if fixpoint reached
|
|
|
|
compare:
|
2000-03-16 05:35:20 -08:00
|
|
|
- cmp -i 4096 boot/ocamlc ocamlc
|
|
|
|
- cmp -i 4096 boot/ocamllex lex/ocamllex
|
2007-10-08 07:19:34 -07:00
|
|
|
- cmp -i 4096 boot/ocamldep tools/ocamldep
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
# Remove old bootstrap compilers
|
|
|
|
cleanboot:
|
2002-06-07 02:49:45 -07:00
|
|
|
rm -rf boot/Saved/Saved.prev/*
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
# Compile the native-code compiler
|
2010-05-28 04:21:46 -07:00
|
|
|
opt-core: runtimeopt ocamlopt libraryopt
|
|
|
|
opt: opt-core otherlibrariesopt ocamlbuildlib.native
|
1996-02-21 02:49:46 -08:00
|
|
|
|
2000-08-30 18:10:14 -07:00
|
|
|
# Native-code versions of the tools
|
2010-05-28 04:21:46 -07:00
|
|
|
opt.opt: core opt-core ocamlc.opt all ocamlopt.opt ocamllex.opt \
|
2012-02-10 01:08:02 -08:00
|
|
|
ocamltoolsopt.opt ocamlbuild.native $(CAMLP4OPT) ocamldoc.opt
|
2010-05-28 04:21:46 -07:00
|
|
|
|
|
|
|
# Complete build using fast compilers
|
|
|
|
world.opt: coldstart opt.opt
|
2000-08-30 18:10:14 -07:00
|
|
|
|
1996-02-21 02:49:46 -08:00
|
|
|
# Installation
|
2012-05-29 03:48:19 -07:00
|
|
|
|
|
|
|
COMPLIBDIR=$(LIBDIR)/compiler-libs
|
|
|
|
|
1996-02-22 04:51:04 -08:00
|
|
|
install: installbyt installopt
|
|
|
|
|
|
|
|
installbyt:
|
2002-06-07 02:49:45 -07:00
|
|
|
mkdir -p $(BINDIR)
|
|
|
|
mkdir -p $(LIBDIR)
|
2012-05-29 03:48:19 -07:00
|
|
|
mkdir -p $(COMPLIBDIR)
|
2002-06-07 02:49:45 -07:00
|
|
|
cd byterun ; $(MAKEREC) install
|
|
|
|
cp ocamlc $(BINDIR)/ocamlc.exe
|
|
|
|
cp ocaml $(BINDIR)/ocaml.exe
|
|
|
|
cd stdlib ; $(MAKEREC) install
|
|
|
|
cp lex/ocamllex $(BINDIR)/ocamllex.exe
|
|
|
|
cp yacc/ocamlyacc.exe $(BINDIR)/ocamlyacc.exe
|
2012-05-29 03:48:19 -07:00
|
|
|
cp utils/*.cmi parsing/*.cmi typing/*.cmi bytecomp/*.cmi driver/*.cmi toplevel/*.cmi $(COMPLIBDIR)
|
|
|
|
cp compilerlibs/ocamlcommon.cma compilerlibs/ocamlbytecomp.cma compilerlibs/ocamltoplevel.cma $(BYTESTART) $(TOPLEVELSTART) $(COMPLIBDIR)
|
2002-06-07 02:49:45 -07:00
|
|
|
cp expunge $(LIBDIR)/expunge.exe
|
2012-07-19 15:56:59 -07:00
|
|
|
cp toplevel/topdirs.cmi $(LIBDIR)
|
2002-06-07 02:49:45 -07:00
|
|
|
cd tools ; $(MAKEREC) install
|
|
|
|
cd ocamldoc ; $(MAKEREC) install
|
2002-07-03 02:45:44 -07:00
|
|
|
mkdir -p $(STUBLIBDIR)
|
2002-06-07 02:49:45 -07:00
|
|
|
for i in $(OTHERLIBRARIES); do $(MAKEREC) -C otherlibs/$$i install; done
|
2008-07-29 01:31:41 -07:00
|
|
|
if test -f debugger/ocamldebug.exe; then (cd debugger; $(MAKEREC) install); \
|
|
|
|
else :; fi
|
2008-04-22 05:26:48 -07:00
|
|
|
./build/partial-install.sh
|
2005-09-24 09:20:36 -07:00
|
|
|
cp config/Makefile $(LIBDIR)/Makefile.config
|
2005-03-24 09:20:54 -08:00
|
|
|
cp README $(DISTRIB)/Readme.general.txt
|
|
|
|
cp README.win32 $(DISTRIB)/Readme.windows.txt
|
2002-06-27 04:36:02 -07:00
|
|
|
cp LICENSE $(DISTRIB)/License.txt
|
|
|
|
cp Changes $(DISTRIB)/Changes.txt
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
# Installation of the native-code compiler
|
|
|
|
installopt:
|
2002-06-07 02:49:45 -07:00
|
|
|
cd asmrun ; $(MAKEREC) install
|
|
|
|
cp ocamlopt $(BINDIR)/ocamlopt.exe
|
|
|
|
cd stdlib ; $(MAKEREC) installopt
|
2012-05-29 03:48:19 -07:00
|
|
|
cp asmcomp/*.cmi driver/*.cmi $(COMPLIBDIR)
|
|
|
|
cp compilerlibs/ocamloptcomp.cma $(OPTSTART) $(COMPLIBDIR)
|
2002-06-07 02:49:45 -07:00
|
|
|
cd ocamldoc ; $(MAKEREC) installopt
|
|
|
|
for i in $(OTHERLIBRARIES); do $(MAKEREC) -C otherlibs/$$i installopt; done
|
2012-05-29 03:48:19 -07:00
|
|
|
if test -f ocamlopt.opt ; then $(MAKEREC) installoptopt; fi
|
|
|
|
|
|
|
|
installoptopt:
|
|
|
|
cp ocamlc.opt $(BINDIR)/ocamlc.opt$(EXE)
|
|
|
|
cp ocamlopt.opt $(BINDIR)/ocamlopt.opt$(EXE)
|
|
|
|
cp lex/ocamllex.opt $(BINDIR)/ocamllex.opt$(EXE)
|
2012-06-08 05:53:40 -07:00
|
|
|
cp compilerlibs/ocamlcommon.cmxa compilerlibs/ocamlcommon.$(A) \
|
2012-10-02 04:40:22 -07:00
|
|
|
compilerlibs/ocamlbytecomp.cmxa compilerlibs/ocamlbytecomp.$(A) \
|
|
|
|
compilerlibs/ocamloptcomp.cmxa compilerlibs/ocamloptcomp.$(A) \
|
|
|
|
$(BYTESTART:.cmo=.cmx) $(BYTESTART:.cmo=.$(O)) \
|
|
|
|
$(OPTSTART:.cmo=.cmx) $(OPTSTART:.cmo=.$(O)) \
|
|
|
|
$(COMPLIBDIR)
|
1996-02-21 02:49:46 -08:00
|
|
|
|
1997-02-16 05:36:42 -08:00
|
|
|
clean:: partialclean
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
# The compiler
|
|
|
|
|
2012-05-29 03:48:19 -07:00
|
|
|
compilerlibs/ocamlcommon.cma: $(COMMON)
|
|
|
|
$(CAMLC) -a -o $@ $(COMMON)
|
|
|
|
partialclean::
|
|
|
|
rm -f compilerlibs/ocamlcommon.cma
|
|
|
|
|
|
|
|
# The bytecode compiler
|
|
|
|
|
|
|
|
compilerlibs/ocamlbytecomp.cma: $(BYTECOMP)
|
|
|
|
$(CAMLC) -a -o $@ $(BYTECOMP)
|
|
|
|
partialclean::
|
|
|
|
rm -f compilerlibs/ocamlbytecomp.cma
|
|
|
|
|
|
|
|
ocamlc: compilerlibs/ocamlcommon.cma compilerlibs/ocamlbytecomp.cma $(BYTESTART)
|
|
|
|
$(CAMLC) $(LINKFLAGS) -o ocamlc \
|
|
|
|
compilerlibs/ocamlcommon.cma compilerlibs/ocamlbytecomp.cma $(BYTESTART)
|
2002-06-07 02:49:45 -07:00
|
|
|
@sed -e 's|@compiler@|$$topdir/boot/ocamlrun $$topdir/ocamlc|' \
|
|
|
|
driver/ocamlcomp.sh.in > ocamlcomp.sh
|
|
|
|
@chmod +x ocamlcomp.sh
|
1996-02-21 02:49:46 -08:00
|
|
|
|
1997-02-16 05:36:42 -08:00
|
|
|
partialclean::
|
2012-05-29 03:48:19 -07:00
|
|
|
rm -f ocamlc ocamlcomp.sh
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
# The native-code compiler
|
|
|
|
|
2012-05-29 03:48:19 -07:00
|
|
|
compilerlibs/ocamloptcomp.cma: $(ASMCOMP)
|
|
|
|
$(CAMLC) -a -o $@ $(ASMCOMP)
|
|
|
|
partialclean::
|
|
|
|
rm -f compilerlibs/ocamloptcomp.cma
|
|
|
|
|
|
|
|
ocamlopt: compilerlibs/ocamlcommon.cma compilerlibs/ocamloptcomp.cma $(OPTSTART)
|
|
|
|
$(CAMLC) $(LINKFLAGS) -o ocamlopt \
|
|
|
|
compilerlibs/ocamlcommon.cma compilerlibs/ocamloptcomp.cma $(OPTSTART)
|
2002-06-07 02:49:45 -07:00
|
|
|
@sed -e 's|@compiler@|$$topdir/boot/ocamlrun $$topdir/ocamlopt|' \
|
|
|
|
driver/ocamlcomp.sh.in > ocamlcompopt.sh
|
|
|
|
@chmod +x ocamlcompopt.sh
|
1996-02-21 02:49:46 -08:00
|
|
|
|
1997-02-16 05:36:42 -08:00
|
|
|
partialclean::
|
2012-05-29 03:48:19 -07:00
|
|
|
rm -f ocamlopt ocamlcompopt.sh
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
# The toplevel
|
|
|
|
|
2012-05-29 03:48:19 -07:00
|
|
|
compilerlibs/ocamltoplevel.cma: $(TOPLEVEL)
|
|
|
|
$(CAMLC) -a -o $@ $(TOPLEVEL)
|
|
|
|
partialclean::
|
|
|
|
rm -f compilerlibs/ocamltoplevel.cma
|
|
|
|
|
|
|
|
ocaml: compilerlibs/ocamlcommon.cma compilerlibs/ocamlbytecomp.cma compilerlibs/ocamltoplevel.cma $(TOPLEVELSTART) expunge
|
|
|
|
$(CAMLC) $(LINKFLAGS) -linkall -o ocaml.tmp \
|
|
|
|
compilerlibs/ocamlcommon.cma compilerlibs/ocamlbytecomp.cma \
|
|
|
|
compilerlibs/ocamltoplevel.cma $(TOPLEVELSTART)
|
2002-11-22 07:10:40 -08:00
|
|
|
- $(CAMLRUN) ./expunge ocaml.tmp ocaml $(PERVASIVES)
|
1996-04-30 07:53:58 -07:00
|
|
|
rm -f ocaml.tmp
|
1996-02-21 02:49:46 -08:00
|
|
|
|
1997-02-16 05:36:42 -08:00
|
|
|
partialclean::
|
1996-04-30 07:53:58 -07:00
|
|
|
rm -f ocaml
|
1996-02-21 02:49:46 -08:00
|
|
|
|
2007-11-06 07:16:56 -08:00
|
|
|
# The native toplevel
|
|
|
|
|
2010-01-22 04:48:24 -08:00
|
|
|
ocamlnat: ocamlopt otherlibs/dynlink/dynlink.cmxa $(NATTOPOBJS:.cmo=.cmx)
|
2007-11-06 07:16:56 -08:00
|
|
|
$(CAMLOPT) $(LINKFLAGS) otherlibs/dynlink/dynlink.cmxa -o ocamlnat $(NATTOPOBJS:.cmo=.cmx) -linkall
|
|
|
|
|
|
|
|
toplevel/opttoploop.cmx: otherlibs/dynlink/dynlink.cmxa
|
|
|
|
|
|
|
|
otherlibs/dynlink/dynlink.cmxa: otherlibs/dynlink/natdynlink.ml
|
2012-07-10 08:29:19 -07:00
|
|
|
cd otherlibs/dynlink && $(MAKE) allopt
|
2007-11-06 07:16:56 -08:00
|
|
|
|
|
|
|
|
1996-02-21 02:49:46 -08:00
|
|
|
# The configuration file
|
|
|
|
|
2002-06-07 02:49:45 -07:00
|
|
|
utils/config.ml: utils/config.mlp config/Makefile
|
|
|
|
@rm -f utils/config.ml
|
|
|
|
sed -e "s|%%LIBDIR%%|$(LIBDIR)|" \
|
2010-01-22 04:48:24 -08:00
|
|
|
-e "s|%%BYTERUN%%|ocamlrun|" \
|
|
|
|
-e 's|%%CCOMPTYPE%%|$(CCOMPTYPE)|' \
|
|
|
|
-e "s|%%BYTECC%%|$(BYTECC) $(BYTECCCOMPOPTS)|" \
|
|
|
|
-e "s|%%NATIVECC%%|$(NATIVECC) $(NATIVECCCOMPOPTS)|" \
|
|
|
|
-e "s|%%PARTIALLD%%|$(PARTIALLD)|" \
|
|
|
|
-e "s|%%PACKLD%%|$(PACKLD)|" \
|
|
|
|
-e "s|%%BYTECCLIBS%%|$(BYTECCLIBS)|" \
|
|
|
|
-e "s|%%NATIVECCLIBS%%|$(NATIVECCLIBS)|" \
|
|
|
|
-e 's|%%RANLIBCMD%%|$(RANLIBCMD)|' \
|
2012-01-16 01:05:37 -08:00
|
|
|
-e 's|%%ARCMD%%|$(ARCMD)|' \
|
2010-01-22 04:48:24 -08:00
|
|
|
-e 's|%%BINUTILS_NM%%|$(BINUTILS_NM)|' \
|
|
|
|
-e 's|%%BINUTILS_OBJCOPY%%|$(BINUTILS_OBJCOPY)|' \
|
|
|
|
-e "s|%%ARCH%%|$(ARCH)|" \
|
|
|
|
-e "s|%%MODEL%%|$(MODEL)|" \
|
|
|
|
-e "s|%%SYSTEM%%|$(SYSTEM)|" \
|
|
|
|
-e "s|%%EXT_OBJ%%|.$(O)|" \
|
|
|
|
-e "s|%%EXT_ASM%%|.$(S)|" \
|
|
|
|
-e "s|%%EXT_LIB%%|.$(A)|" \
|
|
|
|
-e "s|%%EXT_DLL%%|.dll|" \
|
|
|
|
-e "s|%%SYSTHREAD_SUPPORT%%|true|" \
|
|
|
|
-e 's|%%ASM%%|$(ASM)|' \
|
2012-03-05 07:30:19 -08:00
|
|
|
-e 's|%%ASM_CFI_SUPPORTED%%|false|' \
|
2010-01-22 04:48:24 -08:00
|
|
|
-e 's|%%MKDLL%%|$(MKDLL)|' \
|
|
|
|
-e 's|%%MKEXE%%|$(MKEXE)|' \
|
|
|
|
-e 's|%%MKMAINDLL%%|$(MKMAINDLL)|' \
|
|
|
|
-e 's|%%CC_PROFILE%%||' \
|
|
|
|
utils/config.mlp > utils/config.ml
|
2002-06-07 02:49:45 -07:00
|
|
|
@chmod -w utils/config.ml
|
1996-02-21 02:49:46 -08:00
|
|
|
|
1997-02-16 05:36:42 -08:00
|
|
|
partialclean::
|
2002-06-07 02:49:45 -07:00
|
|
|
rm -f utils/config.ml
|
1996-02-21 02:49:46 -08:00
|
|
|
|
2002-06-07 02:49:45 -07:00
|
|
|
beforedepend:: utils/config.ml
|
1996-02-21 02:49:46 -08:00
|
|
|
|
1997-02-04 07:40:22 -08:00
|
|
|
# The parser
|
1996-02-21 02:49:46 -08:00
|
|
|
|
2002-06-07 02:49:45 -07:00
|
|
|
parsing/parser.mli parsing/parser.ml: parsing/parser.mly
|
|
|
|
$(CAMLYACC) $(YACCFLAGS) parsing/parser.mly
|
1996-02-21 02:49:46 -08:00
|
|
|
|
1997-02-16 05:36:42 -08:00
|
|
|
partialclean::
|
2002-06-07 02:49:45 -07:00
|
|
|
rm -f parsing/parser.mli parsing/parser.ml parsing/parser.output
|
1996-02-21 02:49:46 -08:00
|
|
|
|
2002-06-07 02:49:45 -07:00
|
|
|
beforedepend:: parsing/parser.mli parsing/parser.ml
|
1996-02-21 02:49:46 -08:00
|
|
|
|
1997-02-04 07:40:22 -08:00
|
|
|
# The lexer
|
1996-02-21 02:49:46 -08:00
|
|
|
|
2002-06-07 02:49:45 -07:00
|
|
|
parsing/lexer.ml: parsing/lexer.mll
|
|
|
|
$(CAMLLEX) parsing/lexer.mll
|
1996-02-21 02:49:46 -08:00
|
|
|
|
1997-02-16 05:36:42 -08:00
|
|
|
partialclean::
|
2002-06-07 02:49:45 -07:00
|
|
|
rm -f parsing/lexer.ml
|
1996-02-21 02:49:46 -08:00
|
|
|
|
2002-06-07 02:49:45 -07:00
|
|
|
beforedepend:: parsing/lexer.ml
|
1996-02-21 02:49:46 -08:00
|
|
|
|
2012-05-29 03:48:19 -07:00
|
|
|
# Shared parts of the system compiled with the native-code compiler
|
|
|
|
|
|
|
|
compilerlibs/ocamlcommon.cmxa: $(COMMON:.cmo=.cmx)
|
|
|
|
$(CAMLOPT) -a -o $@ $(COMMON:.cmo=.cmx)
|
|
|
|
partialclean::
|
2012-06-08 05:53:40 -07:00
|
|
|
rm -f compilerlibs/ocamlcommon.cmxa compilerlibs/ocamlcommon.$(A)
|
2012-05-29 03:48:19 -07:00
|
|
|
|
1997-11-17 02:39:01 -08:00
|
|
|
# The bytecode compiler compiled with the native-code compiler
|
1996-02-21 02:49:46 -08:00
|
|
|
|
2012-05-29 03:48:19 -07:00
|
|
|
compilerlibs/ocamlbytecomp.cmxa: $(BYTECOMP:.cmo=.cmx)
|
|
|
|
$(CAMLOPT) -a -o $@ $(BYTECOMP:.cmo=.cmx)
|
|
|
|
partialclean::
|
2012-06-08 05:53:40 -07:00
|
|
|
rm -f compilerlibs/ocamlbytecomp.cmxa compilerlibs/ocamlbytecomp.$(A)
|
2012-05-29 03:48:19 -07:00
|
|
|
|
|
|
|
ocamlc.opt: compilerlibs/ocamlcommon.cmxa compilerlibs/ocamlbytecomp.cmxa $(BYTESTART:.cmo=.cmx)
|
|
|
|
$(CAMLOPT) $(LINKFLAGS) -ccopt "$(BYTECCLINKOPTS)" -o ocamlc.opt \
|
|
|
|
compilerlibs/ocamlcommon.cmxa compilerlibs/ocamlbytecomp.cmxa \
|
|
|
|
$(BYTESTART:.cmo=.cmx) -cclib "$(BYTECCLIBS)"
|
2010-05-28 04:21:46 -07:00
|
|
|
@sed -e 's|@compiler@|$$topdir/ocamlc.opt|' \
|
|
|
|
driver/ocamlcomp.sh.in > ocamlcomp.sh
|
|
|
|
@chmod +x ocamlcomp.sh
|
1996-02-21 02:49:46 -08:00
|
|
|
|
1997-02-16 05:36:42 -08:00
|
|
|
partialclean::
|
1996-04-30 07:53:58 -07:00
|
|
|
rm -f ocamlc.opt
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
# The native-code compiler compiled with itself
|
|
|
|
|
2012-05-29 03:48:19 -07:00
|
|
|
compilerlibs/ocamloptcomp.cmxa: $(ASMCOMP:.cmo=.cmx)
|
|
|
|
$(CAMLOPT) -a -o $@ $(ASMCOMP:.cmo=.cmx)
|
|
|
|
partialclean::
|
2012-06-08 05:53:40 -07:00
|
|
|
rm -f compilerlibs/ocamloptcomp.cmxa compilerlibs/ocamloptcomp.$(A)
|
2012-05-29 03:48:19 -07:00
|
|
|
|
|
|
|
ocamlopt.opt: compilerlibs/ocamlcommon.cmxa compilerlibs/ocamloptcomp.cmxa $(OPTSTART:.cmo=.cmx)
|
|
|
|
$(CAMLOPT) $(LINKFLAGS) -o ocamlopt.opt \
|
|
|
|
compilerlibs/ocamlcommon.cmxa compilerlibs/ocamloptcomp.cmxa \
|
|
|
|
$(OPTSTART:.cmo=.cmx)
|
2010-05-28 04:21:46 -07:00
|
|
|
@sed -e 's|@compiler@|$$topdir/ocamlopt.opt|' \
|
|
|
|
driver/ocamlcomp.sh.in > ocamlcompopt.sh
|
|
|
|
@chmod +x ocamlcompopt.sh
|
1996-02-21 02:49:46 -08:00
|
|
|
|
1997-02-16 05:36:42 -08:00
|
|
|
partialclean::
|
2012-04-22 09:11:51 -07:00
|
|
|
rm -f ocamlopt.opt
|
1996-02-21 02:49:46 -08:00
|
|
|
|
2012-05-29 03:48:19 -07:00
|
|
|
$(COMMON:.cmo=.cmx) $(BYTECOMP:.cmo=.cmx) $(ASMCOMP:.cmo=.cmx): ocamlopt
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
# The numeric opcodes
|
|
|
|
|
2002-06-07 02:49:45 -07:00
|
|
|
bytecomp/opcodes.ml: byterun/instruct.h
|
|
|
|
sed -n -e "/^enum/p" -e "s|,||g" -e "/^ /p" byterun/instruct.h | \
|
2010-01-22 04:48:24 -08:00
|
|
|
gawk -f tools/make-opcodes > bytecomp/opcodes.ml
|
1996-02-21 02:49:46 -08:00
|
|
|
|
1997-02-16 05:36:42 -08:00
|
|
|
partialclean::
|
2002-06-07 02:49:45 -07:00
|
|
|
rm -f bytecomp/opcodes.ml
|
1996-02-21 02:49:46 -08:00
|
|
|
|
2002-06-07 02:49:45 -07:00
|
|
|
beforedepend:: bytecomp/opcodes.ml
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
# The predefined exceptions and primitives
|
|
|
|
|
2002-06-07 02:49:45 -07:00
|
|
|
byterun/primitives:
|
|
|
|
cd byterun ; $(MAKEREC) primitives
|
1996-02-21 02:49:46 -08:00
|
|
|
|
2002-06-07 02:49:45 -07:00
|
|
|
bytecomp/runtimedef.ml: byterun/primitives byterun/fail.h
|
|
|
|
(echo 'let builtin_exceptions = [|'; \
|
|
|
|
sed -n -e 's|.*/\* \("[A-Za-z_]*"\) \*/$$| \1;|p' byterun/fail.h | \
|
|
|
|
sed -e '$$s/;$$//'; \
|
2010-01-22 04:48:24 -08:00
|
|
|
echo '|]'; \
|
|
|
|
echo 'let builtin_primitives = [|'; \
|
|
|
|
sed -e 's/.*/ "&";/' -e '$$s/;$$//' byterun/primitives; \
|
2002-06-07 02:49:45 -07:00
|
|
|
echo '|]') > bytecomp/runtimedef.ml
|
1996-02-21 02:49:46 -08:00
|
|
|
|
1997-02-16 05:36:42 -08:00
|
|
|
partialclean::
|
2002-06-07 02:49:45 -07:00
|
|
|
rm -f bytecomp/runtimedef.ml
|
1996-02-21 02:49:46 -08:00
|
|
|
|
2002-06-07 02:49:45 -07:00
|
|
|
beforedepend:: bytecomp/runtimedef.ml
|
1996-02-21 02:49:46 -08:00
|
|
|
|
1997-07-24 04:49:12 -07:00
|
|
|
# Choose the right machine-dependent files
|
1996-02-21 02:49:46 -08:00
|
|
|
|
2002-06-07 02:49:45 -07:00
|
|
|
asmcomp/arch.ml: asmcomp/$(ARCH)/arch.ml
|
|
|
|
cp asmcomp/$(ARCH)/arch.ml asmcomp/arch.ml
|
1996-02-21 02:49:46 -08:00
|
|
|
|
1997-02-16 05:36:42 -08:00
|
|
|
partialclean::
|
2002-06-07 02:49:45 -07:00
|
|
|
rm -f asmcomp/arch.ml
|
|
|
|
|
|
|
|
beforedepend:: asmcomp/arch.ml
|
1996-02-21 02:49:46 -08:00
|
|
|
|
2002-06-07 02:49:45 -07:00
|
|
|
ifeq ($(TOOLCHAIN),msvc)
|
|
|
|
ASMCOMP_EMIT=asmcomp/$(ARCH)/emit_nt.mlp
|
|
|
|
else
|
|
|
|
ASMCOMP_EMIT=asmcomp/$(ARCH)/emit.mlp
|
|
|
|
endif
|
1996-02-21 02:49:46 -08:00
|
|
|
|
2011-12-16 09:02:48 -08:00
|
|
|
asmcomp/proc.ml: asmcomp/$(ARCH)/proc.ml
|
|
|
|
cp asmcomp/$(ARCH)/proc.ml asmcomp/proc.ml
|
1996-02-21 02:49:46 -08:00
|
|
|
|
1997-02-16 05:36:42 -08:00
|
|
|
partialclean::
|
2002-06-07 02:49:45 -07:00
|
|
|
rm -f asmcomp/proc.ml
|
1996-02-21 02:49:46 -08:00
|
|
|
|
2002-06-07 02:49:45 -07:00
|
|
|
beforedepend:: asmcomp/proc.ml
|
1996-02-21 02:49:46 -08:00
|
|
|
|
2002-06-07 02:49:45 -07:00
|
|
|
asmcomp/selection.ml: asmcomp/$(ARCH)/selection.ml
|
|
|
|
cp asmcomp/$(ARCH)/selection.ml asmcomp/selection.ml
|
1997-07-24 04:49:12 -07:00
|
|
|
|
|
|
|
partialclean::
|
2002-06-07 02:49:45 -07:00
|
|
|
rm -f asmcomp/selection.ml
|
1997-07-24 04:49:12 -07:00
|
|
|
|
2002-06-07 02:49:45 -07:00
|
|
|
beforedepend:: asmcomp/selection.ml
|
1997-07-24 04:49:12 -07:00
|
|
|
|
2002-06-07 02:49:45 -07:00
|
|
|
asmcomp/reload.ml: asmcomp/$(ARCH)/reload.ml
|
|
|
|
cp asmcomp/$(ARCH)/reload.ml asmcomp/reload.ml
|
1997-07-24 04:49:12 -07:00
|
|
|
|
|
|
|
partialclean::
|
2002-06-07 02:49:45 -07:00
|
|
|
rm -f asmcomp/reload.ml
|
1997-07-24 04:49:12 -07:00
|
|
|
|
2002-06-07 02:49:45 -07:00
|
|
|
beforedepend:: asmcomp/reload.ml
|
1997-07-24 04:49:12 -07:00
|
|
|
|
2002-06-07 02:49:45 -07:00
|
|
|
asmcomp/scheduling.ml: asmcomp/$(ARCH)/scheduling.ml
|
|
|
|
cp asmcomp/$(ARCH)/scheduling.ml asmcomp/scheduling.ml
|
1997-07-24 04:49:12 -07:00
|
|
|
|
|
|
|
partialclean::
|
2002-06-07 02:49:45 -07:00
|
|
|
rm -f asmcomp/scheduling.ml
|
1997-07-24 04:49:12 -07:00
|
|
|
|
2002-06-07 02:49:45 -07:00
|
|
|
beforedepend:: asmcomp/scheduling.ml
|
1997-07-24 04:49:12 -07:00
|
|
|
|
1996-02-21 02:49:46 -08:00
|
|
|
# Preprocess the code emitters
|
|
|
|
|
2002-06-07 02:49:45 -07:00
|
|
|
asmcomp/emit.ml: $(ASMCOMP_EMIT) tools/cvt_emit
|
|
|
|
boot/ocamlrun tools/cvt_emit < $(ASMCOMP_EMIT) > asmcomp/emit.ml
|
1996-02-21 02:49:46 -08:00
|
|
|
|
1997-02-16 05:36:42 -08:00
|
|
|
partialclean::
|
2002-06-07 02:49:45 -07:00
|
|
|
rm -f asmcomp/emit.ml
|
1996-02-21 02:49:46 -08:00
|
|
|
|
2002-06-07 02:49:45 -07:00
|
|
|
beforedepend:: asmcomp/emit.ml
|
1996-02-21 02:49:46 -08:00
|
|
|
|
2002-06-07 02:49:45 -07:00
|
|
|
tools/cvt_emit: tools/cvt_emit.mll
|
|
|
|
cd tools ; $(MAKEREC) cvt_emit
|
1996-10-07 06:19:16 -07:00
|
|
|
|
1996-02-21 02:49:46 -08:00
|
|
|
# The "expunge" utility
|
|
|
|
|
2012-05-29 03:48:19 -07:00
|
|
|
expunge: compilerlibs/ocamlcommon.cma compilerlibs/ocamlbytecomp.cma toplevel/expunge.cmo
|
|
|
|
$(CAMLC) $(LINKFLAGS) -o expunge \
|
|
|
|
compilerlibs/ocamlcommon.cma compilerlibs/ocamlbytecomp.cma toplevel/expunge.cmo
|
1996-02-21 02:49:46 -08:00
|
|
|
|
1997-02-16 05:36:42 -08:00
|
|
|
partialclean::
|
1996-02-21 02:49:46 -08:00
|
|
|
rm -f expunge
|
|
|
|
|
|
|
|
# The runtime system for the bytecode compiler
|
|
|
|
|
2002-06-07 02:49:45 -07:00
|
|
|
runtime: makeruntime stdlib/libcamlrun.$(A)
|
1997-01-05 06:06:13 -08:00
|
|
|
|
|
|
|
makeruntime:
|
2002-06-07 02:49:45 -07:00
|
|
|
cd byterun ; $(MAKEREC) all
|
|
|
|
stdlib/libcamlrun.$(A): byterun/libcamlrun.$(A)
|
|
|
|
cp byterun/libcamlrun.$(A) stdlib/libcamlrun.$(A)
|
1997-02-16 05:36:42 -08:00
|
|
|
clean::
|
2002-06-07 02:49:45 -07:00
|
|
|
cd byterun ; $(MAKEREC) clean
|
|
|
|
rm -f stdlib/libcamlrun.$(A)
|
1996-02-21 02:49:46 -08:00
|
|
|
alldepend::
|
2002-06-07 02:49:45 -07:00
|
|
|
cd byterun ; $(MAKEREC) depend
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
# The runtime system for the native-code compiler
|
|
|
|
|
2002-06-07 02:49:45 -07:00
|
|
|
runtimeopt: makeruntimeopt stdlib/libasmrun.$(A)
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
makeruntimeopt:
|
2002-06-07 02:49:45 -07:00
|
|
|
cd asmrun ; $(MAKEREC) all
|
|
|
|
stdlib/libasmrun.$(A): asmrun/libasmrun.$(A)
|
|
|
|
cp asmrun/libasmrun.$(A) stdlib/libasmrun.$(A)
|
1997-02-16 05:36:42 -08:00
|
|
|
clean::
|
2002-06-07 02:49:45 -07:00
|
|
|
cd asmrun ; $(MAKEREC) clean
|
|
|
|
rm -f stdlib/libasmrun.$(A)
|
1996-02-21 02:49:46 -08:00
|
|
|
alldepend::
|
2002-06-07 02:49:45 -07:00
|
|
|
cd asmrun ; $(MAKEREC) depend
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
# The library
|
|
|
|
|
|
|
|
library:
|
2002-06-07 02:49:45 -07:00
|
|
|
cd stdlib ; $(MAKEREC) all
|
1996-02-21 02:49:46 -08:00
|
|
|
library-cross:
|
2002-06-07 02:49:45 -07:00
|
|
|
cd stdlib ; $(MAKEREC) RUNTIME=../byterun/ocamlrun all
|
1996-02-21 02:49:46 -08:00
|
|
|
libraryopt:
|
2002-06-07 02:49:45 -07:00
|
|
|
cd stdlib ; $(MAKEREC) allopt
|
1997-02-16 05:36:42 -08:00
|
|
|
partialclean::
|
2002-06-07 02:49:45 -07:00
|
|
|
cd stdlib ; $(MAKEREC) clean
|
1996-02-21 02:49:46 -08:00
|
|
|
alldepend::
|
2002-06-07 02:49:45 -07:00
|
|
|
cd stdlib ; $(MAKEREC) depend
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
# The lexer and parser generators
|
|
|
|
|
1996-04-30 07:53:58 -07:00
|
|
|
ocamllex:
|
2002-06-07 02:49:45 -07:00
|
|
|
cd lex ; $(MAKEREC) all
|
2000-08-30 18:10:14 -07:00
|
|
|
ocamllex.opt:
|
2002-06-07 02:49:45 -07:00
|
|
|
cd lex ; $(MAKEREC) allopt
|
1997-02-16 05:36:42 -08:00
|
|
|
partialclean::
|
2002-06-07 02:49:45 -07:00
|
|
|
cd lex ; $(MAKEREC) clean
|
1996-02-21 02:49:46 -08:00
|
|
|
alldepend::
|
2002-06-07 02:49:45 -07:00
|
|
|
cd lex ; $(MAKEREC) depend
|
1996-02-21 02:49:46 -08:00
|
|
|
|
1996-04-30 07:53:58 -07:00
|
|
|
ocamlyacc:
|
2002-06-07 02:49:45 -07:00
|
|
|
cd yacc ; $(MAKEREC) all
|
1997-02-16 05:36:42 -08:00
|
|
|
clean::
|
2002-06-07 02:49:45 -07:00
|
|
|
cd yacc ; $(MAKEREC) clean
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
# Tools
|
|
|
|
|
2010-05-19 04:29:38 -07:00
|
|
|
ocamltools: asmcomp/cmx_format.cmi
|
2002-06-07 02:49:45 -07:00
|
|
|
cd tools ; $(MAKEREC) all
|
2010-05-19 04:29:38 -07:00
|
|
|
ocamltoolsopt.opt: asmcomp/cmx_format.cmi
|
2002-06-07 02:49:45 -07:00
|
|
|
cd tools ; $(MAKEREC) opt.opt
|
1997-02-16 05:36:42 -08:00
|
|
|
partialclean::
|
2002-06-07 02:49:45 -07:00
|
|
|
cd tools ; $(MAKEREC) clean
|
1996-02-21 02:49:46 -08:00
|
|
|
alldepend::
|
2002-06-07 02:49:45 -07:00
|
|
|
cd tools ; $(MAKEREC) depend
|
1996-02-21 02:49:46 -08:00
|
|
|
|
2002-03-29 04:38:23 -08:00
|
|
|
# OCamldoc
|
|
|
|
|
2010-01-22 04:48:24 -08:00
|
|
|
ocamldoc.byte:
|
2002-06-07 02:49:45 -07:00
|
|
|
cd ocamldoc ; $(MAKEREC) all
|
2010-01-22 04:48:24 -08:00
|
|
|
ocamldoc.opt:
|
2002-06-07 02:49:45 -07:00
|
|
|
cd ocamldoc ; $(MAKEREC) opt.opt
|
2002-03-29 04:38:23 -08:00
|
|
|
partialclean::
|
2002-06-07 02:49:45 -07:00
|
|
|
cd ocamldoc ; $(MAKEREC) clean
|
2002-03-29 04:38:23 -08:00
|
|
|
alldepend::
|
2002-06-07 02:49:45 -07:00
|
|
|
cd ocamldoc ; $(MAKEREC) depend
|
2002-03-29 04:38:23 -08:00
|
|
|
|
1996-02-21 02:49:46 -08:00
|
|
|
# The extra libraries
|
|
|
|
|
|
|
|
otherlibraries:
|
2002-06-07 02:49:45 -07:00
|
|
|
for i in $(OTHERLIBRARIES); do $(MAKEREC) -C otherlibs/$$i all; done
|
1996-02-21 02:49:46 -08:00
|
|
|
otherlibrariesopt:
|
2002-06-07 02:49:45 -07:00
|
|
|
for i in $(OTHERLIBRARIES); do $(MAKEREC) -C otherlibs/$$i allopt; done
|
1997-02-16 05:36:42 -08:00
|
|
|
partialclean::
|
2002-06-07 02:49:45 -07:00
|
|
|
for i in $(OTHERLIBRARIES); do $(MAKEREC) -C otherlibs/$$i partialclean; done
|
1996-02-21 02:49:46 -08:00
|
|
|
clean::
|
2002-06-07 02:49:45 -07:00
|
|
|
for i in $(OTHERLIBRARIES); do $(MAKEREC) -C otherlibs/$$i clean; done
|
1996-02-21 02:49:46 -08:00
|
|
|
alldepend::
|
2002-06-07 02:49:45 -07:00
|
|
|
for i in $(OTHERLIBRARIES); do $(MAKEREC) -C otherlibs/$$i depend; done
|
1996-02-21 02:49:46 -08:00
|
|
|
|
2008-07-29 01:31:41 -07:00
|
|
|
# The replay debugger
|
|
|
|
|
|
|
|
ocamldebugger: ocamlc ocamlyacc ocamllex
|
|
|
|
cd debugger; $(MAKEREC) all
|
|
|
|
partialclean::
|
|
|
|
cd debugger; $(MAKEREC) clean
|
|
|
|
alldepend::
|
|
|
|
cd debugger; $(MAKEREC) depend
|
|
|
|
|
2002-11-05 02:23:52 -08:00
|
|
|
# Camlp4
|
|
|
|
|
2008-11-10 08:13:20 -08:00
|
|
|
camlp4out: ocamlc otherlibraries ocamlbuild-mixed-boot ocamlbuild.byte
|
2010-08-02 07:37:22 -07:00
|
|
|
./build/camlp4-byte-only.sh
|
2008-11-10 08:13:20 -08:00
|
|
|
camlp4opt: ocamlopt otherlibrariesopt ocamlbuild-mixed-boot ocamlbuild.native
|
2010-08-02 07:37:22 -07:00
|
|
|
./build/camlp4-native-only.sh
|
2007-02-07 02:31:36 -08:00
|
|
|
|
|
|
|
# Ocamlbuild
|
2006-09-28 06:27:27 -07:00
|
|
|
|
2008-11-10 08:13:20 -08:00
|
|
|
ocamlbuild.byte: ocamlc otherlibraries ocamlbuild-mixed-boot
|
2010-08-02 07:37:22 -07:00
|
|
|
./build/ocamlbuild-byte-only.sh
|
2008-11-10 08:13:20 -08:00
|
|
|
ocamlbuild.native: ocamlopt otherlibrariesopt ocamlbuild-mixed-boot
|
2010-08-02 07:37:22 -07:00
|
|
|
./build/ocamlbuild-native-only.sh
|
2008-11-10 08:13:20 -08:00
|
|
|
ocamlbuildlib.native: ocamlopt otherlibrariesopt ocamlbuild-mixed-boot
|
2010-08-02 07:37:22 -07:00
|
|
|
./build/ocamlbuildlib-native-only.sh
|
2007-11-29 02:35:57 -08:00
|
|
|
|
2007-02-07 02:31:36 -08:00
|
|
|
|
2008-11-10 08:13:20 -08:00
|
|
|
.PHONY: ocamlbuild-mixed-boot
|
|
|
|
ocamlbuild-mixed-boot:
|
2010-08-02 07:37:22 -07:00
|
|
|
./build/mixed-boot.sh
|
2007-10-08 07:19:34 -07:00
|
|
|
partialclean::
|
|
|
|
rm -rf _build
|
2002-11-05 02:23:52 -08:00
|
|
|
|
1996-02-21 02:49:46 -08:00
|
|
|
# Default rules
|
|
|
|
|
|
|
|
.SUFFIXES: .ml .mli .cmo .cmi .cmx
|
|
|
|
|
|
|
|
.ml.cmo:
|
|
|
|
$(CAMLC) $(COMPFLAGS) -c $<
|
|
|
|
|
|
|
|
.mli.cmi:
|
|
|
|
$(CAMLC) $(COMPFLAGS) -c $<
|
|
|
|
|
|
|
|
.ml.cmx:
|
|
|
|
$(CAMLOPT) $(COMPFLAGS) -c $<
|
|
|
|
|
1997-02-16 05:36:42 -08:00
|
|
|
partialclean::
|
2002-06-07 02:49:45 -07:00
|
|
|
rm -f utils/*.cm* utils/*.$(O) utils/*.$(S)
|
|
|
|
rm -f parsing/*.cm* parsing/*.$(O) parsing/*.$(S)
|
|
|
|
rm -f typing/*.cm* typing/*.$(O) typing/*.$(S)
|
|
|
|
rm -f bytecomp/*.cm* bytecomp/*.$(O) bytecomp/*.$(S)
|
|
|
|
rm -f asmcomp/*.cm* asmcomp/*.$(O) asmcomp/*.$(S)
|
|
|
|
rm -f driver/*.cm* driver/*.$(O) driver/*.$(S)
|
|
|
|
rm -f toplevel/*.cm* toplevel/*.$(O) toplevel/*.$(S)
|
|
|
|
rm -f tools/*.cm* tools/*.$(O) tools/*.$(S)
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
depend: beforedepend
|
2003-01-03 08:08:33 -08:00
|
|
|
(for d in utils parsing typing bytecomp asmcomp driver toplevel; \
|
|
|
|
do $(CAMLDEP) $(DEPFLAGS) $$d/*.mli $$d/*.ml; \
|
|
|
|
done) > .depend
|
1996-02-21 02:49:46 -08:00
|
|
|
|
|
|
|
alldepend:: depend
|
|
|
|
|
2012-02-10 01:08:02 -08:00
|
|
|
distclean:
|
|
|
|
./build/distclean.sh
|
|
|
|
|
|
|
|
.PHONY: all backup bootstrap camlp4opt camlp4out checkstack clean
|
|
|
|
.PHONY: partialclean beforedepend alldepend cleanboot coldstart
|
|
|
|
.PHONY: compare core coreall
|
|
|
|
.PHONY: coreboot defaultentry depend distclean install installopt
|
|
|
|
.PHONY: library library-cross libraryopt ocamlbuild-mixed-boot
|
|
|
|
.PHONY: ocamlbuild.byte ocamlbuild.native ocamldebugger ocamldoc
|
|
|
|
.PHONY: ocamldoc.opt ocamllex ocamllex.opt ocamltools ocamltools.opt
|
|
|
|
.PHONY: ocamlyacc opt-core opt opt.opt otherlibraries
|
|
|
|
.PHONY: otherlibrariesopt promote promote-cross
|
|
|
|
.PHONY: restore runtime runtimeopt makeruntimeopt world world.opt
|
|
|
|
|
2002-06-07 02:49:45 -07:00
|
|
|
include .depend
|