Makefile.best_binaries: best-effort commands for OCAML{C,OPT,DEP,LEX}

master
Gabriel Scherer 2019-07-28 20:50:45 +02:00
parent 0bc3e66d9c
commit 70adde7ff5
1 changed files with 46 additions and 0 deletions

46
Makefile.best_binaries Normal file
View File

@ -0,0 +1,46 @@
#**************************************************************************
#* *
#* OCaml *
#* *
#* Gabriel Scherer, projet Parsifal, INRIA Saclay *
#* *
#* Copyright 2019 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. *
#* *
#**************************************************************************
# This Makefile should be included.
# It expects:
# - Makefile.common to be included as well
# - a ROOTDIR variable pointing to the repository root
# relative to the including Makefile
# It exports definitions of BEST_OCAML{C,OPT,LEX,DEP} commands that
# run to either the bytecode binary built in the repository or the
# native binary, if available. Note that they never use the boot/
# versions: we assume that ocamlc, ocamlopt, etc. have been run first.
ifeq "$(wildcard $(ROOTDIR)/ocamlc.opt)" ""
BEST_OCAMLC = $(CAMLRUN) $(ROOTDIR)/ocamlc
else
BEST_OCAMLC = $(ROOTDIR)/ocamlc.opt
endif
BEST_OCAMLDEP = $(BEST_OCAMLC) -depend
ifeq "$(wildcard $(ROOTDIR)/ocamlopt.opt)" ""
BEST_OCAMLOPT = $(CAMLRUN) $(ROOTDIR)/ocamlopt
else
BEST_OCAMLOPT = $(ROOTDIR)/ocamlopt.opt
endif
ifeq "$(wildcard $(ROOTDIR)/lex/ocamllex.opt)" ""
BEST_OCAMLLEX = $(CAMLRUN) $(ROOTDIR)/lex/ocamllex
else
BEST_OCAMLLEX = $(ROOTDIR)/lex/ocamllex.opt
endif