Use boot/ocamlc.opt for building, if available.

master
Stephen Dolan 2019-03-18 10:45:43 +00:00
parent c413136fa3
commit 46c427f519
7 changed files with 25 additions and 13 deletions

1
.gitignore vendored
View File

@ -67,6 +67,7 @@ _build
/boot/ocamlrun
/boot/camlheader
/boot/ocamlc.opt
/bytecomp/runtimedef.ml
/bytecomp/opcodes.ml

View File

@ -23,6 +23,11 @@ Working version
- GPR#2314: Remove support for gprof profiling.
(Mark Shinwell, review by Xavier Clerc and Stephen Dolan)
### Compiler distribution build system:
- GPR#8514: Use boot/ocamlc.opt for building, if available.
(Stephen Dolan, review by Gabriel Scherer)
### Internal/compiler-libs changes:
- GPR#1579: Add a separate types for clambda primitives

View File

@ -41,10 +41,9 @@ else
LN = ln -sf
endif
CAMLRUN ?= boot/ocamlrun
include stdlib/StdlibModules
CAMLC=$(CAMLRUN) boot/ocamlc -g -nostdlib -I boot -use-prims runtime/primitives
CAMLC=$(BOOT_OCAMLC) -g -nostdlib -I boot -use-prims runtime/primitives
CAMLOPT=$(CAMLRUN) ./ocamlopt -g -nostdlib -I stdlib -I otherlibs/dynlink
ARCHES=amd64 i386 arm arm64 power s390x
INCLUDES=-I utils -I parsing -I typing -I bytecomp -I middle_end \
@ -330,7 +329,7 @@ coldstart:
$(MAKE) -C runtime $(BOOT_FLEXLINK_CMD) all
cp runtime/ocamlrun$(EXE) boot/ocamlrun$(EXE)
$(MAKE) -C stdlib $(BOOT_FLEXLINK_CMD) \
COMPILER="../boot/ocamlc -use-prims ../runtime/primitives" all
CAMLC='$$(BOOT_OCAMLC) -use-prims ../runtime/primitives' all
cd stdlib; cp $(LIBFILES) ../boot
cd boot; $(LN) ../runtime/libcamlrun.$(A) .
@ -1279,7 +1278,7 @@ depend: beforedepend
.PHONY: distclean
distclean: clean
rm -f boot/ocamlrun boot/ocamlrun$(EXE) boot/camlheader \
boot/*.cm* boot/libcamlrun.$(A)
boot/*.cm* boot/libcamlrun.$(A) boot/ocamlc.opt
rm -f Makefile.config runtime/caml/m.h runtime/caml/s.h
rm -f tools/*.bak
rm -f ocaml ocamlc

View File

@ -35,6 +35,16 @@ else
FLEXDLL_SUBMODULE_PRESENT =
endif
# Use boot/ocamlc.opt if available
CAMLRUN ?= $(ROOTDIR)/boot/ocamlrun
ifeq (0,$(shell \
test $(ROOTDIR)/boot/ocamlc.opt -nt $(ROOTDIR)/boot/ocamlc; \
echo $$?))
BOOT_OCAMLC = $(ROOTDIR)/boot/ocamlc.opt
else
BOOT_OCAMLC = $(CAMLRUN) $(ROOTDIR)/boot/ocamlc
endif
ifeq "$(FLEXDLL_SUBMODULE_PRESENT)" ""
FLEXLINK_ENV =
CAMLOPT_CMD = $(CAMLOPT)

View File

@ -20,10 +20,9 @@ ROOTDIR = ..
include $(ROOTDIR)/Makefile.config
include $(ROOTDIR)/Makefile.common
CAMLRUN ?= $(ROOTDIR)/boot/ocamlrun
CAMLYACC ?= $(ROOTDIR)/yacc/ocamlyacc
CAMLC = $(CAMLRUN) $(ROOTDIR)/boot/ocamlc -strict-sequence -nostdlib \
CAMLC = $(BOOT_OCAMLC) -strict-sequence -nostdlib \
-I $(ROOTDIR)/boot -use-prims $(ROOTDIR)/runtime/primitives
CAMLOPT = $(CAMLRUN) $(ROOTDIR)/ocamlopt -nostdlib -I $(ROOTDIR)/stdlib
COMPFLAGS = $(INCLUDES) -absname -w +a-4-9-41-42-44-45-48 -warn-error A \
@ -31,7 +30,7 @@ COMPFLAGS = $(INCLUDES) -absname -w +a-4-9-41-42-44-45-48 -warn-error A \
LINKFLAGS =
YACCFLAGS = -v
CAMLLEX = $(CAMLRUN) $(ROOTDIR)/boot/ocamllex
CAMLDEP = $(CAMLRUN) $(ROOTDIR)/boot/ocamlc -depend
CAMLDEP = $(BOOT_OCAMLC) -depend
DEPFLAGS = -slash
DEPINCLUDES =

View File

@ -18,7 +18,6 @@ ROOTDIR = ..
include $(ROOTDIR)/Makefile.config
include $(ROOTDIR)/Makefile.common
CAMLRUN ?= $(ROOTDIR)/boot/ocamlrun
TARGET_BINDIR ?= $(BINDIR)
COMPILER=$(ROOTDIR)/ocamlc
@ -33,7 +32,7 @@ OPTCOMPFLAGS=
endif
OPTCOMPILER=$(ROOTDIR)/ocamlopt
CAMLOPT=$(CAMLRUN) $(OPTCOMPILER)
CAMLDEP=$(CAMLRUN) $(ROOTDIR)/boot/ocamlc -depend
CAMLDEP=$(BOOT_OCAMLC) -depend
DEPFLAGS=-slash
OC_CPPFLAGS += -I$(ROOTDIR)/runtime
@ -241,7 +240,7 @@ stdlib__%.cmx: %.ml
-o $@ -c $<
# Dependencies on the compiler
COMPILER_DEPS=$(filter-out -use-prims, $(COMPILER))
COMPILER_DEPS=$(filter-out -use-prims $(CAMLRUN), $(CAMLC))
$(OBJS) std_exit.cmo: $(COMPILER_DEPS)
$(OBJS:.cmo=.cmi) std_exit.cmi: $(COMPILER_DEPS)
$(OBJS:.cmo=.cmx) std_exit.cmx: $(OPTCOMPILER)

View File

@ -26,7 +26,6 @@ endef
$(foreach i,BINDIR LIBDIR STUBLIBDIR MANDIR,$(eval $(shellquote)))
endif
CAMLRUN ?= $(ROOTDIR)/boot/ocamlrun
DESTDIR ?=
# Setup GNU make variables storing per-target source and target,
# a list of installed tools, and a function to quote a filename for
@ -73,7 +72,7 @@ $(eval $(call \
byte_and_opt_,$(subst $$,$$$$,$1),$(subst $$,$$$$,$2),$(subst $$,$$$$,$3)))
endef
CAMLC = $(CAMLRUN) $(ROOTDIR)/boot/ocamlc -g -nostdlib -I $(ROOTDIR)/boot \
CAMLC = $(BOOT_OCAMLC) -g -nostdlib -I $(ROOTDIR)/boot \
-use-prims $(ROOTDIR)/runtime/primitives -I $(ROOTDIR)
CAMLOPT = $(CAMLRUN) $(ROOTDIR)/ocamlopt -g -nostdlib -I $(ROOTDIR)/stdlib
CAMLLEX = $(CAMLRUN) $(ROOTDIR)/boot/ocamllex
@ -427,7 +426,7 @@ clean::
clean::
rm -f *.cmo *.cmi *.cma *.dll *.so *.lib *.a
CAMLDEP=$(CAMLRUN) $(ROOTDIR)/boot/ocamlc -depend
CAMLDEP=$(BOOT_OCAMLC) -depend
DEPFLAGS=-slash
DEPINCLUDES=$(INCLUDES)
depend: beforedepend