Files
mercury/slice/Mmakefile
Julien Fischer 2bb3ad6f44 Install Java archives for the executables in the Mercury system.
If the compiler and (most of) the other tools are built in the Java grade then
have the install target also install the Java archives for the executables.

compiler/Mmakefile:
deep_profiler/Mmakefile:
mfilterjavac/Mmakefile:
profiler/Mmakefile:
slice/Mmakefile:
	As above.  (The ones for the deep profiling tools are are probably
	a bit useless in practice, but the others should all work.)
2015-09-03 20:53:33 +10:00

225 lines
7.6 KiB
Plaintext

#-----------------------------------------------------------------------------#
# vim: ts=8 sw=8 noexpandtab
#-----------------------------------------------------------------------------#
# Copyright (C) 2005-2007, 2009-2012 The University of Melbourne.
# This file may only be copied under the terms of the GNU General
# Public Licence - see the file COPYING in the Mercury distribution.
#-----------------------------------------------------------------------------#
# Mmakefile for building the Mercury slice and dice tools.
MERCURY_DIR=..
LINK_STATIC=yes
include $(MERCURY_DIR)/Mmake.common
#----------------------------------------------------------------------------#
# Override some settings from ../Mmake.workspace so that in debugging grades
# we do not include mer_mdbcomp.init when creating the _init.c files in
# this directory. We copy the mdbcomp modules into this directory so if we
# do include mer_mdbcomp.init we will end up with duplicate entries in the
# _init.c files.
C2INITFLAGS = --trace-init-file $(BROWSER_DIR)/$(BROWSER_LIB_NAME).init
#----------------------------------------------------------------------------#
-include Mmake.slice.params
# Override the default rule in `mmake --use-mmc-make' that asks `mmc' to
# create a missing optional params file.
Mmake.slice.params:
# Module-specific options should go in Mercury.options so they
# can be found by `mmc --make'.
include Mercury.options
MAIN_TARGET = all
# If you add more modules, you'll also have to modify ../Mmakefile.
MERCURY_MAIN_MODULES = mslice mdice mtc_union mcov mtc_diff
DEPENDS = $(patsubst %,%.depend,$(MERCURY_MAIN_MODULES))
INTS = $(patsubst %,%.ints,$(MERCURY_MAIN_MODULES))
INT3S = $(patsubst %,%.int3s,$(MERCURY_MAIN_MODULES))
CHECKS = $(patsubst %,%.check,$(MERCURY_MAIN_MODULES))
PDBS = $(patsubst %,%.pdb,$(MERCURY_MAIN_MODULES))
VPATH = $(LIBRARY_DIR) $(SSDB_DIR)
#-----------------------------------------------------------------------------#
MDBCOMP_MODULES = \
builtin_modules.m \
feedback.automatic_parallelism.m \
feedback.m \
mdbcomp.m \
mdbcomp.goal_path.m \
prim_data.m \
program_representation.m \
rtti_access.m \
shared_utilities.m \
slice_and_dice.m \
sym_name.m \
trace_counts.m
#-----------------------------------------------------------------------------#
MLFLAGS += --shared
MCFLAGS += --flags SLICE_FLAGS $(CONFIG_OVERRIDE)
#-----------------------------------------------------------------------------#
ifneq ("$(filter il% csharp% java% erlang%,$(GRADE))","")
MLOBJS =
endif
#-----------------------------------------------------------------------------#
# Tell the C# compiler where the stdlib assembly is.
#
ifneq ("$(filter csharp%,$(GRADE))","")
CSCFLAGS=-lib:../library -r:mer_std.dll
endif
#-----------------------------------------------------------------------------#
.PHONY: depend
depend: $(MDBCOMP_MODULES) $(DEPENDS)
$(DEPENDS): SLICE_FLAGS $(MDBCOMP_MODULES)
.PHONY: all
all: $(MDBCOMP_MODULES) $(MERCURY_MAIN_MODULES) $(TAGS_FILE_EXISTS)
#-----------------------------------------------------------------------------#
$(MDBCOMP_MODULES): %: $(MDBCOMP_DIR)/%
-@/bin/rm -f $*
@cp $(MDBCOMP_DIR)/$* .
@chmod a-w $*
#-----------------------------------------------------------------------------#
# The C#, IL, Java and Erlang implementations of the mdbcomp library are not yet
# complete, so we need to pass `--allow-stubs' to get them to compile.
# Since the standard library is compiled with `--halt-at-warn',
# we also need `--no-warn-stubs'.
ifneq ("$(filter il% csharp% java% erlang%,$(GRADE))","")
MCFLAGS += --allow-stubs --no-warn-stubs
endif
#-----------------------------------------------------------------------------#
# Add some additional dependencies, so that Mmake knows to remake the
# slicer and dicer if one of the libraries changes.
ifeq ("$(filter il% csharp% java% erlang%,$(GRADE))","")
mslice: $(RUNTIME_DIR)/lib$(RT_LIB_NAME).$A
mslice: $(LIBRARY_DIR)/lib$(STD_LIB_NAME).$A
mslice: $(BROWSER_DIR)/lib$(BROWSER_LIB_NAME).$A
mdice: $(RUNTIME_DIR)/lib$(RT_LIB_NAME).$A
mdice: $(LIBRARY_DIR)/lib$(STD_LIB_NAME).$A
mdice: $(BROWSER_DIR)/lib$(BROWSER_LIB_NAME).$A
# XXX Should also depend on $(BOEHM_GC_DIR)/libgc(_prof).$A, but only
# if in .gc(.prof) grade.
mtc_union: $(RUNTIME_DIR)/lib$(RT_LIB_NAME).$A
mtc_union: $(LIBRARY_DIR)/lib$(STD_LIB_NAME).$A
mtc_union: $(BROWSER_DIR)/lib$(BROWSER_LIB_NAME).$A
mcov: $(RUNTIME_DIR)/lib$(RT_LIB_NAME).$A
mcov: $(LIBRARY_DIR)/lib$(STD_LIB_NAME).$A
mcov: $(BROWSER_DIR)/lib$(BROWSER_LIB_NAME).$A
mtc_diff: $(RUNTIME_DIR)/lib$(RT_LIB_NAME).$A
mtc_diff: $(LIBRARY_DIR)/lib$(STD_LIB_NAME).$A
mtc_diff: $(BROWSER_DIR)/lib$(BROWSER_LIB_NAME).$A
endif
$(cs_subdir)mslice_init.c: $(UTIL_DIR)/mkinit$(EXT_FOR_EXE)
$(cs_subdir)mdice_init.c: $(UTIL_DIR)/mkinit$(EXT_FOR_EXE)
$(cs_subdir)mtc_union.c: $(UTIL_DIR)/mkinit$(EXT_FOR_EXE)
$(cs_subdir)mcov.c: $(UTIL_DIR)/mkinit$(EXT_FOR_EXE)
$(cs_subdir)mtc_diff.c: $(UTIL_DIR)/mkinit$(EXT_FOR_EXE)
#-----------------------------------------------------------------------------#
.PHONY: check
check: $(CHECKS)
.PHONY: ints
ints: $(INTS)
#-----------------------------------------------------------------------------#
tags: .slice_tags
.slice_tags: $(MTAGS) $(mslice.ms) $(mdice.ms) $(mtc_union.ms) $(mcov.ms) \
$(mtc_diff.ms) $(wildcard $(LIBRARY_DIR)/*.m)
$(MTAGS) $(mslice.ms) $(mdice.ms) $(mtc_union.ms) $(mcov.ms) \
$(mtc_diff.ms) $(LIBRARY_DIR)/*.m
@touch .slice_tags
.PHONY: tags_file_exists
tags_file_exists:
@if test ! -f tags; then echo making tags; \
$(MTAGS) $(mslice.ms) $(mdice.ms) $(mtc_union.ms) \
$(mcov.ms) $(mtc_union.ms) $(LIBRARY_DIR)/*.m; \
touch .slice_tags; \
fi
#-----------------------------------------------------------------------------#
.PHONY: dates
dates:
touch $(mslice.dates) $(mdice.dates) $(mtc_union.dates) \
$(mcov.dates) $(mtc_diff.ms)
#-----------------------------------------------------------------------------#
.PHONY: os cs ls
os: $(mslice.os) $(mdice.os) $(mtc_union.os) \
$(os_subdir)mslice_init.o $(os_subdir)mdice_init.o \
$(os_subdir)mtc_union.o $(os_subdir)mcov.o \
$(os_subdir)mtc_diff.o
cs: $(mslice.cs) $(mdice.cs) $(mtc_union.cs) \
$(cs_subdir)mslice_init.c $(cs_subdir)mdice_init.c \
$(cs_subdir)mtc_union.c $(cs_subdir)mcov.c \
$(cs_subdir)mtc_diff.c
ils: $(mslice.ils) $(mdice.ils) $(mtc_union.ils) $(mcov.ils) $(mtc_diff.ils)
#-----------------------------------------------------------------------------#
realclean_local:
rm -f tags SLICE_FLAGS SLICE_FLAGS.date \
.mdbcomp_modules $(MDBCOMP_MODULES) mdbcomp.*.err
rm -f $(PDBS) vc*.pdb
#-----------------------------------------------------------------------------#
# Installation targets
.PHONY: install
install: install_slicer
.PHONY: install_slicer
install_slicer: mslice mdice mtc_union mcov mtc_diff
-[ -d $(INSTALL_MERC_BIN_DIR) ] || mkdir -p $(INSTALL_MERC_BIN_DIR)
cp `vpath_find mslice$(EXT_FOR_EXE)` \
$(INSTALL_MERC_BIN_DIR)/mslice$(EXT_FOR_EXE)
cp `vpath_find mdice$(EXT_FOR_EXE)` \
$(INSTALL_MERC_BIN_DIR)/mdice$(EXT_FOR_EXE)
cp `vpath_find mtc_union$(EXT_FOR_EXE)` \
$(INSTALL_MERC_BIN_DIR)/mtc_union$(EXT_FOR_EXE)
cp `vpath_find mcov$(EXT_FOR_EXE)` \
$(INSTALL_MERC_BIN_DIR)/mcov$(EXT_FOR_EXE)
cp `vpath_find mtc_diff$(EXT_FOR_EXE)` \
$(INSTALL_MERC_BIN_DIR)/mtc_diff$(EXT_FOR_EXE)
ifeq ($(findstring java,$(GRADE)),java)
cp `vpath_find mcov.jar` $(INSTALL_MERC_BIN_DIR)
cp `vpath_find mdice.jar` $(INSTALL_MERC_BIN_DIR)
cp `vpath_find mslice.jar` $(INSTALL_MERC_BIN_DIR)
cp `vpath_find mtc_diff.jar` $(INSTALL_MERC_BIN_DIR)
cp `vpath_find mtc_union.jar` $(INSTALL_MERC_BIN_DIR)
endif
#-----------------------------------------------------------------------------#