summaryrefslogtreecommitdiff
path: root/Makefile.nt
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile.nt')
-rw-r--r--Makefile.nt74
1 files changed, 35 insertions, 39 deletions
diff --git a/Makefile.nt b/Makefile.nt
index 8fd4547813..68a7e1d4d3 100644
--- a/Makefile.nt
+++ b/Makefile.nt
@@ -16,16 +16,15 @@ include config/Makefile
include stdlib/StdlibModules
CAMLC=boot/ocamlrun boot/ocamlc -nostdlib -I boot
-CAMLOPT=$(CAMLOPT_BIN) -nostdlib -I stdlib -I otherlibs/dynlink
-COMPFLAGS=-strict-sequence -warn-error A $(INCLUDES)
+CAMLOPT=boot/ocamlrun ./ocamlopt -nostdlib -I stdlib -I otherlibs/dynlink
+COMPFLAGS=-strict-sequence -w +33..39+48 -warn-error A -bin-annot $(INCLUDES)
LINKFLAGS=
-SWITCH_COMPILER=make -C $(ROOTDIR)/config -f Makefile.switch-compiler
-
CAMLYACC=boot/ocamlyacc
YACCFLAGS=
CAMLLEX=boot/ocamlrun boot/ocamllex
CAMLDEP=boot/ocamlrun tools/ocamldep
DEPFLAGS=$(INCLUDES)
+CAMLRUN=byterun/ocamlrun
OCAMLBUILDBYTE=$(WITH_OCAMLBUILD:=.byte)
OCAMLBUILDNATIVE=$(WITH_OCAMLBUILD:=.native)
@@ -54,8 +53,8 @@ TYPING=typing/ident.cmo typing/path.cmo \
typing/typedtree.cmo typing/printtyped.cmo typing/ctype.cmo \
typing/printtyp.cmo typing/includeclass.cmo \
typing/mtype.cmo typing/envaux.cmo typing/includecore.cmo \
- typing/includemod.cmo typing/typetexp.cmo typing/parmatch.cmo \
typing/typedtreeIter.cmo typing/typedtreeMap.cmo typing/cmt_format.cmo \
+ typing/includemod.cmo typing/typetexp.cmo typing/parmatch.cmo \
typing/stypes.cmo typing/typecore.cmo \
typing/typedecl.cmo typing/typeclass.cmo \
typing/typemod.cmo
@@ -80,7 +79,7 @@ ASMCOMP=asmcomp/arch.cmo asmcomp/debuginfo.cmo \
asmcomp/cmm.cmo asmcomp/printcmm.cmo \
asmcomp/reg.cmo asmcomp/mach.cmo asmcomp/proc.cmo \
asmcomp/clambda.cmo asmcomp/printclambda.cmo asmcomp/compilenv.cmo \
- asmcomp/closure.cmo asmcomp/cmmgen.cmo \
+ asmcomp/closure.cmo asmcomp/strmatch.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 \
@@ -142,15 +141,11 @@ LIBFILES=stdlib.cma std_exit.cmo *.cmi camlheader
# Start up the system from the distribution compiler
coldstart:
- $(SWITCH_COMPILER) disable COMPILER=CAMLC VARIANT=BYTE
- $(SWITCH_COMPILER) disable COMPILER=CAMLC VARIANT=OPT
- $(SWITCH_COMPILER) disable COMPILER=CAMLOPT VARIANT=BYTE
- $(SWITCH_COMPILER) disable COMPILER=CAMLOPT VARIANT=OPT
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) all CAMLC="../boot/ocamlrun ../boot/ocamlc -nostdlib -I ../boot"
+ cd stdlib ; $(MAKEREC) COMPILER=../boot/ocamlc all
cd stdlib ; cp $(LIBFILES) ../boot
# Build the core system: the minimum needed to make depend and bootstrap
@@ -207,8 +202,6 @@ opt-core:
opt:
$(MAKE) -f Makefile.nt opt-core
$(MAKE) -f Makefile.nt otherlibrariesopt
- if test -n "$(WITH_OCAMLBUILD)"; then \
- $(MAKE) -f Makefile.nt ocamlbuildlib.native; else :; fi
# Native-code versions of the tools
opt.opt: core opt-core ocamlc.opt all ocamlopt.opt ocamllex.opt \
@@ -245,9 +238,10 @@ installbyt:
else :; fi
mkdir -p $(STUBLIBDIR)
for i in $(OTHERLIBRARIES); do $(MAKEREC) -C otherlibs/$$i install; done
- if test -n "$(WITH_OCAMLDEBUG)"; then (cd debugger; $(MAKEREC) install); \
+ if test -n "$(WITH_DEBUGGER)"; then (cd debugger; $(MAKEREC) install); \
+ else :; fi
+ if test -n "$(WITH_OCAMLBUILD)"; then (cd ocamlbuild; $(MAKE) install); \
else :; fi
- ./build/partial-install.sh
cp config/Makefile $(LIBDIR)/Makefile.config
cp README $(DISTRIB)/Readme.general.txt
cp README.win32 $(DISTRIB)/Readme.windows.txt
@@ -262,6 +256,8 @@ installopt:
cp asmcomp/*.cmi driver/*.cmi $(COMPLIBDIR)
cp compilerlibs/ocamloptcomp.cma $(OPTSTART) $(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; done
if test -f ocamlopt.opt ; then $(MAKEREC) installoptopt; fi
@@ -295,12 +291,12 @@ partialclean::
ocamlc: compilerlibs/ocamlcommon.cma compilerlibs/ocamlbytecomp.cma $(BYTESTART)
$(CAMLC) $(LINKFLAGS) -compat-32 -o ocamlc compilerlibs/ocamlcommon.cma \
compilerlibs/ocamlbytecomp.cma $(BYTESTART)
- $(SWITCH_COMPILER) enable COMPILER=CAMLC VARIANT=BYTE
- $(SWITCH_COMPILER) disable COMPILER=CAMLC VARIANT=OPT
+ @sed -e 's|@compiler@|$$topdir/boot/ocamlrun $$topdir/ocamlc|' \
+ driver/ocamlcomp.sh.in > ocamlcomp.sh
+ @chmod +x ocamlcomp.sh
partialclean::
- rm -f ocamlc
- $(SWITCH_COMPILER) disable COMPILER=CAMLC VARIANT=BYTE
+ rm -f ocamlc ocamlcomp.sh
# The native-code compiler
@@ -312,12 +308,12 @@ partialclean::
ocamlopt: compilerlibs/ocamlcommon.cma compilerlibs/ocamloptcomp.cma $(OPTSTART)
$(CAMLC) $(LINKFLAGS) -o ocamlopt \
compilerlibs/ocamlcommon.cma compilerlibs/ocamloptcomp.cma $(OPTSTART)
- $(SWITCH_COMPILER) enable COMPILER=CAMLOPT VARIANT=BYTE
- $(SWITCH_COMPILER) disable COMPILER=CAMLOPT VARIANT=OPT
+ @sed -e 's|@compiler@|$$topdir/boot/ocamlrun $$topdir/ocamlopt|' \
+ driver/ocamlcomp.sh.in > ocamlcompopt.sh
+ @chmod +x ocamlcompopt.sh
partialclean::
- rm -f ocamlopt
- $(SWITCH_COMPILER) disable COMPILER=CAMLOPT VARIANT=BYTE
+ rm -f ocamlopt ocamlcompopt.sh
# The toplevel
@@ -430,11 +426,12 @@ ocamlc.opt: compilerlibs/ocamlcommon.cmxa compilerlibs/ocamlbytecomp.cmxa \
$(CAMLOPT) $(LINKFLAGS) -ccopt "$(BYTECCLINKOPTS)" -o ocamlc.opt \
compilerlibs/ocamlcommon.cmxa compilerlibs/ocamlbytecomp.cmxa \
$(BYTESTART:.cmo=.cmx) -cclib "$(BYTECCLIBS)"
- $(SWITCH_COMPILER) enable COMPILER=CAMLC VARIANT=OPT
+ @sed -e 's|@compiler@|$$topdir/ocamlc.opt|' \
+ driver/ocamlcomp.sh.in > ocamlcomp.sh
+ @chmod +x ocamlcomp.sh
partialclean::
rm -f ocamlc.opt
- $(SWITCH_COMPILER) disable COMPILER=CAMLC VARIANT=OPT
# The native-code compiler compiled with itself
@@ -448,11 +445,12 @@ ocamlopt.opt: compilerlibs/ocamlcommon.cmxa compilerlibs/ocamloptcomp.cmxa \
$(CAMLOPT) $(LINKFLAGS) -o ocamlopt.opt \
compilerlibs/ocamlcommon.cmxa compilerlibs/ocamloptcomp.cmxa \
$(OPTSTART:.cmo=.cmx)
- $(SWITCH_COMPILER) enable COMPILER=CAMLOPT VARIANT=OPT
+ @sed -e 's|@compiler@|$$topdir/ocamlopt.opt|' \
+ driver/ocamlcomp.sh.in > ocamlcompopt.sh
+ @chmod +x ocamlcompopt.sh
partialclean::
rm -f ocamlopt.opt
- $(SWITCH_COMPILER) disable COMPILER=CAMLOPT VARIANT=OPT
$(COMMON:.cmo=.cmx) $(BYTECOMP:.cmo=.cmx) $(ASMCOMP:.cmo=.cmx): ocamlopt
@@ -616,9 +614,9 @@ clean::
# Tools
-ocamltools: asmcomp/cmx_format.cmi
+ocamltools: ocamlc ocamlyacc ocamllex asmcomp/cmx_format.cmi asmcomp/printclambda.cmo
cd tools ; $(MAKEREC) all
-ocamltoolsopt.opt: asmcomp/cmx_format.cmi
+ocamltoolsopt.opt: ocamlc.opt ocamlyacc ocamllex asmcomp/cmx_format.cmi asmcomp/printclambda.cmx
cd tools ; $(MAKEREC) opt.opt
partialclean::
cd tools ; $(MAKEREC) clean
@@ -660,19 +658,17 @@ alldepend::
# Ocamlbuild
-ocamlbuild.byte: ocamlc otherlibraries ocamlbuild-mixed-boot
- ./build/ocamlbuild-byte-only.sh
-ocamlbuild.native: ocamlopt otherlibrariesopt ocamlbuild-mixed-boot
- ./build/ocamlbuild-native-only.sh
-ocamlbuildlib.native: ocamlopt otherlibrariesopt ocamlbuild-mixed-boot
- ./build/ocamlbuildlib-native-only.sh
+ocamlbuild.byte: ocamlc otherlibraries
+ cd ocamlbuild && $(MAKE) all
+ocamlbuild.native: ocamlopt otherlibrariesopt
+ cd ocamlbuild && $(MAKE) allopt
-.PHONY: ocamlbuild-mixed-boot
-ocamlbuild-mixed-boot:
- ./build/mixed-boot.sh
partialclean::
- rm -rf _build
+ cd ocamlbuild && $(MAKE) clean
+
+alldepend::
+ cd ocamlbuild && $(MAKE) depend
# Make clean in the test suite