2001-03-26 03:08:00 -08:00
|
|
|
#########################################################################
|
|
|
|
# #
|
2011-07-27 07:17:02 -07:00
|
|
|
# OCaml #
|
2001-03-26 03:08:00 -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. #
|
|
|
|
# #
|
|
|
|
#########################################################################
|
1999-11-17 10:59:06 -08:00
|
|
|
|
2001-03-26 03:08:00 -08:00
|
|
|
# The main Makefile
|
1995-05-04 03:15:53 -07:00
|
|
|
|
2015-10-23 06:49:59 -07:00
|
|
|
include Makefile.shared
|
1996-02-13 08:29:09 -08:00
|
|
|
|
2001-03-26 03:08:00 -08:00
|
|
|
SHELL=/bin/sh
|
|
|
|
MKDIR=mkdir -p
|
|
|
|
|
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 INSTALL."
|
|
|
|
@echo "If you've just unpacked the distribution, something like"
|
|
|
|
@echo " ./configure"
|
2012-09-17 09:25:03 -07:00
|
|
|
@echo " make world.opt"
|
2001-12-03 02:13:14 -08:00
|
|
|
@echo " make install"
|
|
|
|
@echo "should work. But see the file INSTALL for more details."
|
|
|
|
|
2001-03-26 03:08:00 -08:00
|
|
|
# Recompile the system using the bootstrap compiler
|
2013-07-24 07:39:31 -07:00
|
|
|
all:
|
|
|
|
$(MAKE) runtime
|
2014-06-09 06:53:43 -07:00
|
|
|
$(MAKE) coreall
|
2013-07-24 07:39:31 -07:00
|
|
|
$(MAKE) ocaml
|
2013-11-21 08:23:28 -08:00
|
|
|
$(MAKE) otherlibraries $(OCAMLBUILDBYTE) $(WITH_DEBUGGER) \
|
2013-08-29 05:51:03 -07:00
|
|
|
$(WITH_OCAMLDOC)
|
2001-03-26 03:08:00 -08:00
|
|
|
|
|
|
|
# Compile everything the first time
|
2007-11-22 11:01:50 -08:00
|
|
|
world:
|
|
|
|
$(MAKE) coldstart
|
|
|
|
$(MAKE) all
|
2001-03-26 03:08:00 -08:00
|
|
|
|
2002-06-30 18:21:45 -07:00
|
|
|
# Compile also native code compiler and libraries, fast
|
2007-11-22 11:01:50 -08:00
|
|
|
world.opt:
|
|
|
|
$(MAKE) coldstart
|
|
|
|
$(MAKE) opt.opt
|
2002-06-30 18:21:45 -07:00
|
|
|
|
2008-02-29 04:53:34 -08:00
|
|
|
# Hard bootstrap how-to:
|
|
|
|
# (only necessary in some cases, for example if you remove some primitive)
|
|
|
|
#
|
|
|
|
# make coreboot [old system -- you were in a stable state]
|
|
|
|
# <change the source>
|
2014-05-08 06:34:46 -07:00
|
|
|
# make clean runtime coreall
|
2008-02-29 04:53:34 -08:00
|
|
|
# <debug your changes>
|
2014-05-08 06:34:46 -07:00
|
|
|
# make clean runtime coreall
|
|
|
|
# make coreboot [new system -- now in a stable state]
|
2008-02-29 04:53:34 -08:00
|
|
|
|
2002-11-01 07:28:19 -08:00
|
|
|
# Core bootstrapping cycle
|
|
|
|
coreboot:
|
2001-03-26 03:08:00 -08:00
|
|
|
# Save the original bootstrap compiler
|
|
|
|
$(MAKE) backup
|
|
|
|
# Promote the new compiler but keep the old runtime
|
|
|
|
# This compiler runs on boot/ocamlrun and produces bytecode for
|
|
|
|
# byterun/ocamlrun
|
|
|
|
$(MAKE) promote-cross
|
|
|
|
# Rebuild ocamlc and ocamllex (run on byterun/ocamlrun)
|
|
|
|
$(MAKE) partialclean
|
2007-10-08 07:19:34 -07:00
|
|
|
$(MAKE) ocamlc ocamllex ocamltools
|
2001-03-26 03:08:00 -08:00
|
|
|
# Rebuild the library (using byterun/ocamlrun ./ocamlc)
|
|
|
|
$(MAKE) library-cross
|
|
|
|
# Promote the new compiler and the new runtime
|
|
|
|
$(MAKE) promote
|
2002-11-01 07:28:19 -08:00
|
|
|
# Rebuild the core system
|
2001-03-26 03:08:00 -08:00
|
|
|
$(MAKE) partialclean
|
2002-11-01 07:28:19 -08:00
|
|
|
$(MAKE) core
|
2001-03-26 03:08:00 -08:00
|
|
|
# Check if fixpoint reached
|
|
|
|
$(MAKE) compare
|
|
|
|
|
2002-11-01 07:28:19 -08:00
|
|
|
# Bootstrap and rebuild the whole system.
|
2008-02-29 04:53:34 -08:00
|
|
|
# The compilation of ocaml will fail if the runtime has changed.
|
|
|
|
# Never mind, just do make bootstrap to reach fixpoint again.
|
2002-10-29 05:32:40 -08:00
|
|
|
bootstrap:
|
2002-11-01 07:28:19 -08:00
|
|
|
$(MAKE) coreboot
|
2002-10-29 05:32:40 -08:00
|
|
|
$(MAKE) all
|
|
|
|
$(MAKE) compare
|
|
|
|
|
2001-03-26 03:08:00 -08:00
|
|
|
LIBFILES=stdlib.cma std_exit.cmo *.cmi camlheader
|
|
|
|
|
|
|
|
# Start up the system from the distribution compiler
|
|
|
|
coldstart:
|
|
|
|
cd byterun; $(MAKE) all
|
|
|
|
cp byterun/ocamlrun$(EXE) boot/ocamlrun$(EXE)
|
|
|
|
cd yacc; $(MAKE) all
|
|
|
|
cp yacc/ocamlyacc$(EXE) boot/ocamlyacc$(EXE)
|
2013-11-29 05:04:38 -08:00
|
|
|
cd stdlib; $(MAKE) COMPILER=../boot/ocamlc all
|
2001-03-26 03:08:00 -08:00
|
|
|
cd stdlib; cp $(LIBFILES) ../boot
|
|
|
|
if test -f boot/libcamlrun.a; then :; else \
|
2010-01-22 04:48:24 -08:00
|
|
|
ln -s ../byterun/libcamlrun.a boot/libcamlrun.a; fi
|
2001-03-26 03:08:00 -08:00
|
|
|
if test -d stdlib/caml; then :; else \
|
2014-12-27 06:41:49 -08:00
|
|
|
ln -s ../byterun/caml stdlib/caml; fi
|
2001-03-26 03:08:00 -08:00
|
|
|
|
|
|
|
# Build the core system: the minimum needed to make depend and bootstrap
|
2013-07-24 07:39:31 -07:00
|
|
|
core:
|
|
|
|
$(MAKE) coldstart
|
2014-06-09 06:53:43 -07:00
|
|
|
$(MAKE) coreall
|
2001-03-26 03:08:00 -08:00
|
|
|
|
2007-12-12 06:09:16 -08:00
|
|
|
# Recompile the core system using the bootstrap compiler
|
2013-07-24 07:39:31 -07:00
|
|
|
coreall:
|
|
|
|
$(MAKE) ocamlc
|
|
|
|
$(MAKE) ocamllex ocamlyacc ocamltools library
|
2007-12-12 06:09:16 -08:00
|
|
|
|
2001-03-26 03:08:00 -08:00
|
|
|
# Save the current bootstrap compiler
|
|
|
|
MAXSAVED=boot/Saved/Saved.prev/Saved.prev/Saved.prev/Saved.prev/Saved.prev
|
|
|
|
backup:
|
|
|
|
if test -d boot/Saved; then : ; else mkdir boot/Saved; fi
|
|
|
|
if test -d $(MAXSAVED); then rm -r $(MAXSAVED); else : ; fi
|
|
|
|
mv boot/Saved boot/Saved.prev
|
|
|
|
mkdir boot/Saved
|
|
|
|
mv boot/Saved.prev boot/Saved/Saved.prev
|
|
|
|
cp boot/ocamlrun$(EXE) boot/Saved
|
2007-11-22 11:01:50 -08:00
|
|
|
mv boot/ocamlc boot/ocamllex boot/ocamlyacc$(EXE) boot/ocamldep \
|
|
|
|
boot/Saved
|
2001-03-26 03:08:00 -08:00
|
|
|
cd boot; cp $(LIBFILES) Saved
|
|
|
|
|
|
|
|
# Promote the newly compiled system to the rank of cross compiler
|
|
|
|
# (Runs on the old runtime, produces code for the new runtime)
|
|
|
|
promote-cross:
|
|
|
|
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
|
2001-03-26 03:08:00 -08:00
|
|
|
cd stdlib; cp $(LIBFILES) ../boot
|
|
|
|
|
|
|
|
# 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
|
|
|
|
cp byterun/ocamlrun$(EXE) boot/ocamlrun$(EXE)
|
|
|
|
|
|
|
|
# Restore the saved bootstrap compiler if a problem arises
|
|
|
|
restore:
|
|
|
|
mv boot/Saved/* boot
|
|
|
|
rmdir boot/Saved
|
|
|
|
mv boot/Saved.prev boot/Saved
|
|
|
|
|
|
|
|
# Check if fixpoint reached
|
|
|
|
compare:
|
2007-11-22 11:01:50 -08:00
|
|
|
@if cmp boot/ocamlc ocamlc && cmp boot/ocamllex lex/ocamllex \
|
|
|
|
&& cmp boot/ocamldep tools/ocamldep; \
|
2001-03-26 03:08:00 -08:00
|
|
|
then echo "Fixpoint reached, bootstrap succeeded."; \
|
2010-01-22 04:48:24 -08:00
|
|
|
else echo "Fixpoint not reached, try one more bootstrapping cycle."; \
|
2001-03-26 03:08:00 -08:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Remove old bootstrap compilers
|
|
|
|
cleanboot:
|
|
|
|
rm -rf boot/Saved/Saved.prev/*
|
|
|
|
|
|
|
|
# Compile the native-code compiler
|
2007-11-22 11:01:50 -08:00
|
|
|
opt-core:
|
|
|
|
$(MAKE) runtimeopt
|
|
|
|
$(MAKE) ocamlopt
|
|
|
|
$(MAKE) libraryopt
|
|
|
|
|
|
|
|
opt:
|
|
|
|
$(MAKE) runtimeopt
|
|
|
|
$(MAKE) ocamlopt
|
|
|
|
$(MAKE) libraryopt
|
2013-07-28 08:52:17 -07:00
|
|
|
$(MAKE) otherlibrariesopt ocamltoolsopt $(OCAMLBUILDNATIVE)
|
2001-03-26 03:08:00 -08:00
|
|
|
|
|
|
|
# Native-code versions of the tools
|
2013-07-24 07:39:31 -07:00
|
|
|
opt.opt:
|
|
|
|
$(MAKE) checkstack
|
|
|
|
$(MAKE) runtime
|
|
|
|
$(MAKE) core
|
|
|
|
$(MAKE) ocaml
|
|
|
|
$(MAKE) opt-core
|
|
|
|
$(MAKE) ocamlc.opt
|
2013-07-28 08:52:17 -07:00
|
|
|
$(MAKE) otherlibraries $(WITH_DEBUGGER) $(WITH_OCAMLDOC) \
|
2013-11-21 08:23:28 -08:00
|
|
|
$(OCAMLBUILDBYTE)
|
2013-07-24 07:39:31 -07:00
|
|
|
$(MAKE) ocamlopt.opt
|
|
|
|
$(MAKE) otherlibrariesopt
|
2013-07-28 08:52:17 -07:00
|
|
|
$(MAKE) ocamllex.opt ocamltoolsopt ocamltoolsopt.opt $(OCAMLDOC_OPT) \
|
2013-11-21 08:23:28 -08:00
|
|
|
$(OCAMLBUILDNATIVE)
|
2001-03-26 03:08:00 -08:00
|
|
|
|
2013-07-24 07:39:31 -07:00
|
|
|
base.opt:
|
|
|
|
$(MAKE) checkstack
|
|
|
|
$(MAKE) runtime
|
|
|
|
$(MAKE) core
|
|
|
|
$(MAKE) ocaml
|
|
|
|
$(MAKE) opt-core
|
|
|
|
$(MAKE) ocamlc.opt
|
2013-11-21 08:23:28 -08:00
|
|
|
$(MAKE) otherlibraries $(OCAMLBUILDBYTE) $(WITH_DEBUGGER) \
|
2013-07-28 08:52:17 -07:00
|
|
|
$(WITH_OCAMLDOC)
|
2013-07-24 07:39:31 -07:00
|
|
|
$(MAKE) ocamlopt.opt
|
|
|
|
$(MAKE) otherlibrariesopt
|
2010-08-02 07:37:22 -07:00
|
|
|
|
2001-03-26 03:08:00 -08:00
|
|
|
# Installation
|
2012-05-17 09:04:13 -07:00
|
|
|
|
|
|
|
COMPLIBDIR=$(LIBDIR)/compiler-libs
|
|
|
|
|
2014-04-07 00:06:17 -07:00
|
|
|
INSTALL_BINDIR=$(DESTDIR)$(BINDIR)
|
|
|
|
INSTALL_LIBDIR=$(DESTDIR)$(LIBDIR)
|
|
|
|
INSTALL_COMPLIBDIR=$(DESTDIR)$(COMPLIBDIR)
|
|
|
|
INSTALL_STUBLIBDIR=$(DESTDIR)$(STUBLIBDIR)
|
|
|
|
INSTALL_MANDIR=$(DESTDIR)$(MANDIR)
|
|
|
|
|
2007-11-22 11:01:50 -08:00
|
|
|
install:
|
2014-04-07 00:06:17 -07:00
|
|
|
if test -d $(INSTALL_BINDIR); then : ; \
|
|
|
|
else $(MKDIR) $(INSTALL_BINDIR); fi
|
|
|
|
if test -d $(INSTALL_LIBDIR); then : ; \
|
|
|
|
else $(MKDIR) $(INSTALL_LIBDIR); fi
|
|
|
|
if test -d $(INSTALL_STUBLIBDIR); then : ; \
|
|
|
|
else $(MKDIR) $(INSTALL_STUBLIBDIR); fi
|
|
|
|
if test -d $(INSTALL_COMPLIBDIR); then : ; \
|
|
|
|
else $(MKDIR) $(INSTALL_COMPLIBDIR); fi
|
|
|
|
if test -d $(INSTALL_MANDIR)/man$(MANEXT); then : ; \
|
|
|
|
else $(MKDIR) $(INSTALL_MANDIR)/man$(MANEXT); fi
|
|
|
|
cp VERSION $(INSTALL_LIBDIR)/
|
|
|
|
cd $(INSTALL_LIBDIR); rm -f dllbigarray.so dllnums.so dllthreads.so \
|
2013-09-09 02:32:00 -07:00
|
|
|
dllunix.so dllgraphics.so dllstr.so
|
2001-03-26 03:08:00 -08:00
|
|
|
cd byterun; $(MAKE) install
|
2014-04-07 00:06:17 -07:00
|
|
|
cp ocamlc $(INSTALL_BINDIR)/ocamlc$(EXE)
|
|
|
|
cp ocaml $(INSTALL_BINDIR)/ocaml$(EXE)
|
2001-03-26 03:08:00 -08:00
|
|
|
cd stdlib; $(MAKE) install
|
2014-04-07 00:06:17 -07:00
|
|
|
cp lex/ocamllex $(INSTALL_BINDIR)/ocamllex$(EXE)
|
2015-07-17 07:31:05 -07:00
|
|
|
cp $(CAMLYACC)$(EXE) $(INSTALL_BINDIR)/ocamlyacc$(EXE)
|
2015-01-24 08:35:29 -08:00
|
|
|
cp utils/*.cmi utils/*.cmt utils/*.cmti \
|
|
|
|
parsing/*.cmi parsing/*.cmt parsing/*.cmti \
|
|
|
|
typing/*.cmi typing/*.cmt typing/*.cmti \
|
|
|
|
bytecomp/*.cmi bytecomp/*.cmt bytecomp/*.cmti \
|
|
|
|
driver/*.cmi driver/*.cmt driver/*.cmti \
|
|
|
|
toplevel/*.cmi toplevel/*.cmt toplevel/*.cmti $(INSTALL_COMPLIBDIR)
|
2013-03-22 11:20:45 -07:00
|
|
|
cp compilerlibs/ocamlcommon.cma compilerlibs/ocamlbytecomp.cma \
|
|
|
|
compilerlibs/ocamltoplevel.cma $(BYTESTART) $(TOPLEVELSTART) \
|
2014-04-07 00:06:17 -07:00
|
|
|
$(INSTALL_COMPLIBDIR)
|
|
|
|
cp expunge $(INSTALL_LIBDIR)/expunge$(EXE)
|
|
|
|
cp toplevel/topdirs.cmi $(INSTALL_LIBDIR)
|
2001-03-26 03:08:00 -08:00
|
|
|
cd tools; $(MAKE) install
|
2009-04-06 15:23:23 -07:00
|
|
|
-cd man; $(MAKE) install
|
2001-10-19 06:24:39 -07:00
|
|
|
for i in $(OTHERLIBRARIES); do \
|
2010-01-22 04:48:24 -08:00
|
|
|
(cd otherlibs/$$i; $(MAKE) install) || exit $$?; \
|
|
|
|
done
|
2013-07-28 08:52:17 -07:00
|
|
|
if test -n "$(WITH_OCAMLDOC)"; then (cd ocamldoc; $(MAKE) install); else :; fi
|
2013-12-12 09:38:43 -08:00
|
|
|
if test -n "$(WITH_DEBUGGER)"; then (cd debugger; $(MAKE) install); \
|
|
|
|
else :; fi
|
|
|
|
if test -n "$(WITH_OCAMLBUILD)"; then (cd ocamlbuild; $(MAKE) install); \
|
2002-01-20 06:44:44 -08:00
|
|
|
else :; fi
|
2014-04-07 00:06:17 -07:00
|
|
|
cp config/Makefile $(INSTALL_LIBDIR)/Makefile.config
|
2013-12-12 09:38:43 -08:00
|
|
|
if test -f ocamlopt; then $(MAKE) installopt; else :; fi
|
2001-03-26 03:08:00 -08:00
|
|
|
|
|
|
|
# Installation of the native-code compiler
|
|
|
|
installopt:
|
|
|
|
cd asmrun; $(MAKE) install
|
2014-04-07 00:06:17 -07:00
|
|
|
cp ocamlopt $(INSTALL_BINDIR)/ocamlopt$(EXE)
|
2001-03-26 03:08:00 -08:00
|
|
|
cd stdlib; $(MAKE) installopt
|
2015-01-24 08:35:29 -08:00
|
|
|
cp asmcomp/*.cmi asmcomp/*.cmt asmcomp/*.cmti $(INSTALL_COMPLIBDIR)
|
2014-04-07 00:06:17 -07:00
|
|
|
cp compilerlibs/ocamloptcomp.cma $(OPTSTART) $(INSTALL_COMPLIBDIR)
|
2013-07-28 14:08:13 -07:00
|
|
|
if test -n "$(WITH_OCAMLDOC)"; then (cd ocamldoc; $(MAKE) installopt); \
|
2013-07-28 08:52:17 -07:00
|
|
|
else :; fi
|
2013-12-12 09:38:43 -08:00
|
|
|
if test -n "$(WITH_OCAMLBUILD)"; then (cd ocamlbuild; $(MAKE) installopt); \
|
|
|
|
else :; fi
|
2007-11-22 11:01:50 -08:00
|
|
|
for i in $(OTHERLIBRARIES); \
|
|
|
|
do (cd otherlibs/$$i; $(MAKE) installopt) || exit $$?; done
|
2012-05-17 09:04:13 -07:00
|
|
|
if test -f ocamlopt.opt ; then $(MAKE) installoptopt; fi
|
2012-07-26 12:21:54 -07:00
|
|
|
cd tools; $(MAKE) installopt
|
2012-05-17 09:04:13 -07:00
|
|
|
|
|
|
|
installoptopt:
|
2014-04-07 00:06:17 -07:00
|
|
|
cp ocamlc.opt $(INSTALL_BINDIR)/ocamlc.opt$(EXE)
|
|
|
|
cp ocamlopt.opt $(INSTALL_BINDIR)/ocamlopt.opt$(EXE)
|
|
|
|
cp lex/ocamllex.opt $(INSTALL_BINDIR)/ocamllex.opt$(EXE)
|
2012-05-17 09:04:13 -07:00
|
|
|
cp compilerlibs/ocamlcommon.cmxa compilerlibs/ocamlcommon.a \
|
2013-02-12 00:14:24 -08: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) \
|
2014-04-07 00:06:17 -07:00
|
|
|
$(INSTALL_COMPLIBDIR)
|
|
|
|
cd $(INSTALL_COMPLIBDIR) && $(RANLIB) ocamlcommon.a ocamlbytecomp.a \
|
2013-03-22 11:20:45 -07:00
|
|
|
ocamloptcomp.a
|
2001-03-26 03:08:00 -08:00
|
|
|
|
2014-10-15 06:34:58 -07:00
|
|
|
# Run all tests
|
|
|
|
|
|
|
|
tests: opt.opt
|
|
|
|
cd testsuite; $(MAKE) clean && $(MAKE) all
|
|
|
|
|
|
|
|
# The clean target
|
|
|
|
|
2001-03-26 03:08:00 -08:00
|
|
|
clean:: partialclean
|
|
|
|
|
2012-05-17 09:04:13 -07:00
|
|
|
# Shared parts of the system
|
|
|
|
|
|
|
|
compilerlibs/ocamlcommon.cma: $(COMMON)
|
2014-08-06 04:58:03 -07:00
|
|
|
$(CAMLC) -a -linkall -o $@ $(COMMON)
|
2012-05-17 09:04:13 -07:00
|
|
|
partialclean::
|
|
|
|
rm -f compilerlibs/ocamlcommon.cma
|
|
|
|
|
|
|
|
# The bytecode compiler
|
|
|
|
|
|
|
|
compilerlibs/ocamlbytecomp.cma: $(BYTECOMP)
|
|
|
|
$(CAMLC) -a -o $@ $(BYTECOMP)
|
|
|
|
partialclean::
|
|
|
|
rm -f compilerlibs/ocamlbytecomp.cma
|
2001-03-26 03:08:00 -08:00
|
|
|
|
2012-05-17 09:04:13 -07:00
|
|
|
ocamlc: compilerlibs/ocamlcommon.cma compilerlibs/ocamlbytecomp.cma $(BYTESTART)
|
2013-04-18 04:58:59 -07:00
|
|
|
$(CAMLC) $(LINKFLAGS) -compat-32 -o ocamlc \
|
2013-02-12 00:14:24 -08:00
|
|
|
compilerlibs/ocamlcommon.cma compilerlibs/ocamlbytecomp.cma $(BYTESTART)
|
2001-03-26 03:08:00 -08:00
|
|
|
|
|
|
|
# The native-code compiler
|
|
|
|
|
2012-05-17 09:04:13 -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 \
|
2013-02-12 00:14:24 -08:00
|
|
|
compilerlibs/ocamlcommon.cma compilerlibs/ocamloptcomp.cma $(OPTSTART)
|
2001-03-26 03:08:00 -08:00
|
|
|
|
|
|
|
partialclean::
|
2014-04-02 09:20:38 -07:00
|
|
|
rm -f ocamlopt
|
2001-03-26 03:08:00 -08:00
|
|
|
|
|
|
|
# The toplevel
|
|
|
|
|
2012-05-17 09:04:13 -07:00
|
|
|
compilerlibs/ocamltoplevel.cma: $(TOPLEVEL)
|
|
|
|
$(CAMLC) -a -o $@ $(TOPLEVEL)
|
|
|
|
partialclean::
|
|
|
|
rm -f compilerlibs/ocamltoplevel.cma
|
|
|
|
|
2013-03-22 11:20:45 -07:00
|
|
|
ocaml: compilerlibs/ocamlcommon.cma compilerlibs/ocamlbytecomp.cma \
|
|
|
|
compilerlibs/ocamltoplevel.cma $(TOPLEVELSTART) expunge
|
2012-05-17 09:04:13 -07:00
|
|
|
$(CAMLC) $(LINKFLAGS) -linkall -o ocaml.tmp \
|
2013-02-12 00:14:24 -08:00
|
|
|
compilerlibs/ocamlcommon.cma compilerlibs/ocamlbytecomp.cma \
|
|
|
|
compilerlibs/ocamltoplevel.cma $(TOPLEVELSTART)
|
2002-11-20 21:24:38 -08:00
|
|
|
- $(CAMLRUN) ./expunge ocaml.tmp ocaml $(PERVASIVES)
|
2001-03-26 03:08:00 -08:00
|
|
|
rm -f ocaml.tmp
|
|
|
|
|
|
|
|
partialclean::
|
2012-05-17 09:04:13 -07:00
|
|
|
rm -f ocaml
|
2001-03-26 03:08:00 -08:00
|
|
|
|
2015-12-09 23:27:20 -08:00
|
|
|
RUNTOP=./byterun/ocamlrun ./ocaml -nostdlib -I stdlib -noinit $(TOPFLAGS)
|
|
|
|
|
|
|
|
runtop:
|
|
|
|
$(MAKE) runtime
|
|
|
|
$(MAKE) coreall
|
|
|
|
$(MAKE) ocaml
|
|
|
|
@rlwrap --help 2>/dev/null && rlwrap $(RUNTOP) || $(RUNTOP)
|
|
|
|
|
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-22 11:01:50 -08:00
|
|
|
$(CAMLOPT) $(LINKFLAGS) otherlibs/dynlink/dynlink.cmxa -o ocamlnat \
|
2013-03-22 11:20:45 -07:00
|
|
|
$(NATTOPOBJS:.cmo=.cmx) -linkall
|
2007-11-06 07:16:56 -08:00
|
|
|
|
|
|
|
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
|
|
|
|
2001-03-26 03:08:00 -08:00
|
|
|
# The configuration file
|
|
|
|
|
|
|
|
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%%|$(BINDIR)/ocamlrun|' \
|
|
|
|
-e 's|%%CCOMPTYPE%%|cc|' \
|
|
|
|
-e 's|%%BYTECC%%|$(BYTECC) $(BYTECCCOMPOPTS) $(SHAREDCCCOMPOPTS)|' \
|
|
|
|
-e 's|%%NATIVECC%%|$(NATIVECC) $(NATIVECCCOMPOPTS)|' \
|
2015-09-11 04:58:31 -07:00
|
|
|
-e '/c_compiler =/s| -Werror||' \
|
2010-01-22 04:48:24 -08:00
|
|
|
-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|%%CC_PROFILE%%|$(CC_PROFILE)|' \
|
|
|
|
-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%%|.so|' \
|
|
|
|
-e 's|%%SYSTHREAD_SUPPORT%%|$(SYSTHREAD_SUPPORT)|' \
|
|
|
|
-e 's|%%ASM%%|$(ASM)|' \
|
2012-02-21 09:41:02 -08:00
|
|
|
-e 's|%%ASM_CFI_SUPPORTED%%|$(ASM_CFI_SUPPORTED)|' \
|
2013-06-03 11:03:59 -07:00
|
|
|
-e 's|%%WITH_FRAME_POINTERS%%|$(WITH_FRAME_POINTERS)|' \
|
2010-01-22 04:48:24 -08:00
|
|
|
-e 's|%%MKDLL%%|$(MKDLL)|' \
|
|
|
|
-e 's|%%MKEXE%%|$(MKEXE)|' \
|
|
|
|
-e 's|%%MKMAINDLL%%|$(MKMAINDLL)|' \
|
2013-07-01 14:33:21 -07:00
|
|
|
-e 's|%%HOST%%|$(HOST)|' \
|
|
|
|
-e 's|%%TARGET%%|$(TARGET)|' \
|
2010-01-22 04:48:24 -08:00
|
|
|
utils/config.mlp > utils/config.ml
|
2001-03-26 03:08:00 -08:00
|
|
|
|
|
|
|
partialclean::
|
|
|
|
rm -f utils/config.ml
|
|
|
|
|
|
|
|
beforedepend:: utils/config.ml
|
|
|
|
|
|
|
|
# The parser
|
|
|
|
|
|
|
|
parsing/parser.mli parsing/parser.ml: parsing/parser.mly
|
|
|
|
$(CAMLYACC) $(YACCFLAGS) parsing/parser.mly
|
|
|
|
|
|
|
|
partialclean::
|
|
|
|
rm -f parsing/parser.mli parsing/parser.ml parsing/parser.output
|
|
|
|
|
|
|
|
beforedepend:: parsing/parser.mli parsing/parser.ml
|
|
|
|
|
|
|
|
# The lexer
|
|
|
|
|
|
|
|
parsing/lexer.ml: parsing/lexer.mll
|
|
|
|
$(CAMLLEX) parsing/lexer.mll
|
|
|
|
|
|
|
|
partialclean::
|
|
|
|
rm -f parsing/lexer.ml
|
|
|
|
|
|
|
|
beforedepend:: parsing/lexer.ml
|
|
|
|
|
2012-05-17 09:04:13 -07:00
|
|
|
# Shared parts of the system compiled with the native-code compiler
|
|
|
|
|
|
|
|
compilerlibs/ocamlcommon.cmxa: $(COMMON:.cmo=.cmx)
|
2014-08-06 04:58:03 -07:00
|
|
|
$(CAMLOPT) -a -linkall -o $@ $(COMMON:.cmo=.cmx)
|
2012-05-17 09:04:13 -07:00
|
|
|
partialclean::
|
|
|
|
rm -f compilerlibs/ocamlcommon.cmxa compilerlibs/ocamlcommon.a
|
|
|
|
|
2001-03-26 03:08:00 -08:00
|
|
|
# The bytecode compiler compiled with the native-code compiler
|
|
|
|
|
2012-05-17 09:04:13 -07:00
|
|
|
compilerlibs/ocamlbytecomp.cmxa: $(BYTECOMP:.cmo=.cmx)
|
|
|
|
$(CAMLOPT) -a -o $@ $(BYTECOMP:.cmo=.cmx)
|
|
|
|
partialclean::
|
|
|
|
rm -f compilerlibs/ocamlbytecomp.cmxa compilerlibs/ocamlbytecomp.a
|
|
|
|
|
2013-03-22 11:20:45 -07:00
|
|
|
ocamlc.opt: compilerlibs/ocamlcommon.cmxa compilerlibs/ocamlbytecomp.cmxa \
|
|
|
|
$(BYTESTART:.cmo=.cmx)
|
2001-08-30 02:02:55 -07:00
|
|
|
$(CAMLOPT) $(LINKFLAGS) -ccopt "$(BYTECCLINKOPTS)" -o ocamlc.opt \
|
2013-02-12 00:14:24 -08:00
|
|
|
compilerlibs/ocamlcommon.cmxa compilerlibs/ocamlbytecomp.cmxa \
|
|
|
|
$(BYTESTART:.cmo=.cmx) -cclib "$(BYTECCLIBS)"
|
2001-03-26 03:08:00 -08:00
|
|
|
|
|
|
|
partialclean::
|
|
|
|
rm -f ocamlc.opt
|
|
|
|
|
|
|
|
# The native-code compiler compiled with itself
|
|
|
|
|
2012-05-17 09:04:13 -07:00
|
|
|
compilerlibs/ocamloptcomp.cmxa: $(ASMCOMP:.cmo=.cmx)
|
|
|
|
$(CAMLOPT) -a -o $@ $(ASMCOMP:.cmo=.cmx)
|
|
|
|
partialclean::
|
|
|
|
rm -f compilerlibs/ocamloptcomp.cmxa compilerlibs/ocamloptcomp.a
|
|
|
|
|
2013-03-22 11:20:45 -07:00
|
|
|
ocamlopt.opt: compilerlibs/ocamlcommon.cmxa compilerlibs/ocamloptcomp.cmxa \
|
|
|
|
$(OPTSTART:.cmo=.cmx)
|
2012-05-17 09:04:13 -07:00
|
|
|
$(CAMLOPT) $(LINKFLAGS) -o ocamlopt.opt \
|
2013-02-12 00:14:24 -08:00
|
|
|
compilerlibs/ocamlcommon.cmxa compilerlibs/ocamloptcomp.cmxa \
|
|
|
|
$(OPTSTART:.cmo=.cmx)
|
2001-03-26 03:08:00 -08:00
|
|
|
|
|
|
|
partialclean::
|
2012-04-22 09:11:51 -07:00
|
|
|
rm -f ocamlopt.opt
|
2001-03-26 03:08:00 -08:00
|
|
|
|
2012-05-17 09:04:13 -07:00
|
|
|
$(COMMON:.cmo=.cmx) $(BYTECOMP:.cmo=.cmx) $(ASMCOMP:.cmo=.cmx): ocamlopt
|
2001-03-26 03:08:00 -08:00
|
|
|
|
|
|
|
# The numeric opcodes
|
|
|
|
|
2014-12-27 06:41:49 -08:00
|
|
|
bytecomp/opcodes.ml: byterun/caml/instruct.h
|
|
|
|
sed -n -e '/^enum/p' -e 's/,//g' -e '/^ /p' byterun/caml/instruct.h | \
|
2010-01-22 04:48:24 -08:00
|
|
|
awk -f tools/make-opcodes > bytecomp/opcodes.ml
|
2001-03-26 03:08:00 -08:00
|
|
|
|
|
|
|
partialclean::
|
|
|
|
rm -f bytecomp/opcodes.ml
|
|
|
|
|
|
|
|
beforedepend:: bytecomp/opcodes.ml
|
|
|
|
|
|
|
|
# The predefined exceptions and primitives
|
|
|
|
|
|
|
|
byterun/primitives:
|
|
|
|
cd byterun; $(MAKE) primitives
|
|
|
|
|
2014-12-27 06:41:49 -08:00
|
|
|
bytecomp/runtimedef.ml: byterun/primitives byterun/caml/fail.h
|
2001-03-26 03:08:00 -08:00
|
|
|
(echo 'let builtin_exceptions = [|'; \
|
2014-12-27 06:41:49 -08:00
|
|
|
sed -n -e 's|.*/\* \("[A-Za-z_]*"\) \*/$$| \1;|p' byterun/caml/fail.h | \
|
2001-03-26 03:08:00 -08:00
|
|
|
sed -e '$$s/;$$//'; \
|
2010-01-22 04:48:24 -08:00
|
|
|
echo '|]'; \
|
|
|
|
echo 'let builtin_primitives = [|'; \
|
|
|
|
sed -e 's/.*/ "&";/' -e '$$s/;$$//' byterun/primitives; \
|
2001-03-26 03:08:00 -08:00
|
|
|
echo '|]') > bytecomp/runtimedef.ml
|
|
|
|
|
|
|
|
partialclean::
|
|
|
|
rm -f bytecomp/runtimedef.ml
|
|
|
|
|
|
|
|
beforedepend:: bytecomp/runtimedef.ml
|
|
|
|
|
|
|
|
# Choose the right machine-dependent files
|
|
|
|
|
|
|
|
asmcomp/arch.ml: asmcomp/$(ARCH)/arch.ml
|
|
|
|
ln -s $(ARCH)/arch.ml asmcomp/arch.ml
|
|
|
|
|
|
|
|
partialclean::
|
|
|
|
rm -f asmcomp/arch.ml
|
|
|
|
|
|
|
|
beforedepend:: asmcomp/arch.ml
|
|
|
|
|
|
|
|
asmcomp/proc.ml: asmcomp/$(ARCH)/proc.ml
|
|
|
|
ln -s $(ARCH)/proc.ml asmcomp/proc.ml
|
|
|
|
|
|
|
|
partialclean::
|
|
|
|
rm -f asmcomp/proc.ml
|
|
|
|
|
|
|
|
beforedepend:: asmcomp/proc.ml
|
|
|
|
|
|
|
|
asmcomp/selection.ml: asmcomp/$(ARCH)/selection.ml
|
|
|
|
ln -s $(ARCH)/selection.ml asmcomp/selection.ml
|
|
|
|
|
|
|
|
partialclean::
|
|
|
|
rm -f asmcomp/selection.ml
|
|
|
|
|
|
|
|
beforedepend:: asmcomp/selection.ml
|
|
|
|
|
2014-04-26 03:40:22 -07:00
|
|
|
asmcomp/CSE.ml: asmcomp/$(ARCH)/CSE.ml
|
|
|
|
ln -s $(ARCH)/CSE.ml asmcomp/CSE.ml
|
|
|
|
|
|
|
|
partialclean::
|
|
|
|
rm -f asmcomp/CSE.ml
|
|
|
|
|
|
|
|
beforedepend:: asmcomp/CSE.ml
|
|
|
|
|
2001-03-26 03:08:00 -08:00
|
|
|
asmcomp/reload.ml: asmcomp/$(ARCH)/reload.ml
|
|
|
|
ln -s $(ARCH)/reload.ml asmcomp/reload.ml
|
|
|
|
|
|
|
|
partialclean::
|
|
|
|
rm -f asmcomp/reload.ml
|
|
|
|
|
|
|
|
beforedepend:: asmcomp/reload.ml
|
|
|
|
|
|
|
|
asmcomp/scheduling.ml: asmcomp/$(ARCH)/scheduling.ml
|
|
|
|
ln -s $(ARCH)/scheduling.ml asmcomp/scheduling.ml
|
|
|
|
|
|
|
|
partialclean::
|
|
|
|
rm -f asmcomp/scheduling.ml
|
|
|
|
|
|
|
|
beforedepend:: asmcomp/scheduling.ml
|
|
|
|
|
|
|
|
# Preprocess the code emitters
|
|
|
|
|
|
|
|
asmcomp/emit.ml: asmcomp/$(ARCH)/emit.mlp tools/cvt_emit
|
2014-10-07 23:59:27 -07:00
|
|
|
echo \# 1 \"$(ARCH)/emit.mlp\" > asmcomp/emit.ml
|
|
|
|
$(CAMLRUN) tools/cvt_emit < asmcomp/$(ARCH)/emit.mlp >> asmcomp/emit.ml \
|
2010-01-22 04:48:24 -08:00
|
|
|
|| { rm -f asmcomp/emit.ml; exit 2; }
|
2001-03-26 03:08:00 -08:00
|
|
|
|
|
|
|
partialclean::
|
|
|
|
rm -f asmcomp/emit.ml
|
|
|
|
|
|
|
|
beforedepend:: asmcomp/emit.ml
|
|
|
|
|
|
|
|
tools/cvt_emit: tools/cvt_emit.mll
|
2015-07-17 07:31:05 -07:00
|
|
|
cd tools && $(MAKE) cvt_emit
|
2001-03-26 03:08:00 -08:00
|
|
|
|
|
|
|
# The "expunge" utility
|
|
|
|
|
2013-03-22 11:20:45 -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
|
2001-03-26 03:08:00 -08:00
|
|
|
|
|
|
|
partialclean::
|
|
|
|
rm -f expunge
|
|
|
|
|
|
|
|
# The runtime system for the bytecode compiler
|
|
|
|
|
|
|
|
runtime:
|
|
|
|
cd byterun; $(MAKE) all
|
|
|
|
if test -f stdlib/libcamlrun.a; then :; else \
|
2010-01-22 04:48:24 -08:00
|
|
|
ln -s ../byterun/libcamlrun.a stdlib/libcamlrun.a; fi
|
2007-11-22 11:01:50 -08:00
|
|
|
|
2001-03-26 03:08:00 -08:00
|
|
|
clean::
|
|
|
|
cd byterun; $(MAKE) clean
|
|
|
|
rm -f stdlib/libcamlrun.a
|
2001-03-30 04:21:13 -08:00
|
|
|
rm -f stdlib/caml
|
2007-11-22 11:01:50 -08:00
|
|
|
|
2001-03-26 03:08:00 -08:00
|
|
|
alldepend::
|
|
|
|
cd byterun; $(MAKE) depend
|
|
|
|
|
|
|
|
# The runtime system for the native-code compiler
|
|
|
|
|
2010-01-20 08:26:46 -08:00
|
|
|
runtimeopt: makeruntimeopt
|
|
|
|
cp asmrun/libasmrun.a stdlib/libasmrun.a
|
|
|
|
|
|
|
|
makeruntimeopt:
|
2001-03-26 03:08:00 -08:00
|
|
|
cd asmrun; $(MAKE) all
|
2007-11-22 11:01:50 -08:00
|
|
|
|
2001-03-26 03:08:00 -08:00
|
|
|
clean::
|
|
|
|
cd asmrun; $(MAKE) clean
|
|
|
|
rm -f stdlib/libasmrun.a
|
2007-11-22 11:01:50 -08:00
|
|
|
|
2001-03-26 03:08:00 -08:00
|
|
|
alldepend::
|
|
|
|
cd asmrun; $(MAKE) depend
|
|
|
|
|
|
|
|
# The library
|
|
|
|
|
|
|
|
library: ocamlc
|
|
|
|
cd stdlib; $(MAKE) all
|
2007-11-22 11:01:50 -08:00
|
|
|
|
2001-03-26 03:08:00 -08:00
|
|
|
library-cross:
|
2015-07-17 07:31:05 -07:00
|
|
|
cd stdlib; $(MAKE) CAMLRUN=../byterun/ocamlrun all
|
2007-11-22 11:01:50 -08:00
|
|
|
|
2001-03-26 03:08:00 -08:00
|
|
|
libraryopt:
|
|
|
|
cd stdlib; $(MAKE) allopt
|
2007-11-22 11:01:50 -08:00
|
|
|
|
2001-03-26 03:08:00 -08:00
|
|
|
partialclean::
|
|
|
|
cd stdlib; $(MAKE) clean
|
2007-11-22 11:01:50 -08:00
|
|
|
|
2001-03-26 03:08:00 -08:00
|
|
|
alldepend::
|
|
|
|
cd stdlib; $(MAKE) depend
|
|
|
|
|
|
|
|
# The lexer and parser generators
|
|
|
|
|
|
|
|
ocamllex: ocamlyacc ocamlc
|
|
|
|
cd lex; $(MAKE) all
|
2007-11-22 11:01:50 -08:00
|
|
|
|
2001-03-26 03:08:00 -08:00
|
|
|
ocamllex.opt: ocamlopt
|
|
|
|
cd lex; $(MAKE) allopt
|
2007-11-22 11:01:50 -08:00
|
|
|
|
2001-03-26 03:08:00 -08:00
|
|
|
partialclean::
|
|
|
|
cd lex; $(MAKE) clean
|
2007-11-22 11:01:50 -08:00
|
|
|
|
2001-03-26 03:08:00 -08:00
|
|
|
alldepend::
|
|
|
|
cd lex; $(MAKE) depend
|
|
|
|
|
|
|
|
ocamlyacc:
|
|
|
|
cd yacc; $(MAKE) all
|
2007-11-22 11:01:50 -08:00
|
|
|
|
2001-03-26 03:08:00 -08:00
|
|
|
clean::
|
|
|
|
cd yacc; $(MAKE) clean
|
|
|
|
|
|
|
|
# Tools
|
|
|
|
|
2014-04-12 03:17:02 -07:00
|
|
|
ocamltools: ocamlc ocamlyacc ocamllex asmcomp/cmx_format.cmi \
|
|
|
|
asmcomp/printclambda.cmo
|
2001-03-26 03:08:00 -08:00
|
|
|
cd tools; $(MAKE) all
|
2007-11-22 11:01:50 -08:00
|
|
|
|
2012-07-26 12:21:54 -07:00
|
|
|
ocamltoolsopt: ocamlopt
|
|
|
|
cd tools; $(MAKE) opt
|
|
|
|
|
2014-04-12 03:17:02 -07:00
|
|
|
ocamltoolsopt.opt: ocamlc.opt ocamlyacc ocamllex asmcomp/cmx_format.cmi \
|
|
|
|
asmcomp/printclambda.cmx
|
2002-03-18 08:44:34 -08:00
|
|
|
cd tools; $(MAKE) opt.opt
|
2007-11-22 11:01:50 -08:00
|
|
|
|
2001-03-26 03:08:00 -08:00
|
|
|
partialclean::
|
|
|
|
cd tools; $(MAKE) clean
|
2007-11-22 11:01:50 -08:00
|
|
|
|
2001-03-26 03:08:00 -08:00
|
|
|
alldepend::
|
|
|
|
cd tools; $(MAKE) depend
|
|
|
|
|
2002-03-29 03:39:38 -08:00
|
|
|
# OCamldoc
|
|
|
|
|
2007-11-22 11:01:50 -08:00
|
|
|
ocamldoc: ocamlc ocamlyacc ocamllex otherlibraries
|
2002-04-11 05:30:08 -07:00
|
|
|
cd ocamldoc && $(MAKE) all
|
2007-11-22 11:01:50 -08:00
|
|
|
|
2002-03-29 03:39:38 -08:00
|
|
|
ocamldoc.opt: ocamlc.opt ocamlyacc ocamllex
|
2002-04-11 05:30:08 -07:00
|
|
|
cd ocamldoc && $(MAKE) opt.opt
|
2007-11-22 11:01:50 -08:00
|
|
|
|
2014-04-19 02:05:32 -07:00
|
|
|
# Documentation
|
|
|
|
|
|
|
|
html_doc: ocamldoc
|
|
|
|
make -C ocamldoc html_doc
|
|
|
|
@echo "documentation is in ./ocamldoc/stdlib_html/"
|
|
|
|
|
2002-03-29 03:39:38 -08:00
|
|
|
partialclean::
|
2002-04-11 05:30:08 -07:00
|
|
|
cd ocamldoc && $(MAKE) clean
|
2007-11-22 11:01:50 -08:00
|
|
|
|
2002-03-29 03:39:38 -08:00
|
|
|
alldepend::
|
2002-04-11 05:30:08 -07:00
|
|
|
cd ocamldoc && $(MAKE) depend
|
2002-03-29 03:39:38 -08:00
|
|
|
|
2001-03-26 03:08:00 -08:00
|
|
|
# The extra libraries
|
|
|
|
|
2007-11-22 11:01:50 -08:00
|
|
|
otherlibraries: ocamltools
|
2001-10-19 06:24:39 -07:00
|
|
|
for i in $(OTHERLIBRARIES); do \
|
2015-07-17 07:31:05 -07:00
|
|
|
(cd otherlibs/$$i; $(MAKE) all) || exit $$?; \
|
2010-01-22 04:48:24 -08:00
|
|
|
done
|
2007-11-22 11:01:50 -08:00
|
|
|
|
2001-03-26 03:08:00 -08:00
|
|
|
otherlibrariesopt:
|
2001-10-19 06:24:39 -07:00
|
|
|
for i in $(OTHERLIBRARIES); do \
|
2010-01-22 04:48:24 -08:00
|
|
|
(cd otherlibs/$$i; $(MAKE) allopt) || exit $$?; \
|
|
|
|
done
|
2007-11-22 11:01:50 -08:00
|
|
|
|
2001-03-26 03:08:00 -08:00
|
|
|
partialclean::
|
2001-10-19 06:24:39 -07:00
|
|
|
for i in $(OTHERLIBRARIES); do \
|
2013-09-12 08:21:52 -07:00
|
|
|
(cd otherlibs/$$i && $(MAKE) partialclean); \
|
2010-01-22 04:48:24 -08:00
|
|
|
done
|
2007-11-22 11:01:50 -08:00
|
|
|
|
2001-03-26 03:08:00 -08:00
|
|
|
clean::
|
2013-09-12 08:21:52 -07:00
|
|
|
for i in $(OTHERLIBRARIES); do (cd otherlibs/$$i && $(MAKE) clean); done
|
2007-11-22 11:01:50 -08:00
|
|
|
|
2001-03-26 03:08:00 -08:00
|
|
|
alldepend::
|
|
|
|
for i in $(OTHERLIBRARIES); do (cd otherlibs/$$i; $(MAKE) depend); done
|
|
|
|
|
|
|
|
# The replay debugger
|
|
|
|
|
2007-11-22 11:01:50 -08:00
|
|
|
ocamldebugger: ocamlc ocamlyacc ocamllex otherlibraries
|
2001-03-26 03:08:00 -08:00
|
|
|
cd debugger; $(MAKE) all
|
2007-11-22 11:01:50 -08:00
|
|
|
|
2001-03-26 03:08:00 -08:00
|
|
|
partialclean::
|
|
|
|
cd debugger; $(MAKE) clean
|
2007-11-22 11:01:50 -08:00
|
|
|
|
2001-03-26 03:08:00 -08:00
|
|
|
alldepend::
|
|
|
|
cd debugger; $(MAKE) depend
|
|
|
|
|
2007-02-07 02:31:36 -08:00
|
|
|
# Ocamlbuild
|
2013-12-12 09:38:43 -08:00
|
|
|
|
|
|
|
ocamlbuild.byte: ocamlc otherlibraries
|
|
|
|
cd ocamlbuild && $(MAKE) all
|
|
|
|
|
|
|
|
ocamlbuild.native: ocamlopt otherlibrariesopt
|
|
|
|
cd ocamlbuild && $(MAKE) allopt
|
2007-11-22 11:01:50 -08:00
|
|
|
|
2007-10-08 07:19:34 -07:00
|
|
|
partialclean::
|
2013-12-12 09:38:43 -08:00
|
|
|
cd ocamlbuild && $(MAKE) clean
|
|
|
|
|
|
|
|
alldepend::
|
|
|
|
cd ocamlbuild && $(MAKE) depend
|
2002-11-05 01:25:19 -08:00
|
|
|
|
2002-08-01 06:51:34 -07:00
|
|
|
# Check that the stack limit is reasonable.
|
|
|
|
|
|
|
|
checkstack:
|
2015-02-04 20:28:25 -08:00
|
|
|
@if $(MKEXE) -o tools/checkstack$(EXE) tools/checkstack.c; \
|
|
|
|
then tools/checkstack$(EXE); \
|
2002-08-01 06:51:34 -07:00
|
|
|
else :; \
|
|
|
|
fi
|
|
|
|
@rm -f tools/checkstack
|
|
|
|
|
2012-02-10 07:29:36 -08:00
|
|
|
# Make clean in the test suite
|
|
|
|
|
|
|
|
clean::
|
|
|
|
cd testsuite; $(MAKE) clean
|
|
|
|
|
2002-09-17 06:44:49 -07:00
|
|
|
# Make MacOS X package
|
|
|
|
|
2004-04-22 08:48:36 -07:00
|
|
|
package-macosx:
|
2005-03-24 09:20:54 -08:00
|
|
|
sudo rm -rf package-macosx/root
|
2012-07-10 08:29:19 -07:00
|
|
|
$(MAKE) PREFIX="`pwd`"/package-macosx/root install
|
2003-02-24 09:15:12 -08:00
|
|
|
tools/make-package-macosx
|
2005-03-24 09:20:54 -08:00
|
|
|
sudo rm -rf package-macosx/root
|
|
|
|
|
2003-03-31 08:11:12 -08:00
|
|
|
clean::
|
2005-03-24 09:20:54 -08:00
|
|
|
rm -rf package-macosx/*.pkg package-macosx/*.dmg
|
2002-09-17 06:44:49 -07:00
|
|
|
|
2001-03-26 03:08:00 -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 $<
|
|
|
|
|
|
|
|
partialclean::
|
2009-05-20 04:52:42 -07:00
|
|
|
for d in utils parsing typing bytecomp asmcomp driver toplevel tools; \
|
2014-04-07 03:57:12 -07:00
|
|
|
do rm -f $$d/*.cm[ioxt] $$d/*.cmti $$d/*.annot $$d/*.[so] $$d/*~; done
|
2001-03-26 03:08:00 -08:00
|
|
|
rm -f *~
|
|
|
|
|
|
|
|
depend: beforedepend
|
|
|
|
(for d in utils parsing typing bytecomp asmcomp driver toplevel; \
|
2003-01-28 04:35:24 -08:00
|
|
|
do $(CAMLDEP) $(DEPFLAGS) $$d/*.mli $$d/*.ml; \
|
|
|
|
done) > .depend
|
2001-03-26 03:08:00 -08:00
|
|
|
|
|
|
|
alldepend:: depend
|
|
|
|
|
2007-12-04 03:37:48 -08:00
|
|
|
distclean:
|
2013-12-17 01:58:47 -08:00
|
|
|
$(MAKE) clean
|
|
|
|
rm -f boot/ocamlrun boot/ocamlrun.exe boot/camlheader boot/ocamlyacc \
|
|
|
|
boot/*.cm* boot/libcamlrun.a
|
|
|
|
rm -f config/Makefile config/m.h config/s.h
|
2014-05-12 07:03:04 -07:00
|
|
|
rm -f tools/*.bak
|
2014-04-02 09:20:38 -07:00
|
|
|
rm -f ocaml ocamlc
|
2013-12-17 01:58:47 -08:00
|
|
|
rm -f testsuite/_log
|
2007-12-04 03:37:48 -08:00
|
|
|
|
2013-11-21 08:23:28 -08:00
|
|
|
.PHONY: all backup bootstrap checkstack clean
|
2007-11-22 11:01:50 -08:00
|
|
|
.PHONY: partialclean beforedepend alldepend cleanboot coldstart
|
2007-12-12 06:09:16 -08:00
|
|
|
.PHONY: compare core coreall
|
|
|
|
.PHONY: coreboot defaultentry depend distclean install installopt
|
2012-09-13 06:51:41 -07:00
|
|
|
.PHONY: library library-cross libraryopt
|
2007-11-22 11:01:50 -08:00
|
|
|
.PHONY: ocamlbuild.byte ocamlbuild.native ocamldebugger ocamldoc
|
2013-08-29 05:51:03 -07:00
|
|
|
.PHONY: ocamldoc.opt ocamllex ocamllex.opt ocamltools ocamltoolsopt
|
2012-07-26 12:21:54 -07:00
|
|
|
.PHONY: ocamltoolsopt.opt ocamlyacc opt-core opt opt.opt otherlibraries
|
2007-11-22 11:01:50 -08:00
|
|
|
.PHONY: otherlibrariesopt package-macosx promote promote-cross
|
2010-01-20 08:26:46 -08:00
|
|
|
.PHONY: restore runtime runtimeopt makeruntimeopt world world.opt
|
2001-03-26 03:08:00 -08:00
|
|
|
|
|
|
|
include .depend
|