ocaml/Makefile.nt

732 lines
22 KiB
Makefile
Raw Normal View History

#########################################################################
# #
# OCaml #
# #
# 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. #
# #
#########################################################################
# The main Makefile
include Makefile.shared
# For users who don't read the INSTALL file
defaultentry:
2015-09-22 01:32:46 -07:00
@echo "Please refer to the installation instructions in file README.win32.adoc."
FLEXDLL_SUBMODULE_PRESENT:=$(wildcard flexdll/Makefile)
BOOT_FLEXLINK_CMD=$(if $(FLEXDLL_SUBMODULE_PRESENT),FLEXLINK_CMD="../boot/ocamlrun ../flexdll/flexlink.exe")
CAMLOPT:=$(if $(FLEXDLL_SUBMODULE_PRESENT),OCAML_FLEXLINK="boot/ocamlrun flexdll/flexlink.exe") $(CAMLOPT)
# FlexDLL sources missing error messages
# Different git mechanism displayed depending on whether this source tree came
# from a git clone or a source tarball.
# Displayed in all cases
flexdll-common-err:
@echo In order to bootstrap FlexDLL, you need to place the sources in flexdll
@echo This can either be done by downloading a source tarball from
@echo \ http://alain.frisch.fr/flexdll.html
flexdll/Makefile: $(if $(wildcard flexdll/Makefile),,$(if $(wildcard .git),flexdll-common-err,flexdll-repo))
@echo or by checking out the flexdll submodule with
@echo \ git submodule update --init
@false
flexdll-repo: flexdll-common-err
@echo or by cloning the git repository
@echo \ git clone https://github.com/alainfrisch/flexdll.git
@echo
@false
# Bootstrapping FlexDLL - leaves a bytecode image of flexlink.exe in flexdll/
flexdll: flexdll/Makefile
cd byterun ; $(MAKEREC) BOOTSTRAPPING_FLEXLINK=yes ocamlrun$(EXE)
cp byterun/ocamlrun.exe boot/ocamlrun.exe
cd stdlib ; $(MAKEREC) COMPILER=../boot/ocamlc stdlib.cma std_exit.cmo
cd stdlib ; cp stdlib.cma std_exit.cmo *.cmi ../boot
cd flexdll ; $(MAKECMD) MSVC_DETECT=0 TOOLCHAIN=$(TOOLCHAIN) TOOLPREF=$(TOOLPREF) CHAINS=$(FLEXDLL_CHAIN) NATDYNLINK=false OCAMLOPT="../boot/ocamlrun ../boot/ocamlc -I ../boot" flexlink.exe support
cd byterun ; $(MAKEREC) clean
$(MAKEREC) partialclean
flexlink.opt:
cd flexdll ; \
mv flexlink.exe flexlink ; \
$(MAKECMD) OCAML_FLEXLINK="../boot/ocamlrun ./flexlink" MSVC_DETECT=0 TOOLCHAIN=$(TOOLCHAIN) TOOLPREF=$(TOOLPREF) OCAMLOPT="../ocamlopt.opt -I ../stdlib" flexlink.exe ; \
mv flexlink.exe flexlink.opt ; \
mv flexlink flexlink.exe
# Recompile the system using the bootstrap compiler
all: runtime ocamlc ocamllex ocamlyacc ocamltools library ocaml \
otherlibraries $(OCAMLBUILDBYTE) $(WITH_DEBUGGER) \
$(WITH_OCAMLDOC)
# The compilation of ocaml will fail if the runtime has changed.
# Never mind, just do make bootstrap to reach fixpoint again.
# Compile everything the first time
world: coldstart all
# Core bootstrapping cycle
coreboot:
# Save the original bootstrap compiler
$(MAKEREC) backup
# Promote the new compiler but keep the old runtime
# This compiler runs on boot/ocamlrun and produces bytecode for
# byterun/ocamlrun
$(MAKEREC) promote-cross
# Rebuild ocamlc and ocamllex (run on byterun/ocamlrun)
$(MAKEREC) partialclean
$(MAKEREC) ocamlc ocamllex ocamltools
# Rebuild the library (using byterun/ocamlrun ./ocamlc)
$(MAKEREC) library-cross
# Promote the new compiler and the new runtime
$(MAKEREC) promote
# Rebuild the core system
$(MAKEREC) partialclean
$(MAKEREC) core
# Check if fixpoint reached
$(MAKEREC) compare
# Do a complete bootstrapping cycle
bootstrap:
$(MAKEREC) coreboot
$(MAKEREC) all
$(MAKEREC) compare
LIBFILES=stdlib.cma std_exit.cmo *.cmi camlheader
# Start up the system from the distribution compiler
coldstart:
cd byterun ; $(MAKEREC) $(BOOT_FLEXLINK_CMD) all
cp byterun/ocamlrun.exe boot/ocamlrun.exe
cd yacc ; $(MAKEREC) $(BOOT_FLEXLINK_CMD) all
cp yacc/ocamlyacc.exe boot/ocamlyacc.exe
cd stdlib ; $(MAKEREC) $(BOOT_FLEXLINK_CMD) COMPILER=../boot/ocamlc all
cd stdlib ; cp $(LIBFILES) ../boot
# Build the core system: the minimum needed to make depend and bootstrap
core: runtime ocamlc ocamllex ocamlyacc ocamltools library
# Save the current bootstrap compiler
MAXSAVED=boot/Saved/Saved.prev/Saved.prev/Saved.prev/Saved.prev/Saved.prev
backup:
mkdir -p boot/Saved
if test -d $(MAXSAVED); then rm -r $(MAXSAVED); fi
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
cd boot ; mv ocamlc ocamllex ocamldep ocamlyacc.exe Saved
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:
$(CAMLRUN) tools/stripdebug ocamlc boot/ocamlc
$(CAMLRUN) tools/stripdebug lex/ocamllex boot/ocamllex
cp yacc/ocamlyacc.exe boot/ocamlyacc.exe
$(CAMLRUN) tools/stripdebug tools/ocamldep boot/ocamldep
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:
cd boot/Saved ; mv * ..
rmdir boot/Saved
mv boot/Saved.prev boot/Saved
# Check if fixpoint reached
compare:
@if $(CAMLRUN) tools/cmpbyt boot/ocamlc ocamlc \
&& $(CAMLRUN) tools/cmpbyt boot/ocamllex lex/ocamllex \
&& $(CAMLRUN) tools/cmpbyt boot/ocamldep tools/ocamldep; \
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
opt-core:
$(MAKEREC) runtimeopt
$(MAKEREC) ocamlopt
$(MAKEREC) libraryopt
opt:
$(MAKEREC) opt-core
$(MAKEREC) otherlibrariesopt ocamltoolsopt
# Native-code versions of the tools
# If the submodule is initialised, then opt.opt will build a native flexlink
opt.opt: core opt-core ocamlc.opt all ocamlopt.opt ocamllex.opt \
ocamltoolsopt ocamltoolsopt.opt otherlibrariesopt $(OCAMLBUILDNATIVE) \
$(OCAMLDOC_OPT) $(if $(wildcard flexdll/Makefile),flexlink.opt)
# Complete build using fast compilers
world.opt: coldstart opt.opt
# Installation
COMPLIBDIR=$(LIBDIR)/compiler-libs
INSTALL_BINDIR=$(DESTDIR)$(BINDIR)
INSTALL_LIBDIR=$(DESTDIR)$(LIBDIR)
INSTALL_COMPLIBDIR=$(DESTDIR)$(COMPLIBDIR)
INSTALL_STUBLIBDIR=$(DESTDIR)$(STUBLIBDIR)
INSTALL_MANDIR=$(DESTDIR)$(MANDIR)
install: installbyt installopt
installbyt:
mkdir -p $(INSTALL_BINDIR)
mkdir -p $(INSTALL_LIBDIR)
mkdir -p $(INSTALL_STUBLIBDIR)
mkdir -p $(INSTALL_COMPLIBDIR)
cp VERSION $(INSTALL_LIBDIR)/
cd byterun ; $(MAKEREC) install
cp ocamlc $(INSTALL_BINDIR)/ocamlc.exe
cp ocaml $(INSTALL_BINDIR)/ocaml.exe
cd stdlib ; $(MAKEREC) install
cp lex/ocamllex $(INSTALL_BINDIR)/ocamllex.exe
cp yacc/ocamlyacc.exe $(INSTALL_BINDIR)/ocamlyacc.exe
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)
cp compilerlibs/ocamlcommon.cma compilerlibs/ocamlbytecomp.cma \
compilerlibs/ocamltoplevel.cma $(BYTESTART) $(TOPLEVELSTART) \
$(INSTALL_COMPLIBDIR)
cp expunge $(INSTALL_LIBDIR)/expunge.exe
cp toplevel/topdirs.cmi $(INSTALL_LIBDIR)
cd tools ; $(MAKEREC) install
for i in $(OTHERLIBRARIES); do \
$(MAKEREC) -C otherlibs/$$i install || exit $$?; \
done
if test -n "$(WITH_OCAMLDOC)"; then (cd ocamldoc; $(MAKEREC) install); \
else :; fi
if test -n "$(WITH_DEBUGGER)"; then (cd debugger; $(MAKEREC) install); \
else :; fi
if test -n "$(WITH_OCAMLBUILD)"; then (cd ocamlbuild; $(MAKE) install); \
else :; fi
if test -n "$(FLEXDLL_SUBMODULE_PRESENT)"; then $(MAKEREC) install-flexdll; \
else :; fi
cp config/Makefile $(INSTALL_LIBDIR)/Makefile.config
2015-09-22 01:32:46 -07:00
cp README.adoc $(INSTALL_DISTRIB)/Readme.general.txt
cp README.win32.adoc $(INSTALL_DISTRIB)/Readme.windows.txt
cp LICENSE $(INSTALL_DISTRIB)/License.txt
cp Changes $(INSTALL_DISTRIB)/Changes.txt
install-flexdll:
# The $(if ...) installs the correct .manifest file for MSVC and MSVC64
# (GNU make doesn't have ifeq as a function, hence slightly convoluted use of filter-out)
cp flexdll/flexlink.exe $(if $(filter-out mingw,$(TOOLCHAIN)),flexdll/default$(filter-out _i386,_$(ARCH)).manifest) $(INSTALL_BINDIR)/
cp flexdll/flexdll_*.$(O) $(INSTALL_LIBDIR)
# Installation of the native-code compiler
installopt:
cd asmrun ; $(MAKEREC) install
cp ocamlopt $(INSTALL_BINDIR)/ocamlopt.exe
cd stdlib ; $(MAKEREC) installopt
cp asmcomp/*.cmi asmcomp/*.cmt asmcomp/*.cmti $(INSTALL_COMPLIBDIR)
cp compilerlibs/ocamloptcomp.cma $(OPTSTART) $(INSTALL_COMPLIBDIR)
if test -n "$(WITH_OCAMLDOC)"; then (cd ocamldoc; $(MAKEREC) installopt); fi
if test -n "$(WITH_OCAMLBUILD)"; then (cd ocamlbuild; $(MAKE) installopt); \
else :; fi
for i in $(OTHERLIBRARIES); do \
$(MAKEREC) -C otherlibs/$$i installopt || exit $$?; \
done
if test -f ocamlopt.opt ; then $(MAKEREC) installoptopt; fi
cd tools; $(MAKEREC) installopt
if test -f ocamlopt.opt -a -f flexdll/flexlink.opt ; then cp -f flexdll/flexlink.opt $(INSTALL_BINDIR)/flexlink.exe ; fi
installoptopt:
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)
cp utils/*.cmx parsing/*.cmx typing/*.cmx bytecomp/*.cmx \
driver/*.cmx asmcomp/*.cmx $(INSTALL_COMPLIBDIR)
cp compilerlibs/ocamlcommon.cmxa compilerlibs/ocamlcommon.$(A) \
compilerlibs/ocamlbytecomp.cmxa compilerlibs/ocamlbytecomp.$(A) \
compilerlibs/ocamloptcomp.cmxa compilerlibs/ocamloptcomp.$(A) \
$(BYTESTART:.cmo=.cmx) $(BYTESTART:.cmo=.$(O)) \
$(OPTSTART:.cmo=.cmx) $(OPTSTART:.cmo=.$(O)) \
$(INSTALL_COMPLIBDIR)
clean:: partialclean
# The compiler
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) -compat-32 -o ocamlc compilerlibs/ocamlcommon.cma \
compilerlibs/ocamlbytecomp.cma $(BYTESTART)
partialclean::
rm -f ocamlc
# The native-code compiler
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)
partialclean::
rm -f ocamlopt
# The toplevel
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)
- $(CAMLRUN) ./expunge ocaml.tmp ocaml $(PERVASIVES)
rm -f ocaml.tmp
partialclean::
rm -f ocaml
# The native toplevel
ocamlnat: ocamlopt otherlibs/dynlink/dynlink.cmxa $(NATTOPOBJS:.cmo=.cmx)
$(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
cd otherlibs/dynlink && $(MAKEREC) allopt
# The configuration file
utils/config.ml: utils/config.mlp config/Makefile
@rm -f utils/config.ml
sed -e "s|%%LIBDIR%%|$(LIBDIR)|" \
-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)|' \
-e 's|%%ARCMD%%|$(ARCMD)|' \
-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)|' \
-e 's|%%ASM_CFI_SUPPORTED%%|false|' \
-e 's|%%WITH_FRAME_POINTERS%%|false|' \
-e 's|%%MKDLL%%|$(MKDLL)|' \
-e 's|%%MKEXE%%|$(MKEXE)|' \
-e 's|%%MKMAINDLL%%|$(MKMAINDLL)|' \
-e 's|%%CC_PROFILE%%||' \
-e 's|%%HOST%%|$(HOST)|' \
-e 's|%%TARGET%%|$(TARGET)|' \
-e 's|%%FLAMBDA%%|$(FLAMBDA)|' \
-e 's|%%FLEXLINK_FLAGS%%|$(FLEXLINK_FLAGS)|' \
utils/config.mlp > 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
# Shared parts of the system compiled with the native-code compiler
compilerlibs/ocamlcommon.cmxa: $(COMMON:.cmo=.cmx)
$(CAMLOPT) -a -o $@ $(COMMON:.cmo=.cmx)
partialclean::
rm -f compilerlibs/ocamlcommon.cmxa compilerlibs/ocamlcommon.$(A)
# The bytecode compiler compiled with the native-code compiler
compilerlibs/ocamlbytecomp.cmxa: $(BYTECOMP:.cmo=.cmx)
$(CAMLOPT) -a -o $@ $(BYTECOMP:.cmo=.cmx)
partialclean::
rm -f compilerlibs/ocamlbytecomp.cmxa compilerlibs/ocamlbytecomp.$(A)
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)"
partialclean::
rm -f ocamlc.opt
# The native-code compiler compiled with itself
compilerlibs/ocamloptcomp.cmxa: $(ASMCOMP:.cmo=.cmx)
$(CAMLOPT) -a -o $@ $(ASMCOMP:.cmo=.cmx)
partialclean::
rm -f compilerlibs/ocamloptcomp.cmxa compilerlibs/ocamloptcomp.$(A)
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)
partialclean::
rm -f ocamlopt.opt
$(COMMON:.cmo=.cmx) $(BYTECOMP:.cmo=.cmx) $(ASMCOMP:.cmo=.cmx): ocamlopt
# The numeric opcodes
bytecomp/opcodes.ml: byterun/caml/instruct.h
sed -n -e "/^enum/p" -e "s|,||g" -e "/^ /p" byterun/caml/instruct.h | \
gawk -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 ; $(MAKEREC) primitives
bytecomp/runtimedef.ml: byterun/primitives byterun/caml/fail.h
(echo 'let builtin_exceptions = [|'; \
sed -n -e 's|.*/\* \("[A-Za-z_]*"\) \*/$$| \1;|p' byterun/caml/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
cp asmcomp/$(ARCH)/arch.ml asmcomp/arch.ml
partialclean::
rm -f asmcomp/arch.ml
beforedepend:: asmcomp/arch.ml
asmcomp/proc.ml: asmcomp/$(ARCH)/proc.ml
cp asmcomp/$(ARCH)/proc.ml asmcomp/proc.ml
partialclean::
rm -f asmcomp/proc.ml
beforedepend:: asmcomp/proc.ml
asmcomp/selection.ml: asmcomp/$(ARCH)/selection.ml
cp asmcomp/$(ARCH)/selection.ml asmcomp/selection.ml
partialclean::
rm -f asmcomp/selection.ml
beforedepend:: asmcomp/selection.ml
asmcomp/CSE.ml: asmcomp/$(ARCH)/CSE.ml
cp asmcomp/$(ARCH)/CSE.ml asmcomp/CSE.ml
partialclean::
rm -f asmcomp/CSE.ml
beforedepend:: asmcomp/CSE.ml
asmcomp/reload.ml: asmcomp/$(ARCH)/reload.ml
cp asmcomp/$(ARCH)/reload.ml asmcomp/reload.ml
partialclean::
rm -f asmcomp/reload.ml
beforedepend:: asmcomp/reload.ml
asmcomp/scheduling.ml: asmcomp/$(ARCH)/scheduling.ml
cp asmcomp/$(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
partialclean::
rm -f asmcomp/emit.ml
beforedepend:: asmcomp/emit.ml
tools/cvt_emit: tools/cvt_emit.mll
cd tools ; $(MAKEREC) cvt_emit
# The "expunge" utility
expunge: compilerlibs/ocamlcommon.cma compilerlibs/ocamlbytecomp.cma \
toplevel/expunge.cmo
$(CAMLC) $(LINKFLAGS) -o expunge compilerlibs/ocamlcommon.cma \
compilerlibs/ocamlbytecomp.cma toplevel/expunge.cmo
partialclean::
rm -f expunge
# The runtime system for the bytecode compiler
runtime: makeruntime stdlib/libcamlrun.$(A)
makeruntime:
cd byterun ; $(MAKEREC) $(BOOT_FLEXLINK_CMD) all
stdlib/libcamlrun.$(A): byterun/libcamlrun.$(A)
cp byterun/libcamlrun.$(A) stdlib/libcamlrun.$(A)
clean::
cd byterun ; $(MAKEREC) clean
rm -f stdlib/libcamlrun.$(A)
alldepend::
cd byterun ; $(MAKEREC) depend
# The runtime system for the native-code compiler
runtimeopt: makeruntimeopt stdlib/libasmrun.$(A)
makeruntimeopt:
cd asmrun ; $(MAKEREC) all
stdlib/libasmrun.$(A): asmrun/libasmrun.$(A)
cp asmrun/libasmrun.$(A) stdlib/libasmrun.$(A)
clean::
cd asmrun ; $(MAKEREC) clean
rm -f stdlib/libasmrun.$(A)
alldepend::
cd asmrun ; $(MAKEREC) depend
# The library
library:
cd stdlib ; $(MAKEREC) $(BOOT_FLEXLINK_CMD) all
library-cross:
cd stdlib ; $(MAKEREC) $(BOOT_FLEXLINK_CMD) CAMLRUN=../byterun/ocamlrun all
libraryopt:
cd stdlib ; $(MAKEREC) $(BOOT_FLEXLINK_CMD) allopt
partialclean::
cd stdlib ; $(MAKEREC) clean
alldepend::
cd stdlib ; $(MAKEREC) depend
# The lexer and parser generators
ocamllex:
cd lex ; $(MAKEREC) all
ocamllex.opt:
cd lex ; $(MAKEREC) allopt
partialclean::
cd lex ; $(MAKEREC) clean
alldepend::
cd lex ; $(MAKEREC) depend
ocamlyacc:
cd yacc ; $(MAKEREC) $(BOOT_FLEXLINK_CMD) all
clean::
cd yacc ; $(MAKEREC) clean
# Tools
ocamltools: ocamlc ocamlyacc ocamllex asmcomp/cmx_format.cmi \
asmcomp/printclambda.cmo
cd tools ; $(MAKEREC) all
ocamltoolsopt:
cd tools ; $(MAKEREC) opt
ocamltoolsopt.opt: ocamlc.opt ocamlyacc ocamllex asmcomp/cmx_format.cmi \
asmcomp/printclambda.cmx
cd tools ; $(MAKEREC) opt.opt
partialclean::
cd tools ; $(MAKEREC) clean
alldepend::
cd tools ; $(MAKEREC) depend
# OCamldoc
ocamldoc:
cd ocamldoc ; $(MAKEREC) all
ocamldoc.opt:
cd ocamldoc ; $(MAKEREC) opt.opt
partialclean::
cd ocamldoc ; $(MAKEREC) clean
alldepend::
cd ocamldoc ; $(MAKEREC) depend
# The extra libraries
otherlibraries:
for i in $(OTHERLIBRARIES); do \
$(MAKEREC) -C otherlibs/$$i all || exit $$?; \
done
otherlibrariesopt:
for i in $(OTHERLIBRARIES); \
do $(MAKEREC) -C otherlibs/$$i allopt || exit $$?; \
done
partialclean::
for i in $(OTHERLIBRARIES); \
do $(MAKEREC) -C otherlibs/$$i partialclean || exit $$?; \
done
clean::
for i in $(OTHERLIBRARIES); do \
$(MAKEREC) -C otherlibs/$$i clean || exit $$?; \
done
alldepend::
for i in $(OTHERLIBRARIES); do \
$(MAKEREC) -C otherlibs/$$i depend || exit $$?; \
done
# The replay debugger
ocamldebugger: ocamlc ocamlyacc ocamllex
cd debugger; $(MAKEREC) all
partialclean::
cd debugger; $(MAKEREC) clean
alldepend::
cd debugger; $(MAKEREC) depend
# Ocamlbuild
ocamlbuild.byte: ocamlc otherlibraries
cd ocamlbuild && $(MAKE) all
ocamlbuild.native: ocamlopt otherlibrariesopt
cd ocamlbuild && $(if $(FLEXDLL_SUBMODULE_PRESENT),OCAML_FLEXLINK="../boot/ocamlrun ../flexdll/flexlink.exe") $(MAKE) allopt
partialclean::
cd ocamlbuild && $(MAKE) clean
alldepend::
cd ocamlbuild && $(MAKE) depend
# Make clean in the test suite
clean::
cd testsuite; $(MAKE) clean
# 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* 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)
depend: beforedepend
(for d in utils parsing typing bytecomp asmcomp driver toplevel; \
do $(CAMLDEP) $(DEPFLAGS) $$d/*.mli $$d/*.ml; \
done) > .depend
alldepend:: depend
distclean:
$(MAKEREC) clean
rm -f asmrun/.depend.nt byterun/.depend.nt
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
rm -f tools/*.bak
rm -f ocaml ocamlc
rm -f testsuite/_log
.PHONY: all backup bootstrap 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 ocamltoolsopt
.PHONY: ocamltoolsopt.opt ocamlyacc opt-core opt opt.opt otherlibraries
.PHONY: otherlibrariesopt promote promote-cross
.PHONY: restore runtime runtimeopt makeruntimeopt world world.opt
.PHONY: flexdll flexlink.opt flexdll-common-err flexdll-repo
include .depend