for review: introduction of two new directories
Zoltan Somogyi
zs at cs.mu.OZ.AU
Thu Sep 24 14:16:02 AEST 1998
The introduction of two new directories, each containing a new library,
requires significant changes to the Mmakefiles in the various directories.
I think it would be a good idea for these changes to be reviewed by Fergus
and Tyson independently of the other changes in my next commit.
I don't know if these changes require any corresponding changes in the bindist
directory, since the structure of the *installed* directories doesn't change.
However, bindist/Mmakefile could stand a cleanup, particularly wrt the samples
and extras directories.
Zoltan.
cvs diff: Diffing .
Index: Makefile.DLLs
===================================================================
RCS file: /home/mercury1/repository/mercury/Makefile.DLLs,v
retrieving revision 1.2
diff -u -u -r1.2 Makefile.DLLs
--- Makefile.DLLs 1997/09/29 17:22:07 1.2
+++ Makefile.DLLs 1998/09/23 05:13:02
@@ -109,11 +109,13 @@
# Making relocatable DLLs doesn't seem to work.
# Note quite sure why. The --image-base values below
-# where chosen at random, they seem to work on my machine.
+# where chosen at random, the first two at least seem to work on my machine.
RELOCATABLE=no
-LDFLAGS-libgc += --image-base=0x2345000
-LDFLAGS-libmer += --image-base=0x1234000
-LDFLAGS-libmercury += --image-base=0x3456000
+LDFLAGS-libgc += --image-base=0x2345000
+LDFLAGS-libmer_rt += --image-base=0x1234000
+LDFLAGS-libmer_std += --image-base=0x3456000
+LDFLAGS-libmer_trace += --image-base=0x4567000
+LDFLAGS-libmer_browser += --image-base=0x5678000
ifeq "$(strip $(RELOCATABLE))" "yes"
Index: Mmake.common.in
===================================================================
RCS file: /home/mercury1/repository/mercury/Mmake.common.in,v
retrieving revision 1.28
diff -u -u -r1.28 Mmake.common.in
--- Mmake.common.in 1998/08/04 14:05:50 1.28
+++ Mmake.common.in 1998/09/24 04:41:23
@@ -59,6 +59,7 @@
INSTALL_PS_DIR = $(INSTALL_PREFIX)/lib/mercury/doc
INSTALL_MAN_DIR = $(INSTALL_PREFIX)/man
INSTALL_HTML_DIR = $(INSTALL_PREFIX)/lib/mercury/html
+INSTALL_DOC_DIR = $(INSTALL_PREFIX)/lib/mercury/doc
# Specify the Mercury compiler to use for bootstrapping
MC = @BOOTSTRAP_MC@
@@ -164,9 +165,23 @@
SCRIPTS_DIR = $(MERCURY_DIR)/scripts
RUNTIME_DIR = $(MERCURY_DIR)/runtime
LIBRARY_DIR = $(MERCURY_DIR)/library
+TRACE_DIR = $(MERCURY_DIR)/trace
+BROWSER_DIR = $(MERCURY_DIR)/browser
BOEHM_GC_DIR = $(MERCURY_DIR)/boehm_gc
COMPILER_DIR = $(MERCURY_DIR)/compiler
UTIL_DIR = $(MERCURY_DIR)/util
+
+# The names of the various libraries.
+# The archives and shared object objects have a "lib" prefix and a ".a" or
+# ".so" suffix around these names; the initialization files have just a
+# ".init" suffix.
+#
+# If you change these, you will also need to change script/ml.in
+# and tools/bootcheck.
+RT_LIB_NAME = mer_rt
+STD_LIB_NAME = mer_std
+TRACE_LIB_NAME = mer_trace
+BROWSER_LIB_NAME = mer_browser
# Options to pass to the Mercury compiler
MCFLAGS = --no-infer-all --halt-at-warn
Index: Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/Mmakefile,v
retrieving revision 1.24
diff -u -u -r1.24 Mmakefile
--- Mmakefile 1998/09/10 03:21:38 1.24
+++ Mmakefile 1998/09/23 09:12:29
@@ -13,7 +13,17 @@
#-----------------------------------------------------------------------------#
-SUBDIRS = scripts util boehm_gc runtime library compiler doc profiler
+SUBDIRS = \
+ scripts \
+ util \
+ boehm_gc \
+ runtime \
+ library \
+ trace \
+ browser \
+ compiler \
+ doc \
+ profiler
MMAKEFLAGS =
@@ -37,7 +47,7 @@
# `mmake depend' forces them to be remade to ensure that they are up-to-date.
.PHONY: dep
-dep: dep_library dep_compiler dep_profiler
+dep: dep_library dep_browser dep_compiler dep_profiler
.PHONY: dep_library
dep_library: library/$(deps_subdir)library.dep
@@ -45,6 +55,12 @@
library/$(deps_subdir)library.dep:
cd library && $(SUBDIR_MMAKE) depend
+.PHONY: dep_browser
+dep_browser: browser/$(deps_subdir)browser.dep
+
+browser/$(deps_subdir)browser.dep:
+ cd browser && $(SUBDIR_MMAKE) depend
+
.PHONY: dep_compiler
dep_compiler: compiler/$(deps_subdir)mercury_compile.dep
@@ -62,6 +78,7 @@
.PHONY: depend
depend:
cd library && $(SUBDIR_MMAKE) depend
+ cd browser && $(SUBDIR_MMAKE) depend
cd compiler && $(SUBDIR_MMAKE) depend
cd profiler && $(SUBDIR_MMAKE) depend
@@ -69,6 +86,10 @@
depend_library:
cd library && $(SUBDIR_MMAKE) depend
+.PHONY: depend_browser
+depend_browser:
+ cd browser && $(SUBDIR_MMAKE) depend
+
.PHONY: depend_compiler
depend_compiler:
cd compiler && $(SUBDIR_MMAKE) depend
@@ -82,14 +103,14 @@
.PHONY: all
all: README INSTALL $(SUBDIRS)
+.PHONY: util
+util: scripts
+ cd util && $(SUBDIR_MMAKE)
+
.PHONY: scripts
scripts:
cd scripts && $(SUBDIR_MMAKE)
-.PHONY: runtime
-runtime: scripts boehm_gc
- cd runtime && $(SUBDIR_MMAKE)
-
.PHONY: boehm_gc
boehm_gc: scripts
case "$$grade" in \
@@ -102,30 +123,38 @@
esac; \
cd boehm_gc && $(SUBDIR_MMAKE) PROF=$$prof
+.PHONY: runtime
+runtime: scripts boehm_gc
+ cd runtime && $(SUBDIR_MMAKE)
+
.PHONY: library
-library: dep_library scripts runtime boehm_gc
+library: dep_library util scripts boehm_gc runtime
cd library && $(SUBDIR_MMAKE)
+.PHONY: browser
+browser: dep_browser util scripts boehm_gc runtime library
+ cd browser && $(SUBDIR_MMAKE)
+
+.PHONY: runtime
+trace: scripts boehm_gc runtime library browser
+ cd trace && $(SUBDIR_MMAKE)
+
.PHONY: compiler
-compiler: dep_compiler scripts util runtime boehm_gc library
+compiler: dep_compiler util scripts boehm_gc runtime library browser trace
cd compiler && $(SUBDIR_MMAKE)
.PHONY: doc
doc: scripts
cd doc && $(SUBDIR_MMAKE)
-.PHONY: util
-util: scripts
- cd util && $(SUBDIR_MMAKE)
-
.PHONY: profiler
-profiler: dep_profiler scripts util runtime boehm_gc library
+profiler: dep_profiler util scripts boehm_gc runtime library
cd profiler && $(SUBDIR_MMAKE)
#-----------------------------------------------------------------------------#
.PHONY: tags
-tags: tags_compiler tags_profiler tags_library
+tags: tags_compiler tags_library tags_browser tags_profiler
.PHONY: tags_compiler
tags_compiler:
@@ -135,6 +164,10 @@
tags_library:
cd library && $(SUBDIR_MMAKE) tags
+.PHONY: tags_browser
+tags_browser:
+ cd browser && $(SUBDIR_MMAKE) tags
+
.PHONY: tags_profiler
tags_profiler:
cd profiler && $(SUBDIR_MMAKE) tags
@@ -169,9 +202,12 @@
tar: README INSTALL
touch Mmake.params
cd util && mmake
- cd runtime && $(SUBDIR_MMAKE) cs runtime.init
+ cd runtime && $(SUBDIR_MMAKE) cs $(RT_LIB_NAME).init
cd library && $(SUBDIR_MMAKE) depend
- cd library && $(SUBDIR_MMAKE) all-ints cs libmercury.init tags
+ cd library && $(SUBDIR_MMAKE) all-ints cs $(STD_LIB_NAME).init tags
+ cd browser && $(SUBDIR_MMAKE) depend
+ cd browser && $(SUBDIR_MMAKE) all-ints cs $(BROWSER_LIB_NAME).init tags
+ cd trace && $(SUBDIR_MMAKE) cs $(TRACE_LIB_NAME).init
cd compiler && $(SUBDIR_MMAKE) depend
cd compiler && $(SUBDIR_MMAKE) cs tags
cd profiler && $(SUBDIR_MMAKE) depend
@@ -228,7 +264,8 @@
.PHONY: install_main
install_main: all $(PREINSTALL_HACK) \
install_scripts install_util install_runtime install_boehm_gc \
- install_library install_compiler install_profiler install_doc \
+ install_library install_browser install_trace \
+ install_compiler install_profiler install_doc \
$(POSTINSTALL_HACK)
.PHONY: install_scripts
@@ -243,6 +280,10 @@
install_runtime: runtime
cd runtime && $(SUBDIR_MMAKE) install
+.PHONY: install_trace
+install_trace: trace
+ cd trace && $(SUBDIR_MMAKE) install
+
.PHONY: install_boehm_gc
install_boehm_gc: boehm_gc
case "$$grade" in \
@@ -259,6 +300,10 @@
install_library: dep_library library
cd library && $(SUBDIR_MMAKE) install
+.PHONY: install_browser
+install_browser: dep_browser browser
+ cd browser && $(SUBDIR_MMAKE) install
+
.PHONY: install_compiler
install_compiler: dep_compiler compiler
cd compiler && $(SUBDIR_MMAKE) install
@@ -272,13 +317,17 @@
cd profiler && $(SUBDIR_MMAKE) install
.PHONY: install_grades
-install_grades: scripts dep_library
+install_grades: scripts dep_library dep_browser
cd boehm_gc && rm -rf tmp_dir && mkdir tmp_dir && \
{ mv -f *.o *.pic_o *.a *.so tmp_dir || true; }
cd runtime && rm -rf tmp_dir && mkdir tmp_dir && \
{ mv -f *.o *.pic_o *.a *.so tmp_dir || true; }
cd library && rm -rf tmp_dir && mkdir tmp_dir && \
{ mv -f *.c *.o *.pic_o *.a *.so tmp_dir || true; }
+ cd browser && rm -rf tmp_dir && mkdir tmp_dir && \
+ { mv -f *.c *.o *.pic_o *.a *.so tmp_dir || true; }
+ cd trace && rm -rf tmp_dir && mkdir tmp_dir && \
+ { mv -f *.o *.pic_o *.a *.so tmp_dir || true; }
for grade in x $(LIBGRADES); do \
if [ "$$grade" != "x" ]; then \
case "$$grade" in \
@@ -295,9 +344,15 @@
$(SUBDIR_MMAKE) GRADE=$$grade install_lib ) && \
( cd library && \
$(SUBDIR_MMAKE) GRADE=$$grade install_library ) && \
+ ( cd browser && \
+ $(SUBDIR_MMAKE) GRADE=$$grade install_library ) && \
+ ( cd trace && \
+ $(SUBDIR_MMAKE) GRADE=$$grade install_lib ) && \
( cd boehm_gc && rm -f *.o *.pic_o *.a *.so ) && \
( cd runtime && rm -f *.o *.pic_o *.a *.so ) && \
( cd library && rm -f *.c *.o *.pic_o *.a *.so ) && \
+ ( cd browser && rm -f *.c *.o *.pic_o *.a *.so ) && \
+ ( cd trace && rm -f *.o *.pic_o *.a *.so ) && \
true \
|| exit 1; \
fi; \
@@ -305,6 +360,8 @@
cd boehm_gc && { mv tmp_dir/* . ; rmdir tmp_dir; true; }
cd runtime && { mv tmp_dir/* . ; rmdir tmp_dir; true; }
cd library && { mv tmp_dir/* . ; rmdir tmp_dir; true; }
+ cd browser && { mv tmp_dir/* . ; rmdir tmp_dir; true; }
+ cd trace && { mv tmp_dir/* . ; rmdir tmp_dir; true; }
.PHONY: install_split_library
install_split_library: scripts dep_library
@@ -333,6 +390,10 @@
touch library/*.optdate
chmod +w library/*.dep
touch library/*.dep
+ touch browser/*.date*
+ touch browser/*.optdate
+ chmod +w browser/*.dep
+ touch browser/*.dep
touch compiler/*.date*
chmod +w compiler/*.dep
touch compiler/*.dep
@@ -344,6 +405,8 @@
touch boehm_gc/*.c
touch runtime/*.c
touch library/*.c
+ touch browser/*.c
+ touch trace/*.c
touch compiler/*.c
touch profiler/*.c
touch doc/*.info doc/*.dvi doc/*.html config.status
@@ -387,7 +450,7 @@
.PHONY: clean_subdirs
clean_subdirs:
- rm -rf runtime/tmp_dir library/tmp_dir
+ rm -rf runtime/tmp_dir library/tmp_dir browser/tmp_dir trace/tmp_dir
for dir in $(SUBDIRS); do \
if [ "$$dir" = scripts ]; then continue; fi; \
(cd $$dir; $(SUBDIR_MMAKE) clean) \
cvs diff: Diffing bindist
cvs diff: Diffing boehm_gc
cvs diff: Diffing boehm_gc/Mac_files
cvs diff: Diffing boehm_gc/cord
cvs diff: Diffing boehm_gc/cord/private
cvs diff: Diffing boehm_gc/include
cvs diff: Diffing boehm_gc/include/private
cvs diff: Diffing browser
Index: browser/Mmakefile
===================================================================
RCS file: Mmakefile
diff -N Mmakefile
--- /dev/null Wed May 28 10:49:58 1997
+++ Mmakefile Wed Sep 23 18:00:51 1998
@@ -0,0 +1,181 @@
+#-----------------------------------------------------------------------------#
+# Copyright (C) 1998 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.
+#-----------------------------------------------------------------------------#
+
+# browser/Mmakefile - this is the Mmakefile for building the Mercury
+# browser library, which also includes other functionality needed
+# by Mercury debuggers.
+
+# Since the code in this directory is intended to be invoked only from
+# the trace library, which turns off tracing in the Mercury code it calls,
+# compiling the modules in this directory with tracing on only makes
+# makes the generated code much bigger. However, since all Mercury code
+# in an executable must be of the same grade, we need to be able to
+# compile the modules in this directory in debug grades as well.
+
+MERCURY_DIR=..
+include $(MERCURY_DIR)/Mmake.common
+
+MAIN_TARGET=library
+
+VPATH=$(LIBRARY_DIR)
+
+#-----------------------------------------------------------------------------#
+
+# If we're going to generate both `.o' files and `.pic_o' files, then
+# don't remove the intermediate `.c' files.
+RM_C = $(LIBRARY_RM_C)
+
+#-----------------------------------------------------------------------------#
+
+# Specify which compilers to use to compile the library.
+# Don't change these without good reason - if you want to
+# do a temporary change, change ../Mmake.params.
+
+MCD = MERCURY_INT_DIR=$(LIBRARY_DIR) \
+ MERCURY_ALL_C_INCL_DIRS="-I$(TRACE_DIR) -I$(RUNTIME_DIR)" \
+ $(MC) --generate-dependencies
+MCI = MERCURY_INT_DIR=$(LIBRARY_DIR) \
+ MERCURY_ALL_C_INCL_DIRS="-I$(TRACE_DIR) -I$(RUNTIME_DIR)" \
+ $(MC) --make-interface
+MCOI = MERCURY_INT_DIR=$(LIBRARY_DIR) \
+ MERCURY_ALL_C_INCL_DIRS="-I$(TRACE_DIR) -I$(RUNTIME_DIR)" \
+ $(MC) --make-opt-int
+MCTOI = MERCURY_INT_DIR=$(LIBRARY_DIR) \
+ MERCURY_ALL_C_INCL_DIRS="-I$(TRACE_DIR) -I$(RUNTIME_DIR)" \
+ $(MC) --make-trans-opt
+MCG = MERCURY_INT_DIR=$(LIBRARY_DIR) \
+ MERCURY_ALL_C_INCL_DIRS="-I$(TRACE_DIR) -I$(RUNTIME_DIR)" \
+ $(MC) --compile-to-c
+MCS = MERCURY_INT_DIR=$(LIBRARY_DIR) \
+ MERCURY_ALL_C_INCL_DIRS="-I$(TRACE_DIR) -I$(RUNTIME_DIR)" \
+ $(MC) --split-c-files -c \
+ --cflags "-I$(TRACE_DIR) -I$(RUNTIME_DIR)" \
+ --cflags "-I$(BOEHM_GC_DIR) $(EXTRA_CFLAGS)"
+MGNUC = MERCURY_ALL_C_INCL_DIRS="-I$(TRACE_DIR) -I$(RUNTIME_DIR)" \
+ $(SCRIPTS_DIR)/mgnuc
+MGNUCFLAGS = -I$(TRACE_DIR) -I$(RUNTIME_DIR) -I$(BOEHM_GC_DIR) \
+ $(EXTRA_MGNUCFLAGS) $(DLL_CFLAGS) $(EXTRA_CFLAGS)
+LDFLAGS = -L$(LIBRARY_DIR) -L$(RUNTIME_DIR) -L$(BOEHM_GC_DIR)
+LDLIBS = -l$(STD_LIB_NAME) -l$(RT_LIB_NAME) \
+ ` case "$(GRADE)" in \
+ *.gc*.prof*) echo "-lgc_prof" ;; \
+ *.gc*) echo "-lgc" ;; \
+ esac \
+ `
+
+MTAGS = $(SCRIPTS_DIR)/mtags
+
+#-----------------------------------------------------------------------------#
+
+# Stuff for Windows DLLS using gnu-win32
+
+ifeq ($(USE_DLLS),yes)
+
+DLL_CFLAGS = -Dlib$(BROWSER_LIB_NAME)_DEFINE_DLL
+
+include $(MERCURY_DIR)/Makefile.DLLs
+
+else
+
+DLL_CFLAGS =
+DLL_DEF_LIB =
+
+endif
+
+#-----------------------------------------------------------------------------#
+
+# targets
+
+.PHONY: all
+all : library
+
+.PHONY: depend
+depend : browser.depend
+
+.PHONY: check
+check : browser.check
+
+.PHONY: all-ints
+all-ints: ints int3s
+
+.PHONY: ints
+ints : browser.ints
+
+.PHONY: int3s
+int3s : browser.int3s
+
+#-----------------------------------------------------------------------------#
+
+tags : $(MTAGS) $(browser.ms)
+ $(MTAGS) $(browser.ms)
+
+browser.stats : $(COMPILER_DIR)/source_stats.awk $(browser.ms)
+ awk -f $(COMPILER_DIR)/source_stats.awk `vpath_find $(browser.ms)` > $@
+
+#-----------------------------------------------------------------------------#
+
+.PHONY: dates
+dates :
+ touch $(browser.dates)
+
+#-----------------------------------------------------------------------------#
+
+.PHONY: os cs
+os: $(browser.os)
+cs: $(browser.cs)
+
+#-----------------------------------------------------------------------------#
+
+.PHONY: library
+library: lib$(BROWSER_LIB_NAME).a lib$(BROWSER_LIB_NAME).$(EXT_FOR_SHARED_LIB)
+library: $(BROWSER_LIB_NAME).init
+
+lib$(BROWSER_LIB_NAME)$(DLL_DEF_LIB).a : $(browser.os)
+ rm -f lib$(BROWSER_LIB_NAME)$(DLL_DEF_LIB).a
+ ar cr lib$(BROWSER_LIB_NAME)$(DLL_DEF_LIB).a $(browser.os)
+ $(RANLIB) lib$(BROWSER_LIB_NAME)$(DLL_DEF_LIB).a
+
+RPATH_1=$(SHLIB_RPATH_OPT)$(FINAL_INSTALL_MERC_LIB_DIR)
+RPATH_2=$(SHLIB_RPATH_SEP)$(FINAL_INSTALL_MERC_GC_LIB_DIR)
+
+lib$(BROWSER_LIB_NAME).so : $(browser.pic_os)
+ $(LINK_SHARED_OBJ) -o lib$(BROWSER_LIB_NAME).so $(browser.pic_os)\
+ $(RPATH_1)$(RPATH_2) \
+ $(LDFLAGS) $(LDLIBS) \
+ $(SHARED_LIBS)
+
+$(BROWSER_LIB_NAME).init: $(deps_subdir)browser.dep
+ for file in $(browser.ms); do \
+ grep '^INIT ' $$file; \
+ echo "INIT mercury__`basename $$file .m`__init"; \
+ done > $(BROWSER_LIB_NAME).init
+
+#-----------------------------------------------------------------------------#
+
+realclean:
+ rm -f lib$(BROWSER_LIB_NAME).a lib$(BROWSER_LIB_NAME).so \
+ $(BROWSER_LIB_NAME).init
+ rm -f tags
+
+#-----------------------------------------------------------------------------#
+
+# Installation targets
+
+.PHONY: install
+install: install_init install_library
+
+.PHONY: install_init
+install_init: $(BROWSER_LIB_NAME).init
+ [ -d $(INSTALL_MODULE_DIR) ] || mkdir -p $(INSTALL_MODULE_DIR)
+ cp `vpath_find $(BROWSER_LIB_NAME).init` $(INSTALL_MODULE_DIR)
+
+.PHONY: install_library
+install_library: lib$(BROWSER_LIB_NAME).a \
+ lib$(BROWSER_LIB_NAME).$(EXT_FOR_SHARED_LIB)
+ [ -d $(INSTALL_MERC_LIB_DIR) ] || mkdir -p $(INSTALL_MERC_LIB_DIR)
+ cp `vpath_find lib$(BROWSER_LIB_NAME).a \
+ lib$(BROWSER_LIB_NAME).$(EXT_FOR_SHARED_LIB)` \
+ $(INSTALL_MERC_LIB_DIR)
Index: browser/browser.m
===================================================================
RCS file: browser.m
diff -N browser.m
--- /dev/null Wed May 28 10:49:58 1997
+++ browser.m Wed Sep 23 15:33:51 1998
@@ -0,0 +1,22 @@
+%---------------------------------------------------------------------------%
+% Copyright (C) 1998 The University of Melbourne.
+% This file may only be copied under the terms of the GNU Library General
+% Public License - see the file COPYING.LIB in the Mercury distribution.
+%---------------------------------------------------------------------------%
+%
+% This module imports all the modules in the Mercury browser library.
+%
+% It is used as a way for the Makefiles to know which library interface
+% files, objects, etc., need to be installed.
+%
+%---------------------------------------------------------------------------%
+
+:- module browser.
+
+:- interface.
+
+:- implementation.
+
+:- import_module help.
+
+%---------------------------------------------------------------------------%
Index: browser/help.m
===================================================================
RCS file: help.m
diff -N help.m
--- /dev/null Wed May 28 10:49:58 1997
+++ help.m Wed Sep 23 18:29:03 1998
@@ -0,0 +1,281 @@
<omitted>
cvs diff: Diffing bytecode
cvs diff: Diffing bytecode/test
cvs diff: Diffing compiler
Index: compiler/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/Mmakefile,v
retrieving revision 1.11
diff -u -u -r1.11 Mmakefile
--- Mmakefile 1998/03/30 13:03:05 1.11
+++ Mmakefile 1998/09/23 06:49:35
@@ -26,23 +26,26 @@
--make-optimization-interface
MCTOI = MERCURY_INT_DIR=$(LIBRARY_DIR) $(MC) \
--make-transitive-optimization-interface
-MCG = MERCURY_C_INCL_DIR=$(RUNTIME_DIR) \
+MCG = MERCURY_ALL_C_INCL_DIRS="-I$(TRACE_DIR) -I$(RUNTIME_DIR)" \
MERCURY_INT_DIR=$(LIBRARY_DIR) $(MC) --compile-to-c
-MCS = MERCURY_C_INCL_DIR=$(RUNTIME_DIR) \
+MCS = MERCURY_ALL_C_INCL_DIRS="-I$(TRACE_DIR) -I$(RUNTIME_DIR)" \
MERCURY_INT_DIR=$(LIBRARY_DIR) \
$(MC) --cflags -I$(BOEHM_GC_DIR) --split-c-files -c
-MGNUC = MERCURY_C_INCL_DIR=$(RUNTIME_DIR) $(SCRIPTS_DIR)/mgnuc
+MGNUC = MERCURY_ALL_C_INCL_DIRS="-I$(TRACE_DIR) -I$(RUNTIME_DIR)" \
+ $(SCRIPTS_DIR)/mgnuc
MGNUCFLAGS = $(EXTRA_MGNUCFLAGS) -I$(BOEHM_GC_DIR) $(EXTRA_CFLAGS)
-C2INIT = \
-MERCURY_MOD_LIB_MODS="$(RUNTIME_DIR)/runtime.init $(LIBRARY_DIR)/libmercury.init" \
+C2INIT = MERCURY_MOD_LIB_MODS="$(TRACE_DIR)/$(TRACE_LIB_NAME).init $(LIBRARY_DIR)/$(STD_LIB_NAME).init $(BROWSER_DIR)/$(BROWSER_LIB_NAME).init $(RUNTIME_DIR)/$(RT_LIB_NAME).init" \
MERCURY_MKINIT=$(UTIL_DIR)/mkinit $(SCRIPTS_DIR)/c2init
ML = MERCURY_C_LIB_DIR=. $(SCRIPTS_DIR)/ml
MLFLAGS = --mercury-libs none $(EXTRA_MLFLAGS)
-MLLIBS = $(EXTRA_MLLIBS) $(LIBRARY_DIR)/libmercury.a \
- $(RUNTIME_DIR)/libmer.a ` \
+MLLIBS = $(EXTRA_MLLIBS) \
+ $(TRACE_DIR)/lib$(TRACE_LIB_NAME).a \
+ $(BROWSER_DIR)/lib$(BROWSER_LIB_NAME).a \
+ $(LIBRARY_DIR)/lib$(STD_LIB_NAME).a \
+ $(RUNTIME_DIR)/lib$(RT_LIB_NAME).a ` \
case $(GRADE) in \
- *.gc*.prof*) echo $(BOEHM_GC_DIR)/libgc_prof.a ;; \
- *.gc*) echo $(BOEHM_GC_DIR)/libgc.a ;; \
+ *.gc*.prof*) echo $(BOEHM_GC_DIR)/libgc_prof.a ;; \
+ *.gc*) echo $(BOEHM_GC_DIR)/libgc.a ;; \
esac \
` -lm
MSC = MERCURY_SICSTUS_COMPILER=$(LIBRARY_DIR)/sicstus_compile \
@@ -88,7 +91,10 @@
# Add some additional dependencies, so that Mmake knows to remake the
# compiler if one of the libraries changes.
-mercury_compile: $(RUNTIME_DIR)/libmer.a $(LIBRARY_DIR)/libmercury.a
+mercury_compile: $(RUNTIME_DIR)/lib$(RT_LIB_NAME).a
+mercury_compile: $(LIBRARY_DIR)/lib$(STD_LIB_NAME).a
+mercury_compile: $(BROWSER_DIR)/lib$(BROWSER_LIB_NAME).a
+mercury_compile: $(TRACE_DIR)/lib$(TRACE_LIB_NAME).a
# Should also depend on $(BOEHM_GC_DIR)/libgc(_prof).a, but only
# if in .gc(.prof) grade; GNU make does not support dynamic dependencies,
# so just leave it out.
cvs diff: Diffing compiler/notes
cvs diff: Diffing doc
Index: doc/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/doc/Mmakefile,v
retrieving revision 1.11
diff -u -u -r1.11 Mmakefile
--- Mmakefile 1998/09/01 05:17:38 1.11
+++ Mmakefile 1998/09/16 04:48:02
@@ -47,7 +47,7 @@
#-----------------------------------------------------------------------------#
.PHONY: all
-all: info dvi html manpages # ps text
+all: info dvi html manpages mdb_doc # ps text
#-----------------------------------------------------------------------------#
@@ -93,6 +93,11 @@
#-----------------------------------------------------------------------------#
+mdb_doc: generate_mdb_doc mercury_user_guide.info mdb_categories
+ ./generate_mdb_doc
+
+#-----------------------------------------------------------------------------#
+
# The following rules automatically build the library documentation
# by extracting the module interfaces from the library source code.
# Note that the debugger_interface.m module is just an implementation
@@ -160,7 +165,7 @@
#-----------------------------------------------------------------------------#
.PHONY: install
-install: install_info install_html install_dvi install_manpages
+install: install_info install_html install_dvi install_manpages install_doc
# install_text install_ps
.PHONY: install_info
@@ -193,6 +198,11 @@
-[ -d $(INSTALL_MAN_DIR)/man1 ] || \
mkdir -p $(INSTALL_MAN_DIR)/man1
cp *.1 $(INSTALL_MAN_DIR)/man1
+
+.PHONY: install_doc
+install_doc: mdbrc mdb_doc
+ -[ -d $(INSTALL_DOC_DIR) ] || mkdir -p $(INSTALL_DOC_DIR)
+ cp mdbrc mdb_doc $(INSTALL_DOC_DIR)
# The uninstall rule here only removes the info files; the others
# are removed by the top-level uninstall rule.
cvs diff: Diffing extras
cvs diff: Diffing extras/cgi
cvs diff: Diffing extras/complex_numbers
cvs diff: Diffing extras/complex_numbers/samples
cvs diff: Diffing extras/complex_numbers/tests
cvs diff: Diffing extras/exceptions
cvs diff: Diffing extras/graphics
cvs diff: Diffing extras/graphics/Togl-1.2
cvs diff: Diffing extras/graphics/mercury_opengl
cvs diff: Diffing extras/graphics/mercury_tcltk
cvs diff: Diffing extras/graphics/samples
cvs diff: Diffing extras/graphics/samples/calc
cvs diff: Diffing extras/graphics/samples/maze
cvs diff: Diffing extras/graphics/samples/pent
cvs diff: Diffing extras/odbc
cvs diff: Diffing extras/references
cvs diff: Diffing extras/references/samples
cvs diff: Diffing extras/references/tests
cvs diff: Diffing extras/trailed_update
cvs diff: Diffing extras/trailed_update/samples
cvs diff: Diffing extras/trailed_update/tests
cvs diff: Diffing library
Index: library/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/library/Mmakefile,v
retrieving revision 1.33
diff -u -u -r1.33 Mmakefile
--- Mmakefile 1998/06/30 06:32:17 1.33
+++ Mmakefile 1998/09/23 06:23:13
@@ -63,37 +63,39 @@
endif
MCD = MERCURY_INT_DIR=. \
- MERCURY_C_INCL_DIR=$(RUNTIME_DIR) $(MC) \
- --generate-dependencies $(INTERMODULE_OPTS)
+ MERCURY_ALL_C_INCL_DIRS="-I$(TRACE_DIR) -I$(RUNTIME_DIR)" \
+ $(MC) --generate-dependencies $(INTERMODULE_OPTS)
MCI = MERCURY_INT_DIR=. \
- MERCURY_C_INCL_DIR=$(RUNTIME_DIR) $(MC) \
- --make-interface $(INTERMODULE_OPTS) \
+ MERCURY_ALL_C_INCL_DIRS="-I$(TRACE_DIR) -I$(RUNTIME_DIR)" \
+ $(MC) --make-interface $(INTERMODULE_OPTS) \
$(ENABLE_TERM_OPTS)
MCOI = MERCURY_INT_DIR=. \
- MERCURY_C_INCL_DIR=$(RUNTIME_DIR) $(MC) \
- --make-opt-int $(INTERMODULE_OPTS) \
+ MERCURY_ALL_C_INCL_DIRS="-I$(TRACE_DIR) -I$(RUNTIME_DIR)" \
+ $(MC) --make-opt-int $(INTERMODULE_OPTS) \
$(ENABLE_TERM_OPTS)
MCTOI = MERCURY_INT_DIR=. \
- MERCURY_C_INCL_DIR=$(RUNTIME_DIR) $(MC) \
- --make-trans-opt $(INTERMODULE_OPTS) \
+ MERCURY_ALL_C_INCL_DIRS="-I$(TRACE_DIR) -I$(RUNTIME_DIR)" \
+ $(MC) --make-trans-opt $(INTERMODULE_OPTS) \
$(ENABLE_TERM_OPTS)
MCG = MERCURY_INT_DIR=. \
- MERCURY_C_INCL_DIR=$(RUNTIME_DIR) $(MC) \
- --compile-to-c $(INTERMODULE_OPTS) \
+ MERCURY_ALL_C_INCL_DIRS="-I$(TRACE_DIR) -I$(RUNTIME_DIR)" \
+ $(MC) --compile-to-c $(INTERMODULE_OPTS) \
$(CHECK_TERM_OPTS)
MCS = MERCURY_INT_DIR=. \
- MERCURY_C_INCL_DIR=$(RUNTIME_DIR) $(MC) \
- --split-c-files -c \
- --cflags "-I$(RUNTIME_DIR) -I$(BOEHM_GC_DIR) $(EXTRA_CFLAGS)" \
- $(INTERMODULE_OPTS) $(CHECK_TERM_OPTS)
-MGNUC = MERCURY_C_INCL_DIR=$(RUNTIME_DIR) $(SCRIPTS_DIR)/mgnuc
-MGNUCFLAGS = $(EXTRA_MGNUCFLAGS) -I$(RUNTIME_DIR) -I$(BOEHM_GC_DIR) \
- $(DLL_CFLAGS) $(EXTRA_CFLAGS)
+ MERCURY_ALL_C_INCL_DIRS="-I$(TRACE_DIR) -I$(RUNTIME_DIR)" \
+ $(MC) --split-c-files -c \
+ --cflags "-I$(TRACE_DIR) -I$(RUNTIME_DIR)" \
+ --cflags "-I$(BOEHM_GC_DIR) $(EXTRA_CFLAGS)" \
+ $(INTERMODULE_OPTS) $(CHECK_TERM_OPTS)
+MGNUC = MERCURY_ALL_C_INCL_DIRS="-I$(TRACE_DIR) -I$(RUNTIME_DIR)" \
+ $(SCRIPTS_DIR)/mgnuc
+MGNUCFLAGS = -I$(TRACE_DIR) -I$(RUNTIME_DIR) -I$(BOEHM_GC_DIR) \
+ $(EXTRA_MGNUCFLAGS) $(DLL_CFLAGS) $(EXTRA_CFLAGS)
LDFLAGS = -L$(BOEHM_GC_DIR) -L$(RUNTIME_DIR)
-LDLIBS = -lmer \
+LDLIBS = -l$(RT_LIB_NAME) \
` case "$(GRADE)" in \
*.gc*.prof*) echo "-lgc_prof" ;; \
- *.gc*) echo "-lgc" ;; \
+ *.gc*) echo "-lgc" ;; \
esac \
`
@@ -105,7 +107,7 @@
ifeq ($(USE_DLLS),yes)
-DLL_CFLAGS = -Dlibmercury_DEFINE_DLL
+DLL_CFLAGS = -Dlib$(STD_LIB_NAME)_DEFINE_DLL
include $(MERCURY_DIR)/Makefile.DLLs
@@ -141,7 +143,7 @@
all : mercury nuprolog sicstus
.PHONY: mercury
-mercury : all-ints libmercury
+mercury : all-ints lib_std
.PHONY: nuprolog
nuprolog : all-ints library.nu library.nu.debug \
@@ -213,31 +215,32 @@
#-----------------------------------------------------------------------------#
-.PHONY: libmercury
+.PHONY: lib_std
# the following dependency is just there to improve compilation speed;
# making tree234.o first improves effective parallelism with parallel makes.
-libmercury : $(os_subdir)tree234.o
-libmercury : libmercury.a libmercury.$(EXT_FOR_SHARED_LIB) libmercury.init
+lib_std: $(os_subdir)tree234.o
+lib_std: lib$(STD_LIB_NAME).a lib$(STD_LIB_NAME).$(EXT_FOR_SHARED_LIB)
+lib_std: $(STD_LIB_NAME).init
+
+lib$(STD_LIB_NAME)$(DLL_DEF_LIB).a : $(library.os)
+ rm -f lib$(STD_LIB_NAME)$(DLL_DEF_LIB).a
+ ar cr lib$(STD_LIB_NAME)$(DLL_DEF_LIB).a $(library.os)
+ $(RANLIB) lib$(STD_LIB_NAME)$(DLL_DEF_LIB).a
-libmercury$(DLL_DEF_LIB).a : $(library.os)
- rm -f libmercury$(DLL_DEF_LIB).a
- ar cr libmercury$(DLL_DEF_LIB).a $(library.os)
- $(RANLIB) libmercury$(DLL_DEF_LIB).a
-
RPATH_1=$(SHLIB_RPATH_OPT)$(FINAL_INSTALL_MERC_LIB_DIR)
RPATH_2=$(SHLIB_RPATH_SEP)$(FINAL_INSTALL_MERC_GC_LIB_DIR)
-libmercury.so : $(library.pic_os)
- $(LINK_SHARED_OBJ) -o libmercury.so $(library.pic_os) \
+lib$(STD_LIB_NAME).so : $(library.pic_os)
+ $(LINK_SHARED_OBJ) -o lib$(STD_LIB_NAME).so $(library.pic_os) \
$(RPATH_1)$(RPATH_2) \
$(LDFLAGS) $(LDLIBS) \
$(SHARED_LIBS)
-libmercury.init: $(deps_subdir)library.dep
+$(STD_LIB_NAME).init: $(deps_subdir)library.dep
for file in $(library.ms); do \
grep '^INIT ' $$file; \
echo "INIT mercury__`basename $$file .m`__init"; \
- done > libmercury.init
+ done > $(STD_LIB_NAME).init
#-----------------------------------------------------------------------------#
@@ -302,7 +305,7 @@
rm -f $(nos_subdir)*.no $(qls_subdir)*.ql
realclean:
- rm -f libmercury.a libmercury.so libmercury.init
+ rm -f lib$(STD_LIB_NAME).a lib$(STD_LIB_NAME).so $(STD_LIB_NAME).init
rm -f sicstus_saved_state sicstus_compile sp_builtin.pl
rm -f tags
@@ -351,26 +354,30 @@
done
.PHONY: install_init
-install_init: libmercury.init
+install_init: $(STD_LIB_NAME).init
[ -d $(INSTALL_MODULE_DIR) ] || mkdir -p $(INSTALL_MODULE_DIR)
- cp `vpath_find libmercury.init` $(INSTALL_MODULE_DIR)
- # "libmercury.init" used to be called "library.init".
- # If there is still a version with the old name lying around,
- # then delete it; otherwise the initialization would get done twice.
- rm -f $(INSTALL_MODULE_DIR)/library.init
+ cp `vpath_find $(STD_LIB_NAME).init` $(INSTALL_MODULE_DIR)
+ # "$(STD_LIB_NAME).init" used to be called "library.init" or
+ # "libmercury.init". If there is still a version with an old name
+ # lying around, then delete it; otherwise the initialization
+ # would get done twice.
+ rm -f $(INSTALL_MODULE_DIR)/library.init \
+ $(INSTALL_MODULE_DIR)/libmercury.init
.PHONY: install_library
-install_library: libmercury.a libmercury.$(EXT_FOR_SHARED_LIB)
+install_library: lib$(STD_LIB_NAME).a lib$(STD_LIB_NAME).$(EXT_FOR_SHARED_LIB)
[ -d $(INSTALL_MERC_LIB_DIR) ] || mkdir -p $(INSTALL_MERC_LIB_DIR)
- cp `vpath_find libmercury.a libmercury.$(EXT_FOR_SHARED_LIB)` \
+ cp `vpath_find lib$(STD_LIB_NAME).a \
+ lib$(STD_LIB_NAME).$(EXT_FOR_SHARED_LIB)` \
$(INSTALL_MERC_LIB_DIR)
-# library.split.a is a version of libmercury.a that has been compiled
+# library.split.a is a version of lib$(STD_LIB_NAME).a that has been compiled
# with `--split-c-files'.
.PHONY: install_split_library
install_split_library: library.split.a
[ -d $(INSTALL_MERC_LIB_DIR) ] || mkdir -p $(INSTALL_MERC_LIB_DIR)
- cp `vpath_find library.split.a` $(INSTALL_MERC_LIB_DIR)/libmercury.a
+ cp `vpath_find library.split.a` \
+ $(INSTALL_MERC_LIB_DIR)/lib$(STD_LIB_NAME).a
.PHONY: install_nuprolog
install_nuprolog: install_library_nu install_interpreter_nu
cvs diff: Diffing lp_solve
cvs diff: Diffing lp_solve/lp_examples
cvs diff: Diffing profiler
Index: profiler/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/profiler/Mmakefile,v
retrieving revision 1.7
diff -u -u -r1.7 Mmakefile
--- Mmakefile 1998/03/20 02:58:20 1.7
+++ Mmakefile 1998/09/23 07:12:53
@@ -28,15 +28,15 @@
MGNUC = MERCURY_C_INCL_DIR=$(RUNTIME_DIR) $(SCRIPTS_DIR)/mgnuc
MGNUCFLAGS = $(EXTRA_MGNUCFLAGS) -I$(BOEHM_GC_DIR) $(EXTRA_CFLAGS)
C2INIT = \
-MERCURY_MOD_LIB_MODS="$(RUNTIME_DIR)/runtime.init $(LIBRARY_DIR)/libmercury.init" \
+MERCURY_MOD_LIB_MODS="$(RUNTIME_DIR)/$(RT_LIB_NAME).init $(LIBRARY_DIR)/$(STD_LIB_NAME).init" \
MERCURY_MKINIT=$(UTIL_DIR)/mkinit $(SCRIPTS_DIR)/c2init
ML = MERCURY_C_LIB_DIR=. $(SCRIPTS_DIR)/ml
MLFLAGS = --mercury-libs none $(EXTRA_MLFLAGS)
-MLLIBS = $(EXTRA_MLLIBS) $(LIBRARY_DIR)/libmercury.a \
- $(RUNTIME_DIR)/libmer.a ` \
+MLLIBS = $(EXTRA_MLLIBS) $(LIBRARY_DIR)/lib$(STD_LIB_NAME).a \
+ $(RUNTIME_DIR)/lib$(RT_LIB_NAME).a ` \
case $(GRADE) in \
- *.gc*.prof*) echo $(BOEHM_GC_DIR)/libgc_prof.a ;; \
- *.gc*) echo $(BOEHM_GC_DIR)/libgc.a ;; \
+ *.gc*.prof*) echo $(BOEHM_GC_DIR)/libgc_prof.a ;; \
+ *.gc*) echo $(BOEHM_GC_DIR)/libgc.a ;; \
esac \
` -lm
MSL = MERCURY_SP_LIB_DIR=$(LIBRARY_DIR) $(SCRIPTS_DIR)/msl
@@ -56,7 +56,8 @@
# Add some additional dependencies, so that Mmake knows to remake the
# profiler if one of the libraries changes.
-mercury_profile: $(RUNTIME_DIR)/libmer.a $(LIBRARY_DIR)/libmercury.a
+mercury_profile: $(RUNTIME_DIR)/lib$(RT_LIB_NAME).a
+mercury_profile: $(LIBRARY_DIR)/lib$(STD_LIB_NAME).a
# Should also depend on $(BOEHM_GC_DIR)/libgc(_prof).a, but only
# if in .gc(.prof) grade; GNU make does not support dynamic dependencies,
# so just leave it out.
cvs diff: Diffing runtime
Index: runtime/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/Mmakefile,v
retrieving revision 1.38
diff -u -u -r1.38 Mmakefile
--- Mmakefile 1998/09/15 07:19:11 1.38
+++ Mmakefile 1998/09/23 06:00:16
@@ -6,7 +6,7 @@
# Mmake - Mmake file for the Mercury runtime library
-MAIN_TARGET=lib
+MAIN_TARGET=runtime
MERCURY_DIR=..
include $(MERCURY_DIR)/Mmake.common
@@ -45,6 +45,7 @@
mercury_imp.h \
mercury_init.h \
mercury_label.h \
+ mercury_layout_util.h \
mercury_library_types.h \
mercury_memory.h \
mercury_memory_zones.h \
@@ -69,11 +70,7 @@
mercury_tags.h \
mercury_thread.h \
mercury_timing.h \
- mercury_trace.h \
mercury_trace_base.h \
- mercury_trace_external.h \
- mercury_trace_internal.h \
- mercury_trace_util.h \
mercury_trail.h \
mercury_types.h \
mercury_type_info.h \
@@ -112,6 +109,7 @@
mercury_heap_profile.c \
mercury_ho_call.c \
mercury_label.c \
+ mercury_layout_util.c \
mercury_memory.c \
mercury_memory_zones.c \
mercury_memory_handlers.c \
@@ -127,11 +125,7 @@
mercury_table_type_info.c \
mercury_thread.c \
mercury_timing.c \
- mercury_trace.c \
mercury_trace_base.c \
- mercury_trace_external.c \
- mercury_trace_internal.c \
- mercury_trace_util.c \
mercury_trail.c \
mercury_type_info.c \
mercury_wrapper.c
@@ -158,11 +152,11 @@
ifeq ($(USE_DLLS),yes)
-DLL_CFLAGS = -Dlibmer_DEFINE_DLL
+DLL_CFLAGS = -Dlib$(RT_LIB_NAME)_DEFINE_DLL
# the following header files are created automatically by Makefile.DLLs
-LIBMER_DLL_H = libmer_dll.h
-LIBMER_GLOBALS_H = libmer_globals.h
+LIBMER_DLL_H = lib$(RT_LIB_NAME)_dll.h
+LIBMER_GLOBALS_H = lib$(RT_LIB_NAME)_globals.h
include $(MERCURY_DIR)/Makefile.DLLs
@@ -181,23 +175,24 @@
#-----------------------------------------------------------------------------#
-.PHONY: lib
-lib: libmer.a libmer.$(EXT_FOR_SHARED_LIB) runtime.init \
- $(LIBMER_DLL_H) $(LIBMER_GLOBALS_H)
-
-libmer$(DLL_DEF_LIB).a: $(OBJS)
- rm -f libmer$(DLL_DEF_LIB).a
- ar cr libmer$(DLL_DEF_LIB).a $(OBJS)
- $(RANLIB) libmer$(DLL_DEF_LIB).a
+.PHONY: runtime
+runtime: lib$(RT_LIB_NAME).a lib$(RT_LIB_NAME).$(EXT_FOR_SHARED_LIB)
+runtime: $(RT_LIB_NAME).init
+runtime: $(LIBMER_DLL_H) $(LIBMER_GLOBALS_H)
+
+lib$(RT_LIB_NAME)$(DLL_DEF_LIB).a: $(OBJS)
+ rm -f lib$(RT_LIB_NAME)$(DLL_DEF_LIB).a
+ ar cr lib$(RT_LIB_NAME)$(DLL_DEF_LIB).a $(OBJS)
+ $(RANLIB) lib$(RT_LIB_NAME)$(DLL_DEF_LIB).a
-libmer.so: $(PIC_OBJS)
- $(LINK_SHARED_OBJ) -o libmer.so $(PIC_OBJS) \
+lib$(RT_LIB_NAME).so: $(PIC_OBJS)
+ $(LINK_SHARED_OBJ) -o lib$(RT_LIB_NAME).so $(PIC_OBJS) \
$(SHLIB_RPATH_OPT)$(FINAL_INSTALL_MERC_GC_LIB_DIR) \
$(LDFLAGS) $(LDLIBS) $(THREADLIBS) \
$(SHARED_LIBS)
-runtime.init: $(CFILES)
- cat `vpath_find $(CFILES)` | grep '^INIT ' > runtime.init
+$(RT_LIB_NAME).init: $(CFILES)
+ cat `vpath_find $(CFILES)` | grep '^INIT ' > $(RT_LIB_NAME).init
mercury_conf.h.date: $(MERCURY_DIR)/config.status mercury_conf.h.in
CONFIG_FILES= CONFIG_HEADERS=mercury_conf.h $(MERCURY_DIR)/config.status
@@ -237,14 +232,19 @@
cp `vpath_find $(MACHHDRS)` $(INSTALL_INC_DIR)/machdeps
.PHONY: install_init
-install_init: runtime.init
+install_init: $(RT_LIB_NAME).init
-[ -d $(INSTALL_MODULE_DIR) ] || mkdir -p $(INSTALL_MODULE_DIR)
- cp `vpath_find runtime.init` $(INSTALL_MODULE_DIR)
+ cp `vpath_find $(RT_LIB_NAME).init` $(INSTALL_MODULE_DIR)
+ # "$(RT_LIB_NAME).init" used to be called "runtime.init".
+ # If there is still a version with an old name lying around,
+ # then delete it; otherwise the initialization would get done twice.
+ rm -f $(INSTALL_MODULE_DIR)/runtime.init
.PHONY: install_lib
-install_lib: libmer.a libmer.$(EXT_FOR_SHARED_LIB)
+install_lib: lib$(RT_LIB_NAME).a lib$(RT_LIB_NAME).$(EXT_FOR_SHARED_LIB)
-[ -d $(INSTALL_MERC_LIB_DIR) ] || mkdir -p $(INSTALL_MERC_LIB_DIR)
- cp `vpath_find libmer.a libmer.$(EXT_FOR_SHARED_LIB)` \
+ cp `vpath_find lib$(RT_LIB_NAME).a \
+ lib$(RT_LIB_NAME).$(EXT_FOR_SHARED_LIB)` \
$(INSTALL_MERC_LIB_DIR)
#-----------------------------------------------------------------------------#
@@ -261,7 +261,7 @@
rm -f $(OBJS) $(PIC_OBJS)
realclean:
- rm -f libmer.a libmer.so runtime.init
+ rm -f lib$(RT_LIB_NAME).a lib$(RT_LIB_NAME).so $(RT_LIB_NAME).init
rm -f mercury_conf.h mercury_conf.h.date
#-----------------------------------------------------------------------------#
cvs diff: Diffing runtime/GETOPT
cvs diff: Diffing runtime/machdeps
cvs diff: Diffing samples
cvs diff: Diffing samples/c_interface
cvs diff: Diffing samples/c_interface/c_calls_mercury
cvs diff: Diffing samples/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/c_interface/mercury_calls_c
cvs diff: Diffing samples/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/diff
cvs diff: Diffing scripts
Index: scripts/ml.in
===================================================================
RCS file: /home/mercury1/repository/mercury/scripts/ml.in,v
retrieving revision 1.46
diff -u -u -r1.46 ml.in
--- ml.in 1998/07/27 01:05:17 1.46
+++ ml.in 1998/09/24 05:39:56
@@ -85,6 +85,11 @@
SHLIB_RPATH_SEP=${MERCURY_SHLIB_RPATH_SEP="@SHLIB_RPATH_SEP@"}
SHARED_LIBS=${MERCURY_SHARED_LIBS="@SHARED_LIBS@"}
+RT_LIB_NAME=mer_rt
+STD_LIB_NAME=mer_std
+TRACE_LIB_NAME=mer_trace
+BROWSER_LIB_NAME=mer_browser
+
verbose=false
case $FULLARCH in
*-win95|*-winnt|*-win32|*-cygwin32)
@@ -253,11 +258,12 @@
#
# .debug grade implies --use-trail
# (see comment in compiler/handle_options.m for rationale)
+# (... and for why it does not work yet)
#
-case $stack_trace,$require_tracing in
- true,true)
- use_trail=true ;;
-esac
+# case $stack_trace,$require_tracing in
+# true,true)
+# use_trail=true ;;
+# esac
#
# compute the grade from the options settings
@@ -366,13 +372,25 @@
case $mercury_libs in
shared)
- LIBS=${MERCURY_LIBS="-lmercury -lmer $LIBGC $STDLIBS"}
+ # Repeating -l$STD_LIB_NAME for shared objects would have
+ # no effect.
+ LIBS=${MERCURY_LIBS="-l$TRACE_LIB_NAME -l$BROWSER_LIB_NAME -l$STD_LIB_NAME -l$RT_LIB_NAME $LIBGC $STDLIBS"}
merc_shlib_dirs="$merc_shlib_dirs $LIBDIR/$GRADE/$FULLARCH"
merc_shlib_dirs="$merc_shlib_dirs $LIBDIR/$FULLARCH"
;;
- static) LIBS=${MERCURY_LIBS="\
- $LIBDIR/$GRADE/$FULLARCH/libmercury.a \
- $LIBDIR/$GRADE/$FULLARCH/libmer.a \
+ static)
+ # We repeat lib$STD_LIB_NAME.a. The first occurrence is to
+ # pick up objects needed by the program. Since the library
+ # may have been compiled with tracing even though the program
+ # isn't, this may then introduce references to MR_trace, which
+ # will pull in the browser library and possibly other objects
+ # from the standard library.
+ LIBS=${MERCURY_LIBS="\
+ $LIBDIR/$GRADE/$FULLARCH/lib$STD_LIB_NAME.a \
+ $LIBDIR/$GRADE/$FULLARCH/lib$TRACE_LIB_NAME.a \
+ $LIBDIR/$GRADE/$FULLARCH/lib$BROWSER_LIB_NAME.a \
+ $LIBDIR/$GRADE/$FULLARCH/lib$STD_LIB_NAME.a \
+ $LIBDIR/$GRADE/$FULLARCH/lib$RT_LIB_NAME.a \
$LIBGC_STATIC \
$STDLIBS"}
merc_shlib_dirs=""
cvs diff: Diffing tests
cvs diff: Diffing tests/benchmarks
cvs diff: Diffing tests/debugger
cvs diff: Diffing tests/general
cvs diff: Diffing tests/hard_coded
cvs diff: Diffing tests/hard_coded/typeclasses
cvs diff: Diffing tests/invalid
cvs diff: Diffing tests/misc_tests
cvs diff: Diffing tests/tabling
cvs diff: Diffing tests/term
cvs diff: Diffing tests/valid
cvs diff: Diffing tests/warnings
cvs diff: Diffing tools
Index: tools/bootcheck
===================================================================
RCS file: /home/mercury1/repository/mercury/tools/bootcheck,v
retrieving revision 1.63
diff -u -u -r1.63 bootcheck
--- bootcheck 1998/09/11 01:06:42 1.63
+++ bootcheck 1998/09/24 04:42:05
@@ -74,6 +74,11 @@
test_sicstus=false
use_subdirs=${MMAKE_USE_SUBDIRS=no}
+RT_LIB_NAME=mer_rt
+STD_LIB_NAME=mer_std
+TRACE_LIB_NAME=mer_trace
+BROWSER_LIB_NAME=mer_browser
+
while [ $# -gt 0 ]; do
case "$1" in
@@ -251,7 +256,13 @@
ln -s $root/library/[m-z]*.m .
ln -s $root/library/*.nl .
cp $root/library/Mmake* .
- ln -s $root/library/libmercury.init .
+ ln -s $root/library/$STD_LIB_NAME.init .
+ cd $root/stage2_sicstus
+ mkdir browser
+ cd browser
+ ln -s $root/browser/*.m .
+ cp $root/browser/Mmake* .
+ ln -s $root/browser/$BROWSER_LIB_NAME.init .
cd $root/stage2_sicstus
if "$copy_runtime"
then
@@ -266,8 +277,16 @@
cp $root/runtime/Mmake* .
ln -s $root/runtime/machdeps .
cd $root/stage2_sicstus
+ rm trace
+ mkdir trace
+ cd trace
+ ln -s $root/trace/*.h .
+ ln -s $root/trace/*.c .
+ cp $root/trace/Mmake* .
+ cd $root/stage2_sicstus
else
ln -s $root/runtime .
+ ln -s $root/trace .
fi
if "$copy_boehm_gc"
then
@@ -289,7 +308,7 @@
ln -s $root/doc .
ln -s $root/scripts .
ln -s $root/util .
- if test "$copy_profiler" = "true"
+ if "$copy_profiler"
then
mkdir profiler
cd profiler
@@ -316,8 +335,8 @@
if
cd stage2_sicstus &&
- mmake $mmake_opts depend_library depend_compiler \
- depend_profiler &&
+ mmake $mmake_opts depend_library depend_browser \
+ depend_compiler depend_profiler &&
cd $root
then
echo "building of SICStus stage 2 dependencies successful"
@@ -344,6 +363,17 @@
cd $root
if
+ cd stage2_sicstus/browser &&
+ mmake $mmake_opts $jfactor cs
+ then
+ echo "building of SICStus stage 2 browser successful"
+ else
+ echo "building of SICStus stage 2 browser not successful"
+ exit 1
+ fi
+ cd $root
+
+ if
cd stage2_sicstus/compiler &&
mmake $mmake_opts $jfactor cs
then
@@ -362,7 +392,7 @@
exec > "$outfile" # redirect stdout to $outfile
fi
- for dir in library compiler; do
+ for dir in library browser compiler; do
for file in stage2/$dir/${cs_subdir}*.c; do
diff -u $file \
stage2_sicstus/${cs_subdir}$dir/`basename $file` ||
@@ -388,7 +418,6 @@
/bin/rm -fr $root/stage2_sicstus/.[a-zA-Z]* < /dev/null
exit 0
fi
-
fi
if $do_bootcheck
@@ -399,6 +428,8 @@
else
cd $root/library;
mmake depend
+ cd $root/browser;
+ mmake depend
cd $root/compiler;
mmake depend
cd $root/profiler;
@@ -458,10 +489,19 @@
ln -s $root/library/[m-z]*.m .
ln -s $root/library/*.nl .
cp $root/library/Mmake* .
- ln -s $root/library/libmercury.init .
+ ln -s $root/library/$STD_LIB_NAME.init .
cd $root/stage2
- if test "$copy_runtime" = "true"
+ mkdir browser
+ cd browser
+ ln -s $root/browser/*.m .
+ cp $root/browser/Mmake* .
+ ln -s $root/browser/$BROWSER_LIB_NAME.init .
+ cd $root/stage2
+ if "$copy_runtime"
then
+ # Remove symbolic link to the stage 1 runtime if it's present,
+ # which it can be with the -2 option.
+ rm runtime
mkdir runtime
cd runtime
ln -s $root/runtime/*.h .
@@ -470,10 +510,18 @@
cp $root/runtime/Mmake* .
ln -s $root/runtime/machdeps .
cd $root/stage2
+ rm trace
+ mkdir trace
+ cd trace
+ ln -s $root/trace/*.h .
+ ln -s $root/trace/*.c .
+ cp $root/trace/Mmake* .
+ cd $root/stage2
else
ln -s $root/runtime .
+ ln -s $root/trace .
fi
- if test "$copy_boehm_gc" = "true"
+ if "$copy_boehm_gc"
then
mkdir boehm_gc
cd boehm_gc
@@ -491,7 +539,7 @@
ln -s $root/doc .
ln -s $root/scripts .
ln -s $root/util .
- if test "$copy_profiler" = "true"
+ if "$copy_profiler"
then
mkdir profiler
cd profiler
@@ -548,6 +596,22 @@
exit 1
fi
+ if (cd stage2/browser && mmake $mmake_opts $jfactor RM_C=: library)
+ then
+ echo "building of stage 2 browser successful"
+ else
+ echo "building of stage 2 browser not successful"
+ exit 1
+ fi
+
+ if (cd stage2 && mmake $mmake_opts $jfactor trace)
+ then
+ echo "building of stage 2 trace successful"
+ else
+ echo "building of stage 2 trace not successful"
+ exit 1
+ fi
+
if (cd stage2/compiler && mmake $mmake_opts $jfactor RM_C=: mercury_compile)
then
echo "building of stage 2 compiler successful"
@@ -617,11 +681,18 @@
ln -s $root/library/[m-z]*.m .
ln -s $root/library/*.nl .
cp $root/library/Mmake* .
- ln -s $root/library/libmercury.init .
+ ln -s $root/library/$STD_LIB_NAME.init .
+ cd $root/stage3
+ mkdir browser
+ cd browser
+ ln -s $root/browser/*.m .
+ cp $root/browser/Mmake* .
+ ln -s $root/browser/$BROWSER_LIB_NAME.init .
cd $root/stage3
ln -s $root/boehm_gc .
ln -s $root/doc .
ln -s $root/runtime .
+ ln -s $root/trace .
ln -s $root/scripts .
ln -s $root/util .
ln -s $root/profiler .
@@ -639,7 +710,7 @@
cd $root
set -x
- if (cd stage3 && mmake $mmake_opts depend_library depend_compiler)
+ if (cd stage3 && mmake $mmake_opts depend_library depend_browser depend_compiler)
then
echo "building of stage 3 dependencies successful"
else
@@ -677,6 +748,14 @@
/bin/rm -f $root/stage2/compiler/[t-z]*.o < /dev/null
fi
+ if (cd stage3/browser && mmake $mmake_opts $jfactor cs)
+ then
+ echo "building of stage 3 browser successful"
+ else
+ echo "building of stage 3 browser not successful"
+ exit 1
+ fi
+
if (cd stage3/compiler && mmake $mmake_opts $jfactor cs)
then
echo "building of stage 3 compiler successful"
@@ -693,7 +772,7 @@
exec > "$outfile" # redirect stdout to $outfile
fi
- for dir in library compiler; do
+ for dir in library browser compiler; do
for file in stage2/$dir/${cs_subdir}*.c; do
diff -u $file stage3/$dir/${cs_subdir}`basename $file` ||
diff_status=1
@@ -744,13 +823,20 @@
MERCURY_INT_DIR=$root/library
export MERCURY_INT_DIR
- MERCURY_LIBS="$root/library/libmercury.a
- $root/runtime/libmer.a
+ # The standard library is repeated in case it introduces
+ # references to MR_trace.
+ MERCURY_LIBS="
+ $root/library/lib$STD_LIB_NAME.a
+ $root/trace/lib$TRACE_LIB_NAME.a
+ $root/browser/lib$BROWSER_LIB_NAME.a
+ $root/library/lib$STD_LIB_NAME.a
+ $root/runtime/lib$RT_LIB_NAME.a
$root/boehm_gc/libgc.a
-lm"
export MERCURY_LIBS
- MERCURY_ALL_C_INCL_DIRS="-I$root/runtime
+ MERCURY_ALL_C_INCL_DIRS="-I$root/trace
+ -I$root/runtime
-I$root/boehm_gc
-I$root/boehm_gc/include"
export MERCURY_ALL_C_INCL_DIRS
@@ -758,8 +844,10 @@
MMAKE_DIR="$root/scripts"
export MMAKE_DIR
- MERCURY_MOD_LIB_MODS="$root/runtime/runtime.init
- $root/library/libmercury.init"
+ MERCURY_MOD_LIB_MODS="$root/trace/$TRACE_LIB_NAME.init
+ $root/browser/$BROWSER_LIB_NAME.init
+ $root/library/$STD_LIB_NAME.init
+ $root/runtime/$RT_LIB_NAME.init"
export MERCURY_MOD_LIB_MODS
# for mkinit, mmc, mgnuc, ml etc
@@ -769,13 +857,20 @@
MERCURY_INT_DIR=$root/stage2/library
export MERCURY_INT_DIR
- MERCURY_LIBS="$root/stage2/library/libmercury.a
- $root/stage2/runtime/libmer.a
+ # The standard library is repeated in case it introduces
+ # references to MR_trace.
+ MERCURY_LIBS="
+ $root/stage2/library/lib$STD_LIB_NAME.a
+ $root/stage2/trace/lib$TRACE_LIB_NAME.a
+ $root/stage2/browser/lib$BROWSER_LIB_NAME.a
+ $root/stage2/library/lib$STD_LIB_NAME.a
+ $root/stage2/runtime/lib$RT_LIB_NAME.a
$root/stage2/boehm_gc/libgc.a
-lm"
export MERCURY_LIBS
- MERCURY_ALL_C_INCL_DIRS="-I$root/stage2/runtime
+ MERCURY_ALL_C_INCL_DIRS="-I$root/stage2/trace
+ -I$root/stage2/runtime
-I$root/stage2/boehm_gc
-I$root/stage2/boehm_gc/include"
export MERCURY_ALL_C_INCL_DIRS
@@ -783,14 +878,25 @@
MMAKE_DIR="$root/stage2/scripts"
export MMAKE_DIR
- MERCURY_MOD_LIB_MODS="$root/stage2/runtime/runtime.init
- $root/stage2/library/libmercury.init"
+ MERCURY_MOD_LIB_MODS="$root/stage2/trace/$TRACE_LIB_NAME.init
+ $root/stage2/browser/$BROWSER_LIB_NAME.init
+ $root/stage2/library/$STD_LIB_NAME.init
+ $root/stage2/runtime/$RT_LIB_NAME.init"
export MERCURY_MOD_LIB_MODS
# for mkinit, mmc, mgnuc, ml etc
PATH=$root/stage2/util:$root/stage2/scripts:$PATH
export PATH
fi
+
+ # We need to give tests/debugger access to the mdbrc and mdb_doc
+ # files in the doc directory, without hardcoding their pathnames.
+ # We must also compensate for doc/mdbrc having hardcoded within it
+ # the *installed* pathname of mdb_doc and not its current pathname.
+ cat $root/doc/mdb_doc > $root/doc/test_mdbrc
+ sed -e '/^source/d' $root/doc/mdbrc >> $root/doc/test_mdbrc
+ MERCURY_DEBUGGER_INIT=$root/doc/test_mdbrc
+ export MERCURY_DEBUGGER_INIT
if test -d ../tests
then
cvs diff: Diffing trace
Index: Mmakefile
===================================================================
RCS file: Mmakefile
diff -N Mmakefile
--- /dev/null Wed May 28 10:49:58 1997
+++ Mmakefile Wed Sep 23 18:32:11 1998
@@ -0,0 +1,167 @@
+#-----------------------------------------------------------------------------#
+# Copyright (C) 1998 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.
+#-----------------------------------------------------------------------------#
+
+# Mmakefile for the Mercury trace library, which contains the runtime
+# system components that are needed only if some procedures are traced.
+
+MAIN_TARGET=trace
+
+MERCURY_DIR=..
+include $(MERCURY_DIR)/Mmake.common
+
+#-----------------------------------------------------------------------------#
+
+CFLAGS = -I$(MERCURY_DIR)/browser -I$(MERCURY_DIR)/library \
+ -I$(MERCURY_DIR)/runtime -I$(MERCURY_DIR)/boehm_gc \
+ -g $(DLL_CFLAGS) $(EXTRA_CFLAGS)
+MGNUC = MERCURY_C_INCL_DIR=. $(SCRIPTS_DIR)/mgnuc
+MGNUCFLAGS = --no-ansi $(EXTRA_MGNUCFLAGS) $(CFLAGS)
+MOD2C = $(SCRIPTS_DIR)/mod2c
+
+#-----------------------------------------------------------------------------#
+
+# keep this list in alphabetical order, please
+HDRS = \
+ mercury_macros.h \
+ mercury_trace.h \
+ mercury_trace_alias.h \
+ mercury_trace_external.h \
+ mercury_trace_help.h \
+ mercury_trace_internal.h \
+ mercury_trace_spy.h \
+ mercury_trace_tables.h
+
+# keep this list in alphabetical order, please
+CFILES = \
+ mercury_trace.c \
+ mercury_trace_alias.c \
+ mercury_trace_external.c \
+ mercury_trace_help.c \
+ mercury_trace_internal.c \
+ mercury_trace_spy.c \
+ mercury_trace_tables.c
+
+OBJS = $(CFILES:.c=.o)
+PIC_OBJS = $(CFILES:.c=.$(EXT_FOR_PIC_OBJECTS))
+
+LDFLAGS = -L$(BROWSER_DIR) -L$(LIBRARY_DIR) \
+ -L$(RUNTIME_DIR) -L$(BOEHM_GC_DIR)
+LDLIBS = -l$(BROWSER_LIB_NAME) -l$(STD_LIB_NAME) -l$(RT_LIB_NAME) \
+ ` case "$(GRADE)" in \
+ *.gc*.prof*) echo "-lgc_prof" ;; \
+ *.gc*) echo "-lgc" ;; \
+ esac \
+ `
+THREADLIBS = \
+ ` case "$(GRADE)" in \
+ *.par*) echo "-lpthread" ;; \
+ esac \
+ `
+
+#-----------------------------------------------------------------------------#
+
+# Stuff for Windows DLLs
+
+ifeq ($(USE_DLLS),yes)
+
+DLL_CFLAGS = -Dlib$(TRACE_LIB_NAME)_DEFINE_DLL
+
+# the following header files are created automatically by Makefile.DLLs
+LIBMER_DLL_H = lib$(TRACE_LIB_NAME)_dll.h
+LIBMER_GLOBALS_H = lib$(TRACE_LIB_NAME)_globals.h
+
+include $(MERCURY_DIR)/Makefile.DLLs
+
+else
+
+DLL_CFLAGS =
+LIBMER_DLL_H =
+LIBMER_GLOBALS_H =
+DLL_DEF_LIB =
+
+endif
+
+#-----------------------------------------------------------------------------#
+
+$(OBJS) $(PIC_OBJS): $(HDRS)
+
+#-----------------------------------------------------------------------------#
+
+.PHONY: trace
+trace: lib$(TRACE_LIB_NAME).a lib$(TRACE_LIB_NAME).$(EXT_FOR_SHARED_LIB)
+trace: $(TRACE_LIB_NAME).init
+trace: $(LIBMER_DLL_H) $(LIBMER_GLOBALS_H)
+
+lib$(TRACE_LIB_NAME)$(DLL_DEF_LIB).a: $(OBJS)
+ rm -f lib$(TRACE_LIB_NAME)$(DLL_DEF_LIB).a
+ ar cr lib$(TRACE_LIB_NAME)$(DLL_DEF_LIB).a $(OBJS)
+ $(RANLIB) lib$(TRACE_LIB_NAME)$(DLL_DEF_LIB).a
+
+lib$(TRACE_LIB_NAME).so: $(PIC_OBJS)
+ $(LINK_SHARED_OBJ) -o lib$(TRACE_LIB_NAME).so $(PIC_OBJS) \
+ $(SHLIB_RPATH_OPT)$(FINAL_INSTALL_MERC_GC_LIB_DIR) \
+ $(LDFLAGS) $(LDLIBS) $(THREADLIBS) \
+ $(SHARED_LIBS)
+
+$(TRACE_LIB_NAME).init: $(CFILES)
+ cat `vpath_find $(CFILES)` | grep '^INIT ' > $(TRACE_LIB_NAME).init
+
+.PHONY: cs
+cs: $(CFILES)
+
+tags: $(CFILES) $(HDRS)
+ ctags $(CFILES) $(HDRS)
+
+.PHONY: check_headers
+check_headers:
+ for file in $(HDRS); do \
+ echo "$$file"; \
+ echo "#include \"$$file\"" > tmp.c; \
+ $(MGNUC) $(MGNUCFLAGS) -c tmp.c || exit 1; \
+ done
+ rm -f tmp.c
+
+#-----------------------------------------------------------------------------#
+
+# installation rules
+
+.PHONY: install
+install: install_headers install_init install_lib
+
+.PHONY: install_headers
+install_headers: $(HDRS) $(LIBMER_GLOBALS_H)
+ cp `vpath_find $(HDRS) $(LIBMER_GLOBALS_H)` $(INSTALL_INC_DIR)
+
+.PHONY: install_init
+install_init: $(TRACE_LIB_NAME).init
+ -[ -d $(INSTALL_MODULE_DIR) ] || mkdir -p $(INSTALL_MODULE_DIR)
+ cp `vpath_find $(TRACE_LIB_NAME).init` $(INSTALL_MODULE_DIR)
+
+.PHONY: install_lib
+install_lib: lib$(TRACE_LIB_NAME).a lib$(TRACE_LIB_NAME).$(EXT_FOR_SHARED_LIB)
+ -[ -d $(INSTALL_MERC_LIB_DIR) ] || mkdir -p $(INSTALL_MERC_LIB_DIR)
+ cp `vpath_find lib$(TRACE_LIB_NAME).a \
+ lib$(TRACE_LIB_NAME).$(EXT_FOR_SHARED_LIB)` \
+ $(INSTALL_MERC_LIB_DIR)
+
+#-----------------------------------------------------------------------------#
+
+# prevent Mmake from removing C files
+RM_C=:
+
+#-----------------------------------------------------------------------------#
+
+clean: clean_o
+
+.PHONY: clean_o
+clean_o:
+ rm -f $(OBJS) $(PIC_OBJS)
+
+realclean:
+ rm -f lib$(TRACE_LIB_NAME).a lib$(TRACE_LIB_NAME).so \
+ $(TRACE_LIB_NAME).init
+
+#-----------------------------------------------------------------------------#
cvs diff: Diffing trial
cvs diff: Diffing util
More information about the developers
mailing list