Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion boehm_gc/build_atomic_ops.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ P=`pwd`/libatomic_ops-install
cd libatomic_ops
# Mercury-specific: allow additional arguments.
./configure --prefix=$P "$@"
$MAKE CC="$CC" install
$MAKE CC="$CC" DESTDIR= install
2 changes: 1 addition & 1 deletion boehm_gc/build_atomic_ops.sh.cygwin
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Q=`mktemp -d`
ln -s "$P" $Q/dir
cd $Q/dir/libatomic_ops
./configure --prefix=$Q/dir/libatomic_ops-install
$MAKE CC="$CC" install
$MAKE CC="$CC" DESTDIR= install
cd /
rm $Q/dir
rmdir $Q
3 changes: 3 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1164,6 +1164,9 @@ AC_SUBST(LINK_OPT_SEP)
AC_SUBST(FIX_PATH_FOR_CC)
AC_SUBST(CYGPATH)

lispdir='${datarootdir}/emacs/site-lisp'
AC_SUBST(lispdir)

#-----------------------------------------------------------------------------#
# Check for `-lm': some systems, e.g. MacOS X (Darwin), don't have it.
# The result of this check may be overridden below.
Expand Down
3 changes: 3 additions & 0 deletions deep_profiler/DEEP_FLAGS.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
-I../library
-I../browser
-I../ssdb
-I../mdbcomp
--c-include-directory ../boehm_gc
--c-include-directory ../boehm_gc/include
--c-include-directory ../runtime
Expand All @@ -15,6 +16,8 @@
--c-include-directory ../browser/Mercury/mihs
--c-include-directory ../ssdb
--c-include-directory ../ssdb/Mercury/mihs
--c-include-directory ../mdbcomp
--c-include-directory ../mdbcomp/Mercury/mihs
--c-include-directory ../trace
--csharp-flag -keyfile:../mercury.snk
--no-java-classpath
Expand Down
39 changes: 5 additions & 34 deletions deep_profiler/Mmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,23 +54,7 @@ else
INSTALL=nothing
endif

VPATH = $(LIBRARY_DIR) $(SSDB_DIR)

#-----------------------------------------------------------------------------#

MDBCOMP_MODULES = \
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 \
trace_counts.m

MDBCOMP_ORIG_MODULES = $(patsubst %,$(MDBCOMP_DIR)/%,$(MDBCOMP_MODULES))
VPATH = $(LIBRARY_DIR) $(MDBCOMP_DIR) $(SSDB_DIR)

#-----------------------------------------------------------------------------#

Expand Down Expand Up @@ -107,9 +91,9 @@ endif
nothing:

.PHONY: depend
depend: $(MDBCOMP_MODULES) $(DEPEND)
depend: $(DEPEND)

$(DEPEND): DEEP_FLAGS $(MDBCOMP_MODULES) Mercury.modules
$(DEPEND): DEEP_FLAGS Mercury.modules

# This directory contains source files for which the module
# name doesn't match the file name, so smart recompilation
Expand All @@ -119,19 +103,7 @@ Mercury.modules: DEEP_FLAGS
$(MC) $(ALL_GRADEFLAGS) $(ALL_MCFLAGS) -f *.m

.PHONY: all
all: $(MDBCOMP_MODULES) $(ALL_DEEP_MODULES) $(TAGS_FILE_EXISTS)

# We need to start by turning write permission on for each copied file
# in case some exist, but we need to ignore errors in case some don't exist.
# The exit 0 is to prevent make itself from printing a message about the
# (ignored) failure of an action.
#
# We could modify the action here to copy only the changed files.

$(MDBCOMP_MODULES): $(MDBCOMP_ORIG_MODULES)
-@chmod a+w $(MDBCOMP_MODULES) > /dev/null 2>&1; exit 0
cp $(MDBCOMP_ORIG_MODULES) .
@chmod a-w $(MDBCOMP_MODULES)
all: $(ALL_DEEP_MODULES) $(TAGS_FILE_EXISTS)

#-----------------------------------------------------------------------------#

Expand Down Expand Up @@ -231,8 +203,7 @@ cs: $(mdprof_procrep.cs) $(cs_subdir)mdprof_procrep_init.c
#-----------------------------------------------------------------------------#

realclean_local:
rm -f .deep_tags tags DEEP_FLAGS DEEP_FLAGS.date \
$(MDBCOMP_MODULES) mdbcomp.*.err
rm -f .deep_tags tags DEEP_FLAGS DEEP_FLAGS.date

#-----------------------------------------------------------------------------#

Expand Down
43 changes: 27 additions & 16 deletions scripts/Mmake.vars.in
Original file line number Diff line number Diff line change
Expand Up @@ -691,26 +691,37 @@ else
DESTDIR_AND_SLASH=$(DESTDIR)/
endif

INSTALL_PREFIX = $(DESTDIR_AND_SLASH)@prefix@
# autoconf provided vars
prefix = @prefix@
exec_prefix = @exec_prefix@
libdir = @libdir@
datarootdir = @datarootdir@
mandir = @mandir@
infodir = @infodir@
lispdir = @lispdir@

# actual vars used for installation

INSTALL_PREFIX = $(DESTDIR_AND_SLASH)$(prefix)
INSTALL_BINDIR = $(INSTALL_PREFIX)/bin
INSTALL_LIBDIR = $(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_PDF_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_LIBDIR = $(DESTDIR_AND_SLASH)$(libdir)/mercury
INSTALL_INFO_DIR = $(infodir)
INSTALL_DVI_DIR = $(INSTALL_LIBDIR)/doc
INSTALL_TEXT_DIR = $(INSTALL_LIBDIR)/doc
INSTALL_PS_DIR = $(INSTALL_LIBDIR)/doc
INSTALL_PDF_DIR = $(INSTALL_LIBDIR)/doc
INSTALL_MAN_DIR = $(DESTDIR_AND_SLASH)$(mandir)
INSTALL_HTML_DIR = $(INSTALL_LIBDIR)/html
INSTALL_MDB_DOC_DIR = $(INSTALL_LIBDIR)/mdb
INSTALL_ELISP_DIR = $(DESTDIR_AND_SLASH)$(lispdir)
INSTALL_CGI_DIR = $(DESTDIR_AND_SLASH)@CGIDIR@

FINAL_INSTALL_PREFIX = @prefix@
FINAL_INSTALL_PREFIX = $(prefix)
FINAL_INSTALL_BINDIR = $(FINAL_INSTALL_PREFIX)/bin
FINAL_INSTALL_LIBDIR = $(FINAL_INSTALL_PREFIX)/lib/mercury
FINAL_INSTALL_INFO_DIR = $(FINAL_INSTALL_PREFIX)/info
FINAL_INSTALL_MAN_DIR = $(FINAL_INSTALL_PREFIX)/man
FINAL_INSTALL_ELISP_DIR = $(FINAL_INSTALL_PREFIX)/lib/mercury/elisp
FINAL_INSTALL_LIBDIR = $(libdir)/mercury
FINAL_INSTALL_INFO_DIR = $(infodir)
FINAL_INSTALL_MAN_DIR = $(mandir)
FINAL_INSTALL_ELISP_DIR = $(lispdir)
FINAL_INSTALL_CGI_DIR = @CGIDIR@

# You should not need to override anything below here
Expand Down
4 changes: 2 additions & 2 deletions scripts/mmc.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
# MERCURY_COMPILER, MERCURY_C_COMPILER, MERCURY_DEFAULT_GRADE,
# MERCURY_DEFAULT_OPT_LEVEL.

MERCURY_COMPILER=${MERCURY_COMPILER-'@PREFIX@/bin/mercury_compile'}
MERCURY_CONFIG_DIR=${MERCURY_CONFIG_DIR-${MERCURY_STDLIB_DIR-'@CONFIG_LIBDIR@'}}
MERCURY_COMPILER=${MERCURY_COMPILER-${DESTDIR}'@PREFIX@/bin/mercury_compile'}
MERCURY_CONFIG_DIR=${MERCURY_CONFIG_DIR-${DESTDIR}${MERCURY_STDLIB_DIR-'@CONFIG_LIBDIR@'}}
export MERCURY_COMPILER MERCURY_CONFIG_DIR

# Set the MACOSX_DEPLOYMENT_TARGET environment variable if needed.
Expand Down
44 changes: 7 additions & 37 deletions slice/Mmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,7 @@ INTS = $(patsubst %,%.ints,$(MERCURY_MAIN_MODULES))
INT3S = $(patsubst %,%.int3s,$(MERCURY_MAIN_MODULES))
CHECKS = $(patsubst %,%.check,$(MERCURY_MAIN_MODULES))

VPATH = $(LIBRARY_DIR) $(SSDB_DIR)

#-----------------------------------------------------------------------------#

MDBCOMP_MODULES = \
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 \
trace_counts.m

MDBCOMP_ORIG_MODULES = $(patsubst %,$(MDBCOMP_DIR)/%,$(MDBCOMP_MODULES))
VPATH = $(LIBRARY_DIR) $(MDBCOMP_DIR) $(SSDB_DIR)

#-----------------------------------------------------------------------------#

Expand All @@ -82,26 +66,12 @@ endif
#-----------------------------------------------------------------------------#

.PHONY: depend
depend: $(MDBCOMP_MODULES) $(DEPENDS)
depend: $(DEPENDS)

$(DEPENDS): SLICE_FLAGS $(MDBCOMP_MODULES)
$(DEPENDS): SLICE_FLAGS

.PHONY: all
all: $(MDBCOMP_MODULES) $(MERCURY_MAIN_MODULES) $(TAGS_FILE_EXISTS)

#-----------------------------------------------------------------------------#
#
# We need to start by turning write permission on for each copied file
# in case some exist, but we need to ignore errors in case some don't exist.
# The exit 0 is to prevent make itself from printing a message about the
# (ignored) failure of an action.
#
# We could modify the action here to copy only the changed files.

$(MDBCOMP_MODULES): $(MDBCOMP_ORIG_MODULES)
-@chmod a+w $(MDBCOMP_MODULES) > /dev/null 2>&1; exit 0
cp $(MDBCOMP_ORIG_MODULES) .
@chmod a-w $(MDBCOMP_MODULES)
all: $(MERCURY_MAIN_MODULES) $(TAGS_FILE_EXISTS)

#-----------------------------------------------------------------------------#

Expand Down Expand Up @@ -157,7 +127,8 @@ ints: $(INTS)
tags: .slice_tags

.slice_tags: $(MTAGS) $(mslice.ms) $(mdice.ms) $(mtc_union.ms) $(mcov.ms) \
$(mtc_diff.ms) $(wildcard $(LIBRARY_DIR)/*.m)
$(mtc_diff.ms) $(wildcard $(LIBRARY_DIR)/*.m) \
$(wildcard $(MDBCOMP_DIR)/*.m)
$(MTAGS) $(mslice.ms) $(mdice.ms) $(mtc_union.ms) $(mcov.ms) \
$(mtc_diff.ms) $(LIBRARY_DIR)/*.m
@touch .slice_tags
Expand Down Expand Up @@ -194,8 +165,7 @@ 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.*.err
rm -f tags SLICE_FLAGS SLICE_FLAGS.date

#-----------------------------------------------------------------------------#

Expand Down
3 changes: 3 additions & 0 deletions slice/SLICE_FLAGS.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
-I../library
-I../browser
-I../ssdb
-I../mdbcomp
--c-include-directory ../boehm_gc
--c-include-directory ../boehm_gc/include
--c-include-directory ../runtime
Expand All @@ -15,6 +16,8 @@
--c-include-directory ../browser/Mercury/mihs
--c-include-directory ../ssdb
--c-include-directory ../ssdb/Mercury/mihs
--c-include-directory ../mdbcomp
--c-include-directory ../mdbcomp/Mercury/mihs
--c-include-directory ../trace
--csharp-flag -keyfile:../mercury.snk
--no-java-classpath
Expand Down