2001-03-26 03:08:00 -08:00
|
|
|
#########################################################################
|
|
|
|
# #
|
|
|
|
# Objective Caml #
|
|
|
|
# #
|
|
|
|
# Xavier Leroy, projet Cristal, INRIA Rocquencourt #
|
|
|
|
# #
|
|
|
|
# Copyright 1999 Institut National de Recherche en Informatique et #
|
|
|
|
# en Automatique. All rights reserved. This file is distributed #
|
|
|
|
# under the terms of the Q Public License version 1.0. #
|
|
|
|
# #
|
|
|
|
#########################################################################
|
1999-11-17 10:59:06 -08:00
|
|
|
|
2001-03-26 03:08:00 -08:00
|
|
|
# $Id$
|
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
|
|
|
|
2001-03-26 03:08:00 -08:00
|
|
|
include config/Makefile
|
2002-11-17 08:42:12 -08:00
|
|
|
include stdlib/StdlibModules
|
1996-02-13 08:29:09 -08:00
|
|
|
|
2002-05-16 08:08:31 -07:00
|
|
|
CAMLC=boot/ocamlrun boot/ocamlc -nostdlib -I boot
|
2007-11-06 07:16:56 -08:00
|
|
|
CAMLOPT=boot/ocamlrun ./ocamlopt -nostdlib -I stdlib -I otherlibs/dynlink
|
2004-11-29 06:53:32 -08:00
|
|
|
COMPFLAGS=-warn-error A $(INCLUDES)
|
2001-03-26 03:08:00 -08:00
|
|
|
LINKFLAGS=
|
2003-06-30 01:28:48 -07:00
|
|
|
|
2001-03-26 03:08:00 -08:00
|
|
|
CAMLYACC=boot/ocamlyacc
|
|
|
|
YACCFLAGS=-v
|
|
|
|
CAMLLEX=boot/ocamlrun boot/ocamllex
|
|
|
|
CAMLDEP=boot/ocamlrun tools/ocamldep
|
|
|
|
DEPFLAGS=$(INCLUDES)
|
|
|
|
CAMLRUN=byterun/ocamlrun
|
|
|
|
SHELL=/bin/sh
|
|
|
|
MKDIR=mkdir -p
|
|
|
|
|
2002-08-01 06:51:34 -07:00
|
|
|
INCLUDES=-I utils -I parsing -I typing -I bytecomp -I asmcomp -I driver \
|
|
|
|
-I toplevel
|
2001-03-26 03:08:00 -08:00
|
|
|
|
|
|
|
UTILS=utils/misc.cmo utils/tbl.cmo utils/config.cmo \
|
2002-11-17 08:42:12 -08:00
|
|
|
utils/clflags.cmo utils/terminfo.cmo utils/ccomp.cmo utils/warnings.cmo \
|
|
|
|
utils/consistbl.cmo
|
2001-03-26 03:08:00 -08:00
|
|
|
|
|
|
|
OPTUTILS=$(UTILS)
|
|
|
|
|
|
|
|
PARSING=parsing/linenum.cmo parsing/location.cmo parsing/longident.cmo \
|
2001-09-09 04:39:34 -07:00
|
|
|
parsing/syntaxerr.cmo parsing/parser.cmo \
|
2001-03-26 03:08:00 -08:00
|
|
|
parsing/lexer.cmo parsing/parse.cmo parsing/printast.cmo
|
|
|
|
|
2004-11-06 12:17:47 -08:00
|
|
|
TYPING=typing/unused_var.cmo typing/ident.cmo typing/path.cmo \
|
2001-03-26 03:08:00 -08:00
|
|
|
typing/primitive.cmo typing/types.cmo \
|
2002-02-13 03:09:19 -08:00
|
|
|
typing/btype.cmo typing/oprint.cmo \
|
2001-03-26 03:08:00 -08:00
|
|
|
typing/subst.cmo typing/predef.cmo \
|
|
|
|
typing/datarepr.cmo typing/env.cmo \
|
|
|
|
typing/typedtree.cmo typing/ctype.cmo \
|
|
|
|
typing/printtyp.cmo typing/includeclass.cmo \
|
|
|
|
typing/mtype.cmo typing/includecore.cmo \
|
|
|
|
typing/includemod.cmo typing/parmatch.cmo \
|
2003-04-01 17:32:09 -08:00
|
|
|
typing/typetexp.cmo typing/stypes.cmo typing/typecore.cmo \
|
2001-03-26 03:08:00 -08: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 \
|
2001-10-30 01:32:32 -08:00
|
|
|
bytecomp/simplif.cmo bytecomp/runtimedef.cmo
|
2001-03-26 03:08:00 -08:00
|
|
|
|
|
|
|
BYTECOMP=bytecomp/meta.cmo bytecomp/instruct.cmo bytecomp/bytegen.cmo \
|
|
|
|
bytecomp/printinstr.cmo bytecomp/opcodes.cmo bytecomp/emitcode.cmo \
|
2001-08-30 02:02:55 -07:00
|
|
|
bytecomp/bytesections.cmo bytecomp/dll.cmo bytecomp/symtable.cmo \
|
2002-04-03 23:13:58 -08:00
|
|
|
bytecomp/bytelink.cmo bytecomp/bytelibrarian.cmo bytecomp/bytepackager.cmo
|
2001-03-26 03:08:00 -08:00
|
|
|
|
2007-01-29 04:11:18 -08:00
|
|
|
ASMCOMP=asmcomp/arch.cmo asmcomp/debuginfo.cmo \
|
|
|
|
asmcomp/cmm.cmo asmcomp/printcmm.cmo \
|
2001-03-26 03:08:00 -08:00
|
|
|
asmcomp/reg.cmo asmcomp/mach.cmo asmcomp/proc.cmo \
|
|
|
|
asmcomp/clambda.cmo asmcomp/compilenv.cmo \
|
|
|
|
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 \
|
2002-02-08 08:55:44 -08:00
|
|
|
asmcomp/asmlink.cmo asmcomp/asmlibrarian.cmo asmcomp/asmpackager.cmo
|
2001-03-26 03:08:00 -08:00
|
|
|
|
2002-02-08 02:14:31 -08:00
|
|
|
DRIVER=driver/pparse.cmo driver/errors.cmo driver/compile.cmo \
|
|
|
|
driver/main_args.cmo driver/main.cmo
|
2001-03-26 03:08:00 -08:00
|
|
|
|
2002-02-08 02:14:31 -08:00
|
|
|
OPTDRIVER= driver/pparse.cmo driver/opterrors.cmo driver/optcompile.cmo \
|
|
|
|
driver/optmain.cmo
|
2001-03-26 03:08:00 -08:00
|
|
|
|
2002-02-08 02:14:31 -08:00
|
|
|
TOPLEVEL=driver/pparse.cmo driver/errors.cmo driver/compile.cmo \
|
2001-03-26 03:08:00 -08:00
|
|
|
toplevel/genprintval.cmo toplevel/toploop.cmo \
|
2002-04-24 01:02:51 -07:00
|
|
|
toplevel/trace.cmo toplevel/topdirs.cmo toplevel/topmain.cmo
|
2001-03-26 03:08:00 -08:00
|
|
|
|
|
|
|
TOPLEVELLIB=toplevel/toplevellib.cma
|
2002-04-24 01:02:51 -07:00
|
|
|
TOPLEVELSTART=toplevel/topstart.cmo
|
2001-03-26 03:08:00 -08:00
|
|
|
|
|
|
|
COMPOBJS=$(UTILS) $(PARSING) $(TYPING) $(COMP) $(BYTECOMP) $(DRIVER)
|
|
|
|
|
|
|
|
TOPLIB=$(UTILS) $(PARSING) $(TYPING) $(COMP) $(BYTECOMP) $(TOPLEVEL)
|
|
|
|
|
2002-04-24 01:02:51 -07:00
|
|
|
TOPOBJS=$(TOPLEVELLIB) $(TOPLEVELSTART)
|
2001-03-26 03:08:00 -08:00
|
|
|
|
2007-11-06 07:16:56 -08:00
|
|
|
NATTOPOBJS=$(OPTUTILS) $(PARSING) $(TYPING) $(COMP) $(ASMCOMP) \
|
|
|
|
driver/pparse.cmo driver/opterrors.cmo driver/optcompile.cmo \
|
|
|
|
toplevel/genprintval.cmo toplevel/opttoploop.cmo toplevel/opttopdirs.cmo \
|
|
|
|
toplevel/opttopmain.cmo toplevel/opttopstart.cmo
|
|
|
|
|
2001-03-26 03:08:00 -08:00
|
|
|
OPTOBJS=$(OPTUTILS) $(PARSING) $(TYPING) $(COMP) $(ASMCOMP) $(OPTDRIVER)
|
|
|
|
|
|
|
|
EXPUNGEOBJS=utils/misc.cmo utils/tbl.cmo \
|
|
|
|
utils/config.cmo utils/clflags.cmo \
|
|
|
|
typing/ident.cmo typing/path.cmo typing/types.cmo typing/btype.cmo \
|
|
|
|
typing/predef.cmo bytecomp/runtimedef.cmo bytecomp/bytesections.cmo \
|
2004-02-22 07:07:51 -08:00
|
|
|
bytecomp/dll.cmo bytecomp/meta.cmo bytecomp/symtable.cmo toplevel/expunge.cmo
|
2001-03-26 03:08:00 -08:00
|
|
|
|
2002-11-20 21:24:38 -08:00
|
|
|
PERVASIVES=$(STDLIB_MODULES) outcometree topdirs toploop
|
|
|
|
|
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"
|
|
|
|
@echo " make world"
|
|
|
|
@echo " make opt"
|
|
|
|
@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
|
2005-09-24 09:13:29 -07:00
|
|
|
all: runtime ocamlc ocamllex ocamlyacc ocamltools library ocaml \
|
2007-02-07 02:31:36 -08:00
|
|
|
otherlibraries ocamlbuild.byte camlp4out $(DEBUGGER) 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>
|
|
|
|
# make core [cross-compiler]
|
|
|
|
# make partialclean [if you get "inconsistent assumptions"]
|
|
|
|
# <debug your changes>
|
|
|
|
# make core [cross-compiler]
|
|
|
|
# make coreboot [new system -- now you are in a stable state]
|
|
|
|
|
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)
|
|
|
|
cd stdlib; $(MAKE) COMPILER=../boot/ocamlc all
|
|
|
|
cd stdlib; cp $(LIBFILES) ../boot
|
|
|
|
if test -f boot/libcamlrun.a; then :; else \
|
|
|
|
ln -s ../byterun/libcamlrun.a boot/libcamlrun.a; fi
|
|
|
|
if test -d stdlib/caml; then :; else \
|
|
|
|
ln -s ../byterun stdlib/caml; fi
|
|
|
|
|
|
|
|
# Build the core system: the minimum needed to make depend and bootstrap
|
2007-11-22 11:01:50 -08:00
|
|
|
core: coldstart ocamlc ocamllex ocamlyacc ocamltools library
|
2001-03-26 03:08:00 -08:00
|
|
|
|
2007-12-12 06:09:16 -08:00
|
|
|
# Recompile the core system using the bootstrap compiler
|
|
|
|
coreall: ocamlc ocamllex ocamlyacc ocamltools library
|
|
|
|
|
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."; \
|
|
|
|
else echo "Fixpoint not reached, try one more bootstrapping cycle."; \
|
|
|
|
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
|
|
|
|
$(MAKE) otherlibrariesopt
|
2007-11-29 02:35:57 -08:00
|
|
|
$(MAKE) ocamlbuildlib.native
|
2001-03-26 03:08:00 -08:00
|
|
|
|
|
|
|
# Native-code versions of the tools
|
2006-04-16 16:28:22 -07:00
|
|
|
opt.opt: checkstack runtime core ocaml opt-core ocamlc.opt otherlibraries \
|
2007-11-22 11:01:50 -08:00
|
|
|
ocamlbuild.byte camlp4out $(DEBUGGER) ocamldoc ocamlopt.opt \
|
|
|
|
otherlibrariesopt \
|
|
|
|
ocamllex.opt ocamltoolsopt.opt ocamlbuild.native camlp4opt ocamldoc.opt
|
2001-03-26 03:08:00 -08:00
|
|
|
|
|
|
|
# Installation
|
2007-11-22 11:01:50 -08:00
|
|
|
install:
|
2001-03-26 03:08:00 -08:00
|
|
|
if test -d $(BINDIR); then : ; else $(MKDIR) $(BINDIR); fi
|
|
|
|
if test -d $(LIBDIR); then : ; else $(MKDIR) $(LIBDIR); fi
|
2004-08-20 10:04:35 -07:00
|
|
|
if test -d $(STUBLIBDIR); then : ; else $(MKDIR) $(STUBLIBDIR); fi
|
2007-11-22 11:01:50 -08:00
|
|
|
if test -d $(MANDIR)/man$(MANEXT); then : ; \
|
|
|
|
else $(MKDIR) $(MANDIR)/man$(MANEXT); fi
|
2002-08-06 02:06:33 -07:00
|
|
|
cd $(LIBDIR); rm -f dllbigarray.so dlllabltk.so dllnums.so \
|
|
|
|
dllthreads.so dllunix.so dllgraphics.so dllmldbm.so dllstr.so \
|
|
|
|
dlltkanim.so
|
2001-03-26 03:08:00 -08:00
|
|
|
cd byterun; $(MAKE) install
|
|
|
|
cp ocamlc $(BINDIR)/ocamlc$(EXE)
|
|
|
|
cp ocaml $(BINDIR)/ocaml$(EXE)
|
|
|
|
cd stdlib; $(MAKE) install
|
|
|
|
cp lex/ocamllex $(BINDIR)/ocamllex$(EXE)
|
|
|
|
cp yacc/ocamlyacc$(EXE) $(BINDIR)/ocamlyacc$(EXE)
|
|
|
|
cp toplevel/toplevellib.cma $(LIBDIR)/toplevellib.cma
|
|
|
|
cp expunge $(LIBDIR)/expunge$(EXE)
|
2001-08-02 02:21:54 -07:00
|
|
|
cp typing/outcometree.cmi typing/outcometree.mli $(LIBDIR)
|
2002-04-24 01:02:51 -07:00
|
|
|
cp toplevel/topstart.cmo $(LIBDIR)
|
2007-11-22 11:01:50 -08:00
|
|
|
cp toplevel/toploop.cmi toplevel/topdirs.cmi toplevel/topmain.cmi \
|
|
|
|
$(LIBDIR)
|
2001-03-26 03:08:00 -08:00
|
|
|
cd tools; $(MAKE) install
|
|
|
|
-cd man; $(MAKE) install
|
2001-10-19 06:24:39 -07:00
|
|
|
for i in $(OTHERLIBRARIES); do \
|
2001-10-30 01:32:32 -08:00
|
|
|
(cd otherlibs/$$i; $(MAKE) install) || exit $$?; \
|
2001-10-19 06:24:39 -07:00
|
|
|
done
|
2002-03-29 03:39:38 -08:00
|
|
|
cd ocamldoc; $(MAKE) install
|
2001-03-26 03:08:00 -08:00
|
|
|
if test -f ocamlopt; then $(MAKE) installopt; else :; fi
|
2002-01-20 06:44:44 -08:00
|
|
|
if test -f debugger/ocamldebug; then (cd debugger; $(MAKE) install); \
|
|
|
|
else :; fi
|
2005-09-24 09:20:36 -07:00
|
|
|
cp config/Makefile $(LIBDIR)/Makefile.config
|
2007-11-22 11:01:50 -08:00
|
|
|
BINDIR=$(BINDIR) LIBDIR=$(LIBDIR) PREFIX=$(PREFIX) \
|
|
|
|
./build/partial-install.sh
|
2001-03-26 03:08:00 -08:00
|
|
|
|
|
|
|
# Installation of the native-code compiler
|
|
|
|
installopt:
|
|
|
|
cd asmrun; $(MAKE) install
|
|
|
|
cp ocamlopt $(BINDIR)/ocamlopt$(EXE)
|
|
|
|
cd stdlib; $(MAKE) installopt
|
2002-03-29 03:39:38 -08:00
|
|
|
cd ocamldoc; $(MAKE) installopt
|
2007-11-22 11:01:50 -08:00
|
|
|
for i in $(OTHERLIBRARIES); \
|
|
|
|
do (cd otherlibs/$$i; $(MAKE) installopt) || exit $$?; done
|
2002-11-15 08:36:52 -08:00
|
|
|
if test -f ocamlc.opt; \
|
|
|
|
then cp ocamlc.opt $(BINDIR)/ocamlc.opt$(EXE); else :; fi
|
|
|
|
if test -f ocamlopt.opt; \
|
|
|
|
then cp ocamlopt.opt $(BINDIR)/ocamlopt.opt$(EXE); else :; fi
|
|
|
|
if test -f lex/ocamllex.opt; \
|
|
|
|
then cp lex/ocamllex.opt $(BINDIR)/ocamllex.opt$(EXE); else :; fi
|
2001-03-26 03:08:00 -08:00
|
|
|
|
|
|
|
clean:: partialclean
|
|
|
|
|
|
|
|
# The compiler
|
|
|
|
|
|
|
|
ocamlc: $(COMPOBJS)
|
|
|
|
$(CAMLC) $(LINKFLAGS) -o ocamlc $(COMPOBJS)
|
2002-04-27 07:45:33 -07:00
|
|
|
@sed -e 's|@compiler@|$$topdir/boot/ocamlrun $$topdir/ocamlc|' \
|
|
|
|
driver/ocamlcomp.sh.in > ocamlcomp.sh
|
|
|
|
@chmod +x ocamlcomp.sh
|
2001-03-26 03:08:00 -08:00
|
|
|
|
|
|
|
partialclean::
|
2002-04-30 01:31:56 -07:00
|
|
|
rm -f ocamlc ocamlcomp.sh
|
2001-03-26 03:08:00 -08:00
|
|
|
|
|
|
|
# The native-code compiler
|
|
|
|
|
|
|
|
ocamlopt: $(OPTOBJS)
|
|
|
|
$(CAMLC) $(LINKFLAGS) -o ocamlopt $(OPTOBJS)
|
2002-04-27 07:45:33 -07:00
|
|
|
@sed -e 's|@compiler@|$$topdir/boot/ocamlrun $$topdir/ocamlopt|' \
|
|
|
|
driver/ocamlcomp.sh.in > ocamlcompopt.sh
|
|
|
|
@chmod +x ocamlcompopt.sh
|
2001-03-26 03:08:00 -08:00
|
|
|
|
|
|
|
partialclean::
|
2002-04-30 01:31:56 -07:00
|
|
|
rm -f ocamlopt ocamlcompopt.sh
|
2001-03-26 03:08:00 -08:00
|
|
|
|
|
|
|
# The toplevel
|
|
|
|
|
|
|
|
ocaml: $(TOPOBJS) expunge
|
|
|
|
$(CAMLC) $(LINKFLAGS) -linkall -o ocaml.tmp $(TOPOBJS)
|
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
|
|
|
|
|
|
|
|
toplevel/toplevellib.cma: $(TOPLIB)
|
|
|
|
$(CAMLC) -a -o $@ $(TOPLIB)
|
|
|
|
|
|
|
|
partialclean::
|
|
|
|
rm -f ocaml toplevel/toplevellib.cma
|
|
|
|
|
2007-11-06 07:16:56 -08:00
|
|
|
# The native toplevel
|
|
|
|
|
|
|
|
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 \
|
|
|
|
$(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
|
|
|
|
cd otherlibs/dynlink && make allopt
|
|
|
|
|
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)|' \
|
|
|
|
-e 's|%%BYTERUN%%|$(BINDIR)/ocamlrun|' \
|
2002-06-07 02:49:45 -07:00
|
|
|
-e 's|%%CCOMPTYPE%%|cc|' \
|
2001-09-06 01:52:32 -07:00
|
|
|
-e 's|%%BYTECC%%|$(BYTECC) $(BYTECCCOMPOPTS) $(SHAREDCCCOMPOPTS)|' \
|
2001-03-26 03:08:00 -08:00
|
|
|
-e 's|%%NATIVECC%%|$(NATIVECC) $(NATIVECCCOMPOPTS)|' \
|
2007-11-27 04:29:31 -08:00
|
|
|
-e 's|%%PACKLD%%|$(PACKLD)|' \
|
2001-03-26 03:08:00 -08:00
|
|
|
-e 's|%%BYTECCLIBS%%|$(BYTECCLIBS)|' \
|
|
|
|
-e 's|%%NATIVECCLIBS%%|$(NATIVECCLIBS)|' \
|
|
|
|
-e 's|%%RANLIBCMD%%|$(RANLIBCMD)|' \
|
2002-12-02 04:31:19 -08:00
|
|
|
-e 's|%%CC_PROFILE%%|$(CC_PROFILE)|' \
|
2001-03-26 03:08:00 -08:00
|
|
|
-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|' \
|
2001-08-28 07:47:48 -07:00
|
|
|
-e 's|%%EXT_DLL%%|.so|' \
|
2005-05-09 06:39:17 -07:00
|
|
|
-e 's|%%SYSTHREAD_SUPPORT%%|$(SYSTHREAD_SUPPORT)|' \
|
2007-10-30 05:37:16 -07:00
|
|
|
-e 's|%%ASM%%|$(ASM)|' \
|
2007-11-15 05:21:15 -08:00
|
|
|
-e 's|%%MKDLL%%|$(MKDLL)|' \
|
|
|
|
-e 's|%%MKEXE%%|$(MKEXE)|' \
|
2007-11-15 07:18:28 -08:00
|
|
|
-e 's|%%MKMAINDLL%%|$(MKMAINDLL)|' \
|
2001-03-26 03:08:00 -08:00
|
|
|
utils/config.mlp > utils/config.ml
|
|
|
|
@chmod -w utils/config.ml
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
# The auxiliary lexer for counting line numbers
|
|
|
|
|
|
|
|
parsing/linenum.ml: parsing/linenum.mll
|
|
|
|
$(CAMLLEX) parsing/linenum.mll
|
|
|
|
|
|
|
|
partialclean::
|
|
|
|
rm -f parsing/linenum.ml
|
|
|
|
|
|
|
|
beforedepend:: parsing/linenum.ml
|
|
|
|
|
|
|
|
# The bytecode compiler compiled with the native-code compiler
|
|
|
|
|
|
|
|
ocamlc.opt: $(COMPOBJS:.cmo=.cmx)
|
2001-08-30 02:02:55 -07:00
|
|
|
cd asmrun; $(MAKE) meta.o dynlink.o
|
|
|
|
$(CAMLOPT) $(LINKFLAGS) -ccopt "$(BYTECCLINKOPTS)" -o ocamlc.opt \
|
|
|
|
$(COMPOBJS:.cmo=.cmx) \
|
2002-05-07 06:18:29 -07:00
|
|
|
asmrun/meta.o asmrun/dynlink.o -cclib "$(BYTECCLIBS)"
|
2002-04-27 07:45:33 -07:00
|
|
|
@sed -e 's|@compiler@|$$topdir/ocamlc.opt|' \
|
|
|
|
driver/ocamlcomp.sh.in > ocamlcomp.sh
|
|
|
|
@chmod +x ocamlcomp.sh
|
2001-03-26 03:08:00 -08:00
|
|
|
|
|
|
|
partialclean::
|
|
|
|
rm -f ocamlc.opt
|
|
|
|
|
|
|
|
# The native-code compiler compiled with itself
|
|
|
|
|
|
|
|
ocamlopt.opt: $(OPTOBJS:.cmo=.cmx)
|
|
|
|
$(CAMLOPT) $(LINKFLAGS) -o ocamlopt.opt $(OPTOBJS:.cmo=.cmx)
|
2002-04-27 07:45:33 -07:00
|
|
|
@sed -e 's|@compiler@|$$topdir/ocamlopt.opt|' \
|
|
|
|
driver/ocamlcomp.sh.in > ocamlcompopt.sh
|
|
|
|
@chmod +x ocamlcompopt.sh
|
2001-03-26 03:08:00 -08:00
|
|
|
|
|
|
|
partialclean::
|
|
|
|
rm -f ocamlopt.opt
|
|
|
|
|
|
|
|
$(OPTOBJS:.cmo=.cmx): ocamlopt
|
|
|
|
|
|
|
|
# The numeric opcodes
|
|
|
|
|
|
|
|
bytecomp/opcodes.ml: byterun/instruct.h
|
|
|
|
sed -n -e '/^enum/p' -e 's/,//g' -e '/^ /p' byterun/instruct.h | \
|
|
|
|
awk -f tools/make-opcodes > bytecomp/opcodes.ml
|
|
|
|
|
|
|
|
partialclean::
|
|
|
|
rm -f bytecomp/opcodes.ml
|
|
|
|
|
|
|
|
beforedepend:: bytecomp/opcodes.ml
|
|
|
|
|
|
|
|
# The predefined exceptions and primitives
|
|
|
|
|
|
|
|
byterun/primitives:
|
|
|
|
cd byterun; $(MAKE) primitives
|
|
|
|
|
|
|
|
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/;$$//'; \
|
|
|
|
echo '|]'; \
|
|
|
|
echo 'let builtin_primitives = [|'; \
|
|
|
|
sed -e 's/.*/ "&";/' -e '$$s/;$$//' byterun/primitives; \
|
|
|
|
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
|
|
|
|
|
|
|
|
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
|
|
|
|
$(CAMLRUN) tools/cvt_emit < asmcomp/$(ARCH)/emit.mlp > asmcomp/emit.ml \
|
|
|
|
|| { rm -f asmcomp/emit.ml; exit 2; }
|
|
|
|
|
|
|
|
partialclean::
|
|
|
|
rm -f asmcomp/emit.ml
|
|
|
|
|
|
|
|
beforedepend:: asmcomp/emit.ml
|
|
|
|
|
|
|
|
tools/cvt_emit: tools/cvt_emit.mll
|
2005-03-04 06:51:31 -08:00
|
|
|
cd tools; \
|
|
|
|
$(MAKE) CAMLC="../$(CAMLRUN) ../boot/ocamlc -I ../stdlib" cvt_emit
|
2001-03-26 03:08:00 -08:00
|
|
|
|
|
|
|
# The "expunge" utility
|
|
|
|
|
|
|
|
expunge: $(EXPUNGEOBJS)
|
|
|
|
$(CAMLC) $(LINKFLAGS) -o expunge $(EXPUNGEOBJS)
|
|
|
|
|
|
|
|
partialclean::
|
|
|
|
rm -f expunge
|
|
|
|
|
|
|
|
# The runtime system for the bytecode compiler
|
|
|
|
|
|
|
|
runtime:
|
|
|
|
cd byterun; $(MAKE) all
|
|
|
|
if test -f stdlib/libcamlrun.a; then :; else \
|
|
|
|
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
|
|
|
|
|
|
|
|
runtimeopt:
|
|
|
|
cd asmrun; $(MAKE) all
|
|
|
|
if test -f stdlib/libasmrun.a; then :; else \
|
|
|
|
ln -s ../asmrun/libasmrun.a stdlib/libasmrun.a; fi
|
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:
|
|
|
|
cd stdlib; $(MAKE) RUNTIME=../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
|
|
|
|
|
|
|
|
ocamltools: ocamlc ocamlyacc ocamllex
|
|
|
|
cd tools; $(MAKE) all
|
2007-11-22 11:01:50 -08:00
|
|
|
|
2002-03-18 08:44:34 -08:00
|
|
|
ocamltoolsopt.opt: ocamlc.opt ocamlyacc ocamllex
|
|
|
|
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
|
|
|
|
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 \
|
2001-10-30 01:32:32 -08:00
|
|
|
(cd otherlibs/$$i; $(MAKE) RUNTIME=$(RUNTIME) all) || exit $$?; \
|
2001-10-19 06:24:39 -07: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 \
|
2001-10-30 01:32:32 -08:00
|
|
|
(cd otherlibs/$$i; $(MAKE) allopt) || exit $$?; \
|
2001-10-19 06:24:39 -07:00
|
|
|
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 \
|
|
|
|
(cd otherlibs/$$i; $(MAKE) partialclean); \
|
|
|
|
done
|
2007-11-22 11:01:50 -08:00
|
|
|
|
2001-03-26 03:08:00 -08:00
|
|
|
clean::
|
|
|
|
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
|
|
|
|
|
2002-11-05 01:25:19 -08:00
|
|
|
# Camlp4
|
|
|
|
|
2007-02-07 02:31:36 -08:00
|
|
|
camlp4out: ocamlc otherlibraries ocamlbuild-partial-boot ocamlbuild.byte
|
|
|
|
./build/camlp4-byte-only.sh
|
2007-11-22 11:01:50 -08:00
|
|
|
|
2007-02-07 02:31:36 -08:00
|
|
|
camlp4opt: ocamlopt otherlibrariesopt ocamlbuild-partial-boot ocamlbuild.native
|
|
|
|
./build/camlp4-native-only.sh
|
|
|
|
|
|
|
|
# Ocamlbuild
|
2006-09-28 06:27:27 -07:00
|
|
|
|
2007-02-07 02:31:36 -08:00
|
|
|
ocamlbuild.byte: ocamlc otherlibraries ocamlbuild-partial-boot
|
|
|
|
./build/ocamlbuild-byte-only.sh
|
2007-11-22 11:01:50 -08:00
|
|
|
|
2007-02-07 02:31:36 -08:00
|
|
|
ocamlbuild.native: ocamlopt otherlibrariesopt ocamlbuild-partial-boot
|
|
|
|
./build/ocamlbuild-native-only.sh
|
2007-11-29 02:35:57 -08:00
|
|
|
ocamlbuildlib.native: ocamlopt otherlibrariesopt ocamlbuild-partial-boot
|
|
|
|
./build/ocamlbuildlib-native-only.sh
|
2007-02-07 02:31:36 -08:00
|
|
|
|
2007-11-22 11:01:50 -08:00
|
|
|
ocamlbuild-partial-boot: ocamlc otherlibraries
|
2007-02-07 02:31:36 -08:00
|
|
|
./build/partial-boot.sh
|
2007-11-22 11:01:50 -08:00
|
|
|
|
2007-10-08 07:19:34 -07:00
|
|
|
partialclean::
|
|
|
|
rm -rf _build
|
2008-07-14 05:59:21 -07:00
|
|
|
if test -d test; then \
|
|
|
|
(cd test; $(MAKE) clean); \
|
|
|
|
fi
|
2002-11-05 01:25:19 -08:00
|
|
|
|
2002-08-01 06:51:34 -07:00
|
|
|
# Check that the stack limit is reasonable.
|
|
|
|
|
|
|
|
checkstack:
|
|
|
|
@if $(BYTECC) -o tools/checkstack tools/checkstack.c; \
|
|
|
|
then tools/checkstack; \
|
|
|
|
else :; \
|
|
|
|
fi
|
|
|
|
@rm -f tools/checkstack
|
|
|
|
|
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
|
2008-02-29 04:53:34 -08: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::
|
|
|
|
rm -f utils/*.cm[iox] utils/*.[so] utils/*~
|
|
|
|
rm -f parsing/*.cm[iox] parsing/*.[so] parsing/*~
|
|
|
|
rm -f typing/*.cm[iox] typing/*.[so] typing/*~
|
|
|
|
rm -f bytecomp/*.cm[iox] bytecomp/*.[so] bytecomp/*~
|
|
|
|
rm -f asmcomp/*.cm[iox] asmcomp/*.[so] asmcomp/*~
|
|
|
|
rm -f driver/*.cm[iox] driver/*.[so] driver/*~
|
|
|
|
rm -f toplevel/*.cm[iox] toplevel/*.[so] toplevel/*~
|
|
|
|
rm -f tools/*.cm[iox] tools/*.[so] tools/*~
|
|
|
|
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:
|
|
|
|
./build/distclean.sh
|
|
|
|
|
2007-11-22 11:01:50 -08:00
|
|
|
.PHONY: all backup bootstrap camlp4opt camlp4out checkstack clean
|
|
|
|
.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
|
2007-11-22 11:01:50 -08:00
|
|
|
.PHONY: library library-cross libraryopt ocamlbuild-partial-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 package-macosx promote promote-cross
|
|
|
|
.PHONY: restore runtime runtimeopt world world.opt
|
2001-03-26 03:08:00 -08:00
|
|
|
|
|
|
|
include .depend
|