Files
mercury/scripts/Mmake.vars.in
Simon Taylor 5d693f5a1c Factor out the common Mmake code to set up the mmc, mgnuc
Estimated hours taken: 8
Branches: main

Factor out the common Mmake code to set up the mmc, mgnuc
and ml flags when building the Mercury compiler and libraries.
Use options, not environment variables. This will make it simpler
to use `mmc --make' to compile the compiler.

Mmake.workspace:
	Similar to tools/lmc. Sets up Mmake variables to
	use the library files in a workspace rather than
	an installed library.

configure.in:
	Check for the `--no-mercury-stdlib-dir' mmc option.
	Bootstrap CVS tag: bootstrap_20020429_stdlib_dir

Mmake.common.in:
*/Mmakefile:
	Move common code into Mmake.workspace.

browser/Mmakefile:
library/Mmakefile:
	Avoid invoking the linker explicitly when creating
	libraries of Mercury code. That won't work well
	with `mmc --make'.

tools/bootcheck:
tests/Mmake.common:
	Use Mmake.workspace instead of setting up environment
	variables in bootcheck.

scripts/Mmake.vars.in:
	mmc compiles split C files to object code itself,
	so pass `--cflags "$(ALL_CFLAGS)"' to mmc when
	compiling with `--split-c-files'.

browser/interactive_query.m:
	Use `mmc --make' when compiling the query. This is needed
	to make tests/debugger/interactive_query.m work when linking
	against a workspace using options rather than environment
	variables.  This also fixes a bug -- mmc options were being
	passed to ml.

	Clean up after the query.

tests/debugger/Mmakefile:
tests/debugger/interactive.inp:
tests/debugger/interactive.inp.subdirs:
tests/debugger/interactive.inp.nosubdirs:
tests/debugger/interactive.exp:
tests/debugger/interactive.exp2:
	Generate the input file to this test so that MCFLAGS
	and MC_MAKE_FLAGS (from Mmake.workspace) are used when
	compiling queries.

	tests/debugger/Mmakefile now sets SHELL to /usr/local/bash
	to allow the use of $(...) style command substitution
	(`...` style command substitution can't be nested).

tests/warnings/Mmakefile:
tests/dppd/Mmakefile:
	Include tests/Mmake.common.

tools/*:
scripts/c2init.in:
scripts/ml.in:
	Update the lists of files containing the library names.
2002-04-29 08:22:08 +00:00

692 lines
23 KiB
Plaintext

#-----------------------------------------------------------------------------#
# Copyright (C) 1996-2002 The University of Melbourne.
# This file may only be copied under the terms of the GNU General
# Public License - see the file COPYING in the Mercury distribution.
#-----------------------------------------------------------------------------#
# Mmake.vars - variables for building Mercury programs
# This file gives the default values for certain variables.
# The values here can be overridden by individual Mmake files.
# Ensure that commands use /bin/sh not the user's shell
SHELL = /bin/sh
ALL_EXTRA_LIBRARIES = $(TARGET_EXTRA_LIBRARIES) $(EXTRA_LIBRARIES)
EXTRA_LIB_DIRS =
EXTRA_LIBRARIES =
EXTRA_INT_DIRS = $(patsubst %,%/ints,$(EXTRA_LIB_DIRS))
MERCURY_EXTRA_INT_DIRS = $(EXTRA_INT_DIRS)
EXTRA_C_LIB_DIRS = \
$(patsubst %,%/lib/$(GRADESTRING)/@FULLARCH@,$(EXTRA_LIB_DIRS)) \
$(patsubst %,%/lib/@FULLARCH@,$(EXTRA_LIB_DIRS))
EXTRA_C_INCL_DIRS = $(patsubst %,%/inc,$(EXTRA_LIB_DIRS))
EXTRA_INIT_DIRS = $(patsubst %,%/modules,$(EXTRA_LIB_DIRS))
MERCURY_EXTRA_INIT_DIRS = $(EXTRA_INIT_DIRS)
# Set the directory search path.
# (See the GNU Make manual for documentation about VPATH and GPATH.)
# We need to substitute all spaces with colons for the VPATH to work.
# Getting a space to be recognised as the first argument of the subst
# function is problematic; hence the `$(nullstring)' hack.
# XXX Note that directory names with spaces in them (e.g. under Windows)
# will cause problems for the VPATH settings below, as well as every
# occurrence of $(patsubst ...), since GNU Make does not respect quotes.
nullstring =
MMAKE_VPATH = $(subst $(nullstring) ,:,$(strip \
$(MERCURY_EXTRA_INT_DIRS) $(MERC_INT_DIR)\
$(MERCURY_EXTRA_INIT_DIRS)))
VPATH = $(MMAKE_VPATH) # do not remove the `:' from this comment!!!
# the above comment works around a misfeature of
# autoconf which causes it to delete assignments to
# VPATH unless they contain a `:'
GPATH = $(VPATH)
DEFAULT_GRADE = $(MERCURY_DEFAULT_GRADE)
GRADE = $(DEFAULT_GRADE)
GRADESTRING = $(shell $(MCOGS) $(ALL_GRADEFLAGS))
# This may be overridden on the command line
TARGET_ASM = no
ifeq ($(TARGET_ASM),yes)
ASM_OPT = --target asm
else
ASM_OPT =
endif
#-----------------------------------------------------------------------------#
#-----------------------------------------------------------------------------#
#
# The following variables hold the names of various programs and
# the options which should be passed to them.
#
#-----------------------------------------------------------------------------#
#-----------------------------------------------------------------------------#
#
# Stuff which is not specific to any back-end
#
ALL_GRADEFLAGS = $(USUAL_GRADEFLAGS) $(ASM_OPT)
USUAL_GRADEFLAGS = $(GRADEFLAGS) $(EXTRA_GRADEFLAGS) $(TARGET_GRADEFLAGS)
GRADEFLAGS = --grade $(GRADE)
EXTRA_GRADEFLAGS =
MC = mmc
ALL_MCFLAGS = $(MCFLAGS) $(EXTRA_MCFLAGS) $(TARGET_MCFLAGS) $(LIB_MCFLAGS)
MCFLAGS =
EXTRA_MCFLAGS =
LIB_MCFLAGS = $(patsubst %,-I %,$(EXTRA_INT_DIRS))
MCS = $(MC) --split-c-files --compile-only
MCG = $(MC) --compile-to-c
MCE = $(MC) --errorcheck-only
MCD = $(MC) --generate-dependencies
MCI = $(MC) --make-interface
MCPI = $(MC) --make-private-interface
MCSI = $(MC) --make-short-interface
MCOI = $(MC) --make-optimization-interface
MCTOI = $(MC) --make-transitive-optimization-interface
MCOGS = $(MC) --output-grade-string
ALL_MCIFLAGS = $(MCIFLAGS) $(EXTRA_MCIFLAGS) $(TARGET_MCFLAGS) \
$(LIB_MCFLAGS)
ALL_MCPIFLAGS = $(MCPIFLAGS) $(EXTRA_MCPIFLAGS) $(TARGET_MCFLAGS) \
$(LIB_MCFLAGS)
ALL_MCSIFLAGS = $(MCSIFLAGS) $(EXTRA_MCSIFLAGS) $(TARGET_MCFLAGS) \
$(LIB_MCFLAGS)
ALL_MCOIFLAGS = $(MCOIFLAGS) $(EXTRA_MCOIFLAGS) $(TARGET_MCFLAGS) \
$(LIB_MCFLAGS)
ALL_MCTOIFLAGS = $(MCTOIFLAGS) $(EXTRA_MCTOIFLAGS) $(TARGET_MCFLAGS) \
$(LIB_MCFLAGS)
ALL_MCDFLAGS = $(MCDFLAGS) $(EXTRA_MCDFLAGS) $(TARGET_MCFLAGS) \
$(LIB_MCFLAGS)
ALL_MCGFLAGS = $(MCGFLAGS) $(EXTRA_MCGFLAGS) $(TARGET_MCFLAGS) \
$(LIB_MCFLAGS)
ALL_MCSFLAGS = $(MCSFLAGS) $(EXTRA_MCSFLAGS) $(TARGET_MCFLAGS) \
$(LIB_MCFLAGS) --cflags "$(ALL_CFLAGS)"
MCIFLAGS = $(MCFLAGS)
MCPIFLAGS = $(MCFLAGS)
MCSIFLAGS = $(MCFLAGS)
MCOIFLAGS = $(MCFLAGS)
MCTOIFLAGS = $(MCFLAGS)
MCDFLAGS = $(MCFLAGS)
MCGFLAGS = $(MCFLAGS)
MCSFLAGS = $(MCFLAGS)
EXTRA_MCIFLAGS = $(EXTRA_MCFLAGS)
EXTRA_MCPIFLAGS = $(EXTRA_MCFLAGS)
EXTRA_MCSIFLAGS = $(EXTRA_MCFLAGS)
EXTRA_MCOIFLAGS = $(EXTRA_MCFLAGS)
EXTRA_MCTOIFLAGS= $(EXTRA_MCFLAGS)
EXTRA_MCDFLAGS = $(EXTRA_MCFLAGS)
EXTRA_MCGFLAGS = $(EXTRA_MCFLAGS)
EXTRA_MCSFLAGS = $(EXTRA_MCFLAGS)
#-----------------------------------------------------------------------------#
#
# Stuff which is specific to the C back-ends
#
MGNUC = mgnuc
ALL_MGNUCFLAGS = $(MGNUCFLAGS) $(EXTRA_MGNUCFLAGS) $(TARGET_MGNUCFLAGS) \
$(LIB_MGNUCFLAGS) -- $(ALL_CFLAGS)
MGNUCFLAGS =
EXTRA_MGNUCFLAGS =
LIB_MGNUCFLAGS = $(patsubst %,-I %,$(EXTRA_C_INCL_DIRS))
ALL_CFLAGS = $(CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CFLAGS)
CFLAGS =
EXTRA_CFLAGS =
#-----------------------------------------------------------------------------#
#
# Stuff for the .NET back-end
#
# MS_CL is the command line version of Microsoft Visual C++, which we
# use to compile Managed C++ code in the .NET backend.
MS_CL = @MS_CL@
MS_VISUALCPP_DIR = @MS_VISUALCPP_DIR@
ALL_MS_CLFLAGS = $(MS_CLFLAGS) $(EXTRA_MS_CLFLAGS) $(TARGET_MS_CLFLAGS) \
$(LIB_MS_CLFLAGS)
MS_CLFLAGS =
EXTRA_MS_CLFLAGS =
MS_VC7_INCLUDES = -I"`cygpath -w '$(MS_VISUALCPP_DIR)/include'`"
LIB_MS_CLFLAGS = $(MS_VC7_INCLUDES) $(patsubst %,-I %,$(EXTRA_C_INCL_DIRS))
# MS_CL_NOASM can be used to turn off assembly generation. Use
# MS_CL_NOASM=:noAssembly to turn it off, leave it blank to turn it on.
MS_CL_NOASM =
MS_DOTNET_SDK_DIR=@MS_DOTNET_SDK_DIR@
# The system libraries were once needed here, but are currently unnecessary.
MS_CL_LIBS =
# XXX handle the case where MERCURY_STDLIB_DIR is not set.
MERC_C_INCL_DIR = $(MERCURY_STDLIB_DIR)/inc
MERC_DLL_DIR = $(MERCURY_STDLIB_DIR)/lib/ilc/@FULLARCH@
# MS_ILASM is the Microsoft IL assembler, which turns IL assembly code
# into bytecode.
MS_ILASM = @ILASM@
ALL_MS_ILASMFLAGS= $(MS_ILASMFLAGS) $(EXTRA_MS_ILASMFLAGS) \
$(TARGET_MS_ILASMFLAGS) $(LIB_MS_ILASMFLAGS) $(ILASM_KEYFLAG)
MS_ILASMFLAGS =
EXTRA_MS_ILASMFLAGS =
LIB_MS_ILASMFLAGS= $(patsubst %,-I %,$(EXTRA_C_INCL_DIRS))
# MS_AL is the Microsoft assembly linker, which creates and installs
# assemblies.
MS_AL = al
# MS_CSC is the command line version of C# compiler
MS_CSC = csc
ALL_MS_CSCFLAGS = $(MS_CSCFLAGS) $(EXTRA_MS_CSCFLAGS) $(TARGET_MS_CSCFLAGS) \
$(LIB_MS_CSCFLAGS)
MS_CSCFLAGS =
EXTRA_MS_CSCFLAGS =
LIB_MS_CSCFLAGS =
#-----------------------------------------------------------------------------#
#
# Stuff for the Java back-end
#
# JAVAC is the command line java compiler;
# it should generate .class files from .java files.
JAVAC = javac
ALL_JAVACFLAGS = $(JAVACFLAGS) $(EXTRA_JAVACFLAGS) $(TARGET_JAVACFLAGS) \
$(LIB_JAVACFLAGS)
JAVACFLAGS =
EXTRA_JAVACFLAGS =
# XXX Should we set LIB_JAVACFLAGS?
LIB_JAVACFLAGS =
#-----------------------------------------------------------------------------#
#
# Stuff related to linking (for the C and assembler back-ends).
#
C2INIT = c2init
ALL_C2INITFLAGS = $(C2INIT_AND_MLFLAGS)
C2INITFLAGS =
EXTRA_C2INITFLAGS =
LIB_C2INITFLAGS = $(patsubst %,--init-file-directory %,$(EXTRA_INIT_DIRS))
ALL_C2INITARGS = $(C2INITARGS) $(EXTRA_C2INITARGS) $(TARGET_C2INITARGS) \
$(LIB_C2INITARGS)
C2INITARGS =
EXTRA_C2INITARGS =
LIB_C2INITARGS = $(patsubst %,%.init,$(ALL_EXTRA_LIBRARIES))
# c2init and ml take the same arguments.
C2INIT_AND_MLFLAGS = $(MLFLAGS) $(C2INITFLAGS) \
$(EXTRA_MLFLAGS) $(EXTRA_C2INITFLAGS) \
$(TARGET_MLFLAGS) $(TARGET_C2INITFLAGS) \
$(LIB_MLFLAGS) $(LIB_C2INITFLAGS)
ML = ml
ALL_MLFLAGS = $(C2INIT_AND_MLFLAGS)
MLFLAGS =
EXTRA_MLFLAGS =
LIB_MLFLAGS = $(patsubst %,-R%,$(EXTRA_C_LIB_DIRS)) \
$(patsubst %,-L%,$(EXTRA_C_LIB_DIRS))
ALL_LDFLAGS = $(LDFLAGS) $(EXTRA_LDFLAGS) $(TARGET_LDFLAGS)
LDFLAGS =
EXTRA_LDFLAGS =
# Flags to use when linking a shared library.
ALL_LD_LIBFLAGS = $(LD_LIBFLAGS) $(EXTRA_LD_LIBFLAGS) $(TARGET_LD_LIBFLAGS)
LD_LIBFLAGS =
EXTRA_LD_LIBFLAGS =
ALL_MLOBJS = $(MLOBJS) $(EXTRA_MLOBJS) $(TARGET_MLOBJS)
MLOBJS =
EXTRA_MLOBJS =
ALL_MLPICOBJS = $(ALL_MLOBJS:.o=.$(EXT_FOR_PIC_OBJECTS))
ALL_MLLIBS = $(MLLIBS) $(EXTRA_MLLIBS) $(TARGET_MLLIBS) $(LIB_MLLIBS)
# XXX ALL_MLLIBS_DEP should contain a list of the file names of the
# libraries specified in ALL_MLLIBS, but I can't see how to know whether
# they should be `.a' or `.so' libraries, so for now we leave it empty.
#ALL_MLLIBS_DEP = $(patsubst -l%,lib%.???,$(ALL_MLLIBS))
ALL_MLLIBS_DEP =
MLLIBS =
EXTRA_MLLIBS =
LIB_MLLIBS = $(patsubst %,-l%,$(ALL_EXTRA_LIBRARIES))
#-----------------------------------------------------------------------------#
#
# Stuff related to the Prolog back-ends
# (XXX This is all obsolete and should probably be deleted)
#
MNC = mnc
ALL_MNCFLAGS = $(MNCFLAGS) $(EXTRA_MNCFLAGS) $(TARGET_MNCFLAGS)
MNCFLAGS =
EXTRA_MNCFLAGS =
MNL = mnl
ALL_MNLFLAGS = $(MNLFLAGS) $(EXTRA_MNLFLAGS) $(TARGET_MNLFLAGS)
MNLFLAGS =
EXTRA_MNLFLAGS =
MNP = mnp
ALL_MNPFLAGS = $(MNPFLAGS) $(EXTRA_MNPFLAGS) $(TARGET_MNPFLAGS)
MNPFLAGS =
EXTRA_MNPFLAGS =
MSC = msc
ALL_MSCFLAGS = $(MSCFLAGS) $(EXTRA_MSCFLAGS) $(TARGET_MSCFLAGS)
MSCFLAGS =
EXTRA_MSCFLAGS =
MSL = msl
ALL_MSLFLAGS = $(MSLFLAGS) $(EXTRA_MSLFLAGS) $(TARGET_MSLFLAGS)
MSLFLAGS =
EXTRA_MSLFLAGS =
MSP = msp
ALL_MSPFLAGS = $(MSPFLAGS) $(EXTRA_MSPFLAGS) $(TARGET_MSPFLAGS)
MSPFLAGS =
EXTRA_MSPFLAGS =
#-----------------------------------------------------------------------------#
#
# Stuff related to creating libraries
#
AR = @AR@
ALL_ARFLAGS = $(ARFLAGS) $(EXTRA_ARFLAGS) $(TARGET_ARFLAGS)
ARFLAGS = @ARFLAGS@
EXTRA_ARFLAGS =
AR_LIBFILE_OPT = @AR_LIBFILE_OPT@
RANLIB = @RANLIB@
ALL_RANLIBFLAGS = $(RANLIBFLAGS) $(EXTRA_RANLIBFLAGS) $(TARGET_RANLIBFLAGS)
RANLIBFLAGS =
EXTRA_RANLIBFLAGS =
# List of grades to install for a library
ALL_LIBGRADES = $(TARGET_LIBGRADES) $(EXTRA_TARGET_LIBGRADES)
LIBGRADES =
EXTRA_LIBGRADES =
# $(CFLAGS_FOR_PIC) is passed to the C compiler when creating `.pic_o' files
# (We use `.pic_o' as the extension for `.o' files that must have
# position-independent code.)
CFLAGS_FOR_PIC = @CFLAGS_FOR_PIC@
# $(GCCFLAGS_FOR_PIC) is passed to the GCC back-end when creating
# `.pic_s' files.
GCCFLAGS_FOR_PIC = -fpic
# $(EXT_FOR_PIC_OBJECTS) will be either `.o', if $(CFLAGS_FOR_PIC) is empty,
# or `.pic_o', if special flags are required for compiling files that
# will be put in shared libraries.
EXT_FOR_PIC_OBJECTS = @EXT_FOR_PIC_OBJECTS@
# $(EXT_FOR_SHARED_LIB) will be the extension for shared libraries,
# if the system supports them (e.g. `.so'), or the extension used
# for non-shared libraries (e.g. `.a') if the system doesn't support
# shared libraries.
EXT_FOR_SHARED_LIB = @EXT_FOR_SHARED_LIB@
# XXX RM_C is not used any more (it used to control whether
# the intermediate C files were removed).
# It may still be referred to by `.d' files generated before
# support for RM_C was removed from the compiler.
RM_C = :
# lists of targets that depend on $(ALL_MLOBJS) and $(ALL_MLPICOBJS)
MLOBJS_DEPS =
MLPICOBJS_DEPS =
#-----------------------------------------------------------------------------#
# `TARGET_<prog>FLAGS' is used to pass different flags to <prog> for
# different targets. By setting MCFLAGS-foo, for example, you can add
# extra values to TARGET_MCFLAGS that will used only for compiling foo.m.
#
# For each program <prog>, `TARGET_<prog>FLAGS' expands to
# `$(<prog>FLAGS-$@)' and/or `$(<prog>FLAGS-$*)'.
# $@ and $* are the builtin variables that expand to the
# current target and (for pattern rules) the base name of the current target,
# respectively. So $* is used for flags variables used by pattern rules,
# whereas $@ is used for flags variables used by hard-coded rules,
# including the ones in the generated .dep files.
#
# The code below uses some tricky GNU Make hacks to avoid expanding
# <prog>FLAGS-$* and <prog>FLAGS-$@ if these vars are not defined,
# so that we can avoid spurious warnings if the warning about
# undefined variables is enabled.
TARGET_GRADEFLAGS = \
$(maybe-base-GRADEFLAGS-$(findstring undefined,\
$(origin GRADEFLAGS-$(patsubst %_init,%,$*)))) \
$(maybe-target-GRADEFLAGS-$(findstring undefined,\
$(origin GRADEFLAGS-$(patsubst $(cs_subdir)%_init.c,%,$@))))
maybe-base-GRADEFLAGS- = $(GRADEFLAGS-$(patsubst %_init,%,$*))
maybe-base-GRADEFLAGS-undefined =
maybe-target-GRADEFLAGS- = $(GRADEFLAGS-$(patsubst $(cs_subdir)%_init.c,%,$@))
maybe-target-GRADEFLAGS-undefined =
TARGET_MCFLAGS = \
$(maybe-base-MCFLAGS-$(findstring undefined,$(origin MCFLAGS-$*)))
maybe-base-MCFLAGS- = $(MCFLAGS-$*)
maybe-base-MCFLAGS-undefined =
TARGET_C2INITFLAGS = \
$(maybe-target-C2INITFLAGS-$(findstring undefined,\
$(origin C2INITFLAGS-$(patsubst $(cs_subdir)%_init.c,%,$@))))
maybe-target-C2INITFLAGS- = $(C2INITFLAGS-$(patsubst $(cs_subdir)%_init.c,%,$@))
maybe-target-C2INITFLAGS-undefined =
TARGET_C2INITARGS = \
$(maybe-base-C2INITARGS-$(findstring undefined,\
$(origin C2INITARGS-$*))) \
$(maybe-target-C2INITARGS-$(findstring undefined,\
$(origin C2INITARGS-$(patsubst $(cs_subdir)%_init.c,%,$@))))
maybe-base-C2INITARGS- = $(C2INITARGS-$*)
maybe-base-C2INITARGS-undefined =
maybe-target-C2INITARGS- = $(C2INITARGS-$(patsubst $(cs_subdir)%_init.c,%,$@))
maybe-target-C2INITARGS-undefined =
TARGET_MGNUCFLAGS = \
$(maybe-base-MGNUCFLAGS-$(findstring undefined,$(origin MGNUCFLAGS-$*)))
maybe-base-MGNUCFLAGS- = $(MGNUCFLAGS-$*)
maybe-base-MGNUCFLAGS-undefined =
TARGET_CFLAGS = \
$(maybe-base-CFLAGS-$(findstring undefined,$(origin CFLAGS-$*))) \
$(maybe-target-CFLAGS-$(findstring undefined,$(origin CFLAGS-$@)))
maybe-base-CFLAGS- = $(CFLAGS-$*)
maybe-base-CFLAGS-undefined =
maybe-target-CFLAGS- = $(CFLAGS-$@)
maybe-target-CFLAGS-undefined =
# Note we strip any trailing `_init.c' from `$@' so we get the appropriate
# "base" name, regardless of whether this variable ends up being used as
# an argument of a `c2init' rule or an `ml' rule.
TARGET_MLFLAGS = \
$(maybe-target-MLFLAGS-$(findstring undefined,\
$(origin MLFLAGS-$(patsubst $(cs_subdir)%_init.c,%,$@))))
maybe-target-MLFLAGS- = $(MLFLAGS-$(patsubst $(cs_subdir)%_init.c,%,$@))
maybe-target-MLFLAGS-undefined =
TARGET_LDFLAGS = \
$(maybe-target-LDFLAGS-$(findstring undefined,$(origin LDFLAGS-$@)))
maybe-target-LDFLAGS- = $(LDFLAGS-$@)
maybe-target-LDFLAGS-undefined =
TARGET_LD_LIBFLAGS = \
$(maybe-target-LD_LIBFLAGS-$(findstring undefined,$(origin LD_LIBFLAGS-$@)))
maybe-target-LD_LIBFLAGS- = $(LD_LIBFLAGS-$@)
maybe-target-LD_LIBFLAGS-undefined =
TARGET_MLOBJS = \
$(maybe-target-MLOBJS-$(findstring undefined,$(origin MLOBJS-$@)))
maybe-target-MLOBJS- = $(MLOBJS-$@)
maybe-target-MLOBJS-undefined =
TARGET_MLLIBS = \
$(maybe-target-MLLIBS-$(findstring undefined,$(origin MLLIBS-$@)))
maybe-target-MLLIBS- = $(MLLIBS-$@)
maybe-target-MLLIBS-undefined =
TARGET_ARFLAGS = \
$(maybe-target-ARFLAGS-$(findstring undefined,$(origin ARFLAGS-$@)))
maybe-target-ARFLAGS- = $(ARFLAGS-$@)
maybe-target-ARFLAGS-undefined =
TARGET_RANLIBFLAGS = \
$(maybe-target-RANLIBFLAGS-$(findstring undefined,$(origin RANLIBFLAGS-$@)))
maybe-target-RANLIBFLAGS- = $(RANLIBFLAGS-$@)
maybe-target-RANLIBFLAGS-undefined =
# Note we strip any trailing `_init.c' from `$@' so we get the appropriate
# "base" name, regardless of whether this variable ends up being used as
# an argument of a `c2init' rule or an `ml' rule.
TARGET_EXTRA_LIBRARIES = \
$(maybe-target-EXTRA_LIBRARIES-$(findstring undefined,\
$(origin EXTRA_LIBRARIES-$(patsubst $(cs_subdir)%_init.c,%,$@))))
maybe-target-EXTRA_LIBRARIES- = \
$(EXTRA_LIBRARIES-$(patsubst $(cs_subdir)%_init.c,%,$@))
maybe-target-EXTRA_LIBRARIES-undefined =
TARGET_LIBGRADES = \
$(maybe-base-LIBGRADES-$(findstring undefined,$(origin LIBGRADES-$*)))
maybe-base-LIBGRADES- = $(LIBGRADES-$*)
maybe-base-LIBGRADES-undefined = $(LIBGRADES) $(EXTRA_LIBGRADES)
EXTRA_TARGET_LIBGRADES = \
$(maybe-base-EXTRA_LIBGRADES-$(findstring undefined,\
$(origin EXTRA_LIBGRADES-$*)))
maybe-base-EXTRA_LIBGRADES- = $(EXTRA_LIBGRADES-$*)
maybe-base-EXTRA_LIBGRADES-undefined =
TARGET_MS_CLFLAGS = \
$(maybe-base-MS_CLFLAGS-$(findstring undefined,$(origin MS_CLFLAGS-$*)))
maybe-base-MS_CLFLAGS- = $(MS_CLFLAGS-$*)
maybe-base-MS_CLFLAGS-undefined =
TARGET_MS_CSCFLAGS = \
$(maybe-base-MS_CSCFLAGS-$(findstring undefined,$(origin MS_CSCFLAGS-$*)))
maybe-base-MS_CSCFLAGS- = $(MS_CSCFLAGS-$*)
maybe-base-MS_CSCFLAGS-undefined =
TARGET_MS_ILASMFLAGS = \
$(maybe-base-MS_ILASMFLAGS-$(findstring undefined,$(origin MS_ILASMFLAGS-$*)))
maybe-base-MS_ILASMFLAGS- = $(MS_ILASMFLAGS-$*)
maybe-base-MS_ILASMFLAGS-undefined =
ILASM_KEYFLAG = \
$(maybe-target-ILASM_KEYFLAG-$(findstring undefined,$(origin ILASM_KEYFLAG-$*)))
maybe-target-ILASM_KEYFLAG- = $(ILASM_KEYFLAG-$*)
maybe-target-ILASM_KEYFLAG-undefined =
TARGET_JAVACFLAGS = \
$(maybe-base-JAVACFLAGS-$(findstring undefined,$(origin JAVACFLAGS-$*)))
maybe-base-JAVACFLAGS- = $(JAVACFLAGS-$*)
maybe-base-JAVACFLAGS-undefined =
# Support for compiling Mercury programs with Prolog will probably be
# dropped one of these days, so it's probably not worth bothering with these.
TARGET_MNCFLAGS =
TARGET_MNLFLAGS =
TARGET_MNPFLAGS =
TARGET_MSCFLAGS =
TARGET_MSLFLAGS =
TARGET_MSPFLAGS =
#-----------------------------------------------------------------------------#
#
# The following variables specify the names of the subdirectories used,
# so that you can write code which works both with and without the
# `--use-subdirs' option.
#
ifeq ($(MMAKE_USE_SUBDIRS),yes)
# If you change any of these, you may need to update
# `mercury_cleanup_install'.
SUBDIR=Mercury/
nos_subdir=$(SUBDIR)nos/
qls_subdir=$(SUBDIR)qls/
deps_subdir=$(SUBDIR)deps/
ds_subdir=$(SUBDIR)ds/
module_deps_subdir=$(SUBDIR)module_deps/
int0s_subdir=$(SUBDIR)int0s/
ints_subdir=$(SUBDIR)ints/
int2s_subdir=$(SUBDIR)int2s/
int3s_subdir=$(SUBDIR)int3s/
opts_subdir=$(SUBDIR)opts/
trans_opts_subdir=$(SUBDIR)trans_opts/
date0s_subdir=$(SUBDIR)date0s/
dates_subdir=$(SUBDIR)dates/
date3s_subdir=$(SUBDIR)date3s/
optdates_subdir=$(SUBDIR)optdates/
trans_opt_dates_subdir=$(SUBDIR)trans_opt_dates/
useds_subdir=$(SUBDIR)useds/
cs_subdir=$(SUBDIR)cs/
dlls_subdir=$(SUBDIR)dlls/
ss_subdir=$(SUBDIR)ss/
pic_ss_subdir=$(SUBDIR)pic_ss/
os_subdir=$(SUBDIR)os/
# `.rlo' files are used by the Aditi query shell, which
# doesn't know about `--use-subdirs'.
rlos_subdir=
ils_subdir=$(SUBDIR)ils/
javas_subdir=$(SUBDIR)javas/
dirs_subdir=$(SUBDIR)dirs/
num_splits_subdir=$(SUBDIR)num_splits/
c_dates_subdir=$(SUBDIR)c_dates/
s_dates_subdir=$(SUBDIR)s_dates/
pic_s_dates_subdir=$(SUBDIR)pic_s_dates/
il_dates_subdir=$(SUBDIR)il_dates/
java_dates_subdir=$(SUBDIR)java_dates/
classes_subdir=$(SUBDIR)classs/
err_dates_subdir=$(SUBDIR)err_dates/
else
SUBDIR=
nos_subdir=
qls_subdir=
deps_subdir=
ds_subdir=
module_deps_subdir=
int0s_subdir=
ints_subdir=
int2s_subdir=
int3s_subdir=
opts_subdir=
trans_opts_subdir=
date0s_subdir=
dates_subdir=
date3s_subdir=
optdates_subdir=
trans_opt_dates_subdir=
useds_subdir=
cs_subdir=
dlls_subdir=
ss_subdir=
pic_ss_subdir=
os_subdir=
rlos_subdir=
ils_subdir=
javas_subdir=
dirs_subdir=
num_splits_subdir=
c_dates_subdir=
s_dates_subdir=
pic_s_dates_subdir=
il_dates_subdir=
java_dates_subdir=
classes_subdir=
err_dates_subdir=
endif
#-----------------------------------------------------------------------------#
# This needs to go here so that user Mmake files can add new suffixes.
.SUFFIXES: # reset sufix list to be empty
#-----------------------------------------------------------------------------#
MAIN_TARGET =
default_target: main_target
#-----------------------------------------------------------------------------#
# Specify commands for installing things.
INSTALL = cp
INSTALL_MKDIR = mkdir -p
#-----------------------------------------------------------------------------#
# Specify the locations for installing things.
# These directories can all be modified independently.
# In particular, you might want to find a better place for the DVI and
# HTML files.
# FINAL_INSTALL_PREFIX describes the directory that the installation
# will finally end up in. When building the Mercury compiler, it
# should only be set by the configure script. Other
# FINAL_INSTALL_* variables have a similar meaning.
#
# If you want to install to a different directory temporarily (e.g.
# to build a package, or if you don't have the permissions to install
# to a final directory), override INSTALL_PREFIX on the command-line.
# If you have previously configured to the directory you want to
# finally install to, you will then be able to move the files safely,
# since any hard-coded paths will be set to their final destination
# already (note that the installation in the temporary directory may
# not work until moved into its final destination).
# e.g.
# configure --prefix /usr
# make INSTALL_PREFIX=/some/temporary/directory/usr
# If you don't intend to install to a temporary directory, rather than
# overriding INSTALL_PREFIX you should reconfigure using the configure
# script, since there are some hardcoded paths created by the configure
# script (e.g. in the shell scripts mmc, ml, mmake, etc) that will not
# be updated simply by overriding INSTALL_PREFIX.
INSTALL_PREFIX = @prefix@
FINAL_INSTALL_PREFIX = @prefix@
INSTALL_BINDIR = $(INSTALL_PREFIX)/bin
INSTALL_LIBDIR = $(INSTALL_PREFIX)/lib/mercury
FINAL_INSTALL_LIBDIR = $(FINAL_INSTALL_PREFIX)/lib/mercury
INSTALL_INFO_DIR = $(INSTALL_PREFIX)/info
INSTALL_DVI_DIR = $(INSTALL_PREFIX)/lib/mercury/doc
INSTALL_TEXT_DIR = $(INSTALL_PREFIX)/lib/mercury/doc
INSTALL_PS_DIR = $(INSTALL_PREFIX)/lib/mercury/doc
INSTALL_MAN_DIR = $(INSTALL_PREFIX)/man
INSTALL_HTML_DIR = $(INSTALL_PREFIX)/lib/mercury/html
INSTALL_MDB_DOC_DIR = $(INSTALL_PREFIX)/lib/mercury/mdb
INSTALL_ELISP_DIR = $(INSTALL_PREFIX)/lib/mercury/elisp
INSTALL_CGI_DIR = @CGIDIR@
# You should not need to override anything below here
INSTALL_MODULE_DIR = $(INSTALL_LIBDIR)/modules
INSTALL_INT_DIR = $(INSTALL_LIBDIR)/ints
INSTALL_INC_DIR = $(INSTALL_LIBDIR)/inc
INSTALL_MMAKE_DIR = $(INSTALL_LIBDIR)/mmake
FULLARCH = @FULLARCH@
INSTALL_MERC_BIN_DIR = $(INSTALL_LIBDIR)/bin/$(FULLARCH)
INSTALL_MERC_GRADELESS_LIB_DIR = $(INSTALL_LIBDIR)/lib/$(FULLARCH)
FINAL_INSTALL_MERC_GRADELESS_LIB_DIR = $(FINAL_INSTALL_LIBDIR)/lib/$(FULLARCH)
INSTALL_MERC_LIB_DIR = $(INSTALL_LIBDIR)/lib/$(GRADESTRING)/$(FULLARCH)
FINAL_INSTALL_MERC_LIB_DIR = \
$(FINAL_INSTALL_LIBDIR)/lib/$(GRADESTRING)/$(FULLARCH)
#-----------------------------------------------------------------------------#
# Specify the additional compilation models to install by default
LIBGRADES = @LIBGRADES@
#-----------------------------------------------------------------------------#
# We need to use $(empty_string) here to prevent Make from truncating
# any trailing spaces in @OBJFILE_OPT@
empty_string=
OBJFILE_OPT=@OBJFILE_OPT@$(empty_string)
EXT_FOR_EXE=@EXEEXT@
O=@OBJ_SUFFIX@
A=@LIB_SUFFIX@
#-----------------------------------------------------------------------------#