2016-04-24 09:56:31 -07:00
|
|
|
#**************************************************************************
|
|
|
|
#* *
|
|
|
|
#* OCaml *
|
|
|
|
#* *
|
|
|
|
#* Xavier Clerc, SED, INRIA Rocquencourt *
|
|
|
|
#* *
|
|
|
|
#* Copyright 2010 Institut National de Recherche en Informatique et *
|
|
|
|
#* en Automatique. *
|
|
|
|
#* *
|
|
|
|
#* All rights reserved. This file is distributed under the terms of *
|
|
|
|
#* the GNU Lesser General Public License version 2.1, with the *
|
|
|
|
#* special exception on linking described in the file LICENSE. *
|
|
|
|
#* *
|
|
|
|
#**************************************************************************
|
|
|
|
|
2016-04-25 04:02:53 -07:00
|
|
|
# This makefile provides variables for using the in-tree compiler,
|
|
|
|
# interpreter, lexer and other associated tools. It is intended to be
|
|
|
|
# included within other makefiles.
|
2019-06-05 09:09:00 -07:00
|
|
|
# See manual/tools/Makefile and manual/manual/tutorials/Makefile as examples.
|
2016-04-25 04:02:53 -07:00
|
|
|
# Note that these makefile should define the $(TOPDIR) variable on their
|
|
|
|
# own.
|
2016-04-24 09:56:31 -07:00
|
|
|
|
|
|
|
WINTOPDIR=`cygpath -m "$(TOPDIR)"`
|
|
|
|
|
|
|
|
# TOPDIR is the root directory of the OCaml sources, in Unix syntax.
|
|
|
|
# WINTOPDIR is the same directory, in Windows syntax.
|
|
|
|
|
|
|
|
OTOPDIR=$(TOPDIR)
|
|
|
|
CTOPDIR=$(TOPDIR)
|
|
|
|
CYGPATH=echo
|
|
|
|
DIFF=diff -q
|
|
|
|
SORT=sort
|
|
|
|
SET_LD_PATH=CAML_LD_LIBRARY_PATH="$(LD_PATH)"
|
|
|
|
|
2018-09-12 07:32:44 -07:00
|
|
|
# The variables above may be overridden by .../Makefile.config
|
2016-04-24 09:56:31 -07:00
|
|
|
# OTOPDIR is either TOPDIR or WINTOPDIR, whichever is appropriate for
|
|
|
|
# arguments given to the OCaml compiler.
|
|
|
|
# CTOPDIR is either TOPDIR or WINTOPDIR, whichever is appropriate for
|
|
|
|
# arguments given to the C and Fortran compilers.
|
|
|
|
# CYGPATH is the command that translates unix-style file names into
|
|
|
|
# whichever syntax is appropriate for arguments of OCaml programs.
|
|
|
|
# DIFF is a "diff -q" command that ignores trailing CRs under Windows.
|
|
|
|
# SORT is the Unix "sort" command. Usually a simple command, but may be an
|
|
|
|
# absolute name if the Windows "sort" command is in the PATH.
|
|
|
|
# SET_LD_PATH is a command prefix that sets the path for dynamic libraries
|
|
|
|
# (CAML_LD_LIBRARY_PATH for Unix, PATH for Windows) using the LD_PATH shell
|
|
|
|
# variable. Note that for Windows we add Unix-syntax directory names in
|
|
|
|
# PATH, and Cygwin will translate it to Windows syntax.
|
|
|
|
|
2020-05-04 23:37:59 -07:00
|
|
|
# TOPDIR is legacy, our makefiles should use ROOTDIR now
|
|
|
|
ROOTDIR=$(TOPDIR)
|
|
|
|
include $(ROOTDIR)/Makefile.config_if_required
|
2016-04-24 09:56:31 -07:00
|
|
|
|
2019-05-09 07:25:54 -07:00
|
|
|
# Make sure USE_RUNTIME is defined
|
|
|
|
USE_RUNTIME ?=
|
|
|
|
|
2016-04-24 09:56:31 -07:00
|
|
|
ifneq ($(USE_RUNTIME),)
|
|
|
|
#Check USE_RUNTIME value
|
|
|
|
ifeq ($(findstring $(USE_RUNTIME),d i),)
|
|
|
|
$(error If set, USE_RUNTIME must be equal to "d" (debug runtime) \
|
|
|
|
or "i" (instrumented runtime))
|
|
|
|
endif
|
|
|
|
|
2018-06-20 08:43:29 -07:00
|
|
|
RUNTIME_VARIANT=-I $(OTOPDIR)/runtime \
|
2016-04-24 09:56:31 -07:00
|
|
|
-runtime-variant $(USE_RUNTIME)
|
|
|
|
export OCAMLRUNPARAM?=v=0
|
|
|
|
endif
|
|
|
|
|
2018-06-20 08:43:29 -07:00
|
|
|
OCAMLRUN=$(TOPDIR)/runtime/ocamlrun$(USE_RUNTIME)$(EXE)
|
2016-04-24 09:56:31 -07:00
|
|
|
|
|
|
|
OCFLAGS=-nostdlib -I $(OTOPDIR)/stdlib $(COMPFLAGS)
|
|
|
|
OCOPTFLAGS=
|
|
|
|
|
|
|
|
ifeq ($(SUPPORTS_SHARED_LIBRARIES),false)
|
|
|
|
CUSTOM = -custom
|
|
|
|
else
|
|
|
|
CUSTOM =
|
|
|
|
endif
|
|
|
|
|
2020-06-17 00:29:56 -07:00
|
|
|
OCAML=$(OCAMLRUN) $(OTOPDIR)/ocaml$(EXE) $(OCFLAGS) -noinit
|
2016-04-24 09:56:31 -07:00
|
|
|
ifeq "$(FLEXLINK)" ""
|
|
|
|
FLEXLINK_PREFIX=
|
|
|
|
else
|
|
|
|
ifeq "$(wildcard $(TOPDIR)/flexdll/Makefile)" ""
|
|
|
|
FLEXLINK_PREFIX=
|
|
|
|
else
|
|
|
|
EMPTY=
|
2020-06-17 00:29:56 -07:00
|
|
|
FLEXLINK_PREFIX=OCAML_FLEXLINK="$(WINTOPDIR)/boot/ocamlrun$(EXE) \
|
2016-04-24 09:56:31 -07:00
|
|
|
$(WINTOPDIR)/flexdll/flexlink.exe" $(EMPTY)
|
|
|
|
endif
|
|
|
|
endif
|
2020-06-17 00:29:56 -07:00
|
|
|
OCAMLC=$(FLEXLINK_PREFIX)$(OCAMLRUN) $(OTOPDIR)/ocamlc$(EXE) \
|
|
|
|
$(CUSTOM) $(OCFLAGS) $(RUNTIME_VARIANT)
|
|
|
|
OCAMLOPT=$(FLEXLINK_PREFIX)$(OCAMLRUN) $(OTOPDIR)/ocamlopt$(EXE) $(OCFLAGS) \
|
2016-04-24 09:56:31 -07:00
|
|
|
$(RUNTIME_VARIANT)
|
2020-06-17 00:29:56 -07:00
|
|
|
OCAMLDOC=$(OCAMLRUN) $(OTOPDIR)/ocamldoc/ocamldoc$(EXE)
|
|
|
|
OCAMLLEX=$(OCAMLRUN) $(OTOPDIR)/lex/ocamllex$(EXE)
|
|
|
|
OCAMLMKLIB=$(FLEXLINK_PREFIX)$(OCAMLRUN) $(OTOPDIR)/tools/ocamlmklib$(EXE) \
|
2018-06-20 08:43:29 -07:00
|
|
|
-ocamlc "$(OTOPDIR)/runtime/ocamlrun$(USE_RUNTIME)$(EXE) \
|
2020-06-17 00:29:56 -07:00
|
|
|
$(OTOPDIR)/ocamlc$(EXE) $(OCFLAGS) $(RUNTIME_VARIANT)" \
|
2018-06-20 08:43:29 -07:00
|
|
|
-ocamlopt "$(OTOPDIR)/runtime/ocamlrun$(USE_RUNTIME)$(EXE) \
|
2020-06-17 00:29:56 -07:00
|
|
|
$(OTOPDIR)/ocamlopt$(EXE) $(OCFLAGS) $(RUNTIME_VARIANT)"
|
2016-04-24 09:56:31 -07:00
|
|
|
OCAMLYACC=$(TOPDIR)/yacc/ocamlyacc$(EXE)
|
2020-06-17 00:29:56 -07:00
|
|
|
DUMPOBJ=$(OCAMLRUN) $(OTOPDIR)/tools/dumpobj$(EXE)
|
|
|
|
OBJINFO=$(OCAMLRUN) $(OTOPDIR)/tools/ocamlobjinfo$(EXE)
|
2016-04-24 09:56:31 -07:00
|
|
|
|
|
|
|
#FORTRAN_COMPILER=
|
|
|
|
#FORTRAN_LIBRARY=
|
|
|
|
|
|
|
|
UNIXLIBVAR=`case "$(OTHERLIBRARIES)" in *win32unix*) echo win32;; esac`
|