[m-dev.] diff: --use-subdirs and Prolog

Fergus Henderson fjh at cs.mu.OZ.AU
Sat Mar 28 03:34:41 AEDT 1998


On 28-Mar-1998, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> Fix a bug where building NU-Prolog or SICStus Prolog executables with
> MMAKE_USE_SUBDIRS set to `yes' did not work.
> 
> scripts/mnc.in:
> scripts/msc.in:
> 	Add support for a `--use-subdirs' option.
> 
> scripts/Mmake.rules:
> 	If MMAKE_USE_SUBDIRS=yes, then add `--use-subdirs' to
> 	$(MNCFLAGS) and $(MSCFLAGS).

A few more changes are required to build NU-Prolog or SICStus versions
of the Mercury standard library.

scripts/mnl.in:
	Add support for new environment variable MERCURY_NU_DEBUG_LIB_OBJS,
	for use by library/Mmakefile.

library/Mmakefile:
	Fix places where .no and .ql files where hard-coded as being in
	the current directory instead of in $(nos_subdir) or $(qls_subdir).

cvs diff  library/Mmakefile scripts/Mmake.rules scripts/mnc.in scripts/mnl.in scripts/msc.in
Index: library/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/library/Mmakefile,v
retrieving revision 1.27
diff -u -r1.27 Mmakefile
--- Mmakefile	1998/03/20 04:18:54	1.27
+++ Mmakefile	1998/03/27 15:08:35
@@ -29,15 +29,18 @@
 MNC	=	MERCURY_NC_BUILTIN="`vpath_find nc_builtin.nl`" \
 		$(SCRIPTS_DIR)/mnc
 MNL	=	MERCURY_NU_LIB_DIR=. \
-		MERCURY_NU_LIB_OBJS="`vpath_find $(library.nos) $(NU_LIBRARY_NOS)`" \
+		MERCURY_NU_LIB_OBJS="`vpath_find $(library.nos) \
+					$(NU_LIBRARY_NOS)`" \
 		MERCURY_NU_OVERRIDING_LIB_OBJS="$(NU_OVERRIDING_LIBRARY_NOS)" \
+		MERCURY_NU_DEBUG_LIB_OBJS="$(NU_DEBUG_LIBRARY_NOS)" \
 		$(SCRIPTS_DIR)/mnl -v
 
 MSC	=	MERCURY_SICSTUS_COMPILER=./sicstus_compile $(SCRIPTS_DIR)/msc
 MSL	=	MERCURY_SP_LIB_DIR=. \
 		MERCURY_SICSTUS_PROLOG=./sicstus_saved_state \
 		MERCURY_SP_LIB_OBJS="`vpath_find sp_builtin.ql \
-				$(library.qls) $(NU_LIBRARY_QLS) portray.ql`" \
+				$(library.qls) $(NU_LIBRARY_QLS) \
+				$(qls_subdir)portray.ql`" \
 		MERCURY_SP_OVERRIDING_LIB_OBJS="$(NU_OVERRIDING_LIBRARY_QLS)" \
 		$(SCRIPTS_DIR)/msl
 
@@ -111,17 +114,21 @@
 
 #-----------------------------------------------------------------------------#
 
-NU_LIBRARY_NOS = \
-	io.nu.no require.nu.no std_util.nu.no string.nu.no term_io.nu.no \
-	int.nu.no float.nu.no char.nu.no mercury_builtin.nu.no library.nu.no \
-	store.nu.no
-NU_OVERRIDING_LIBRARY_NOS = map.nu.no assoc_list.nu.no array.nu.no
-
-NU_LIBRARY_QLS = \
-	io.nu.ql require.nu.ql std_util.nu.ql string.nu.ql term_io.nu.ql \
-	int.nu.ql float.nu.ql char.nu.ql mercury_builtin.nu.ql library.nu.ql \
-	store.nu.ql sp_lib.ql
-NU_OVERRIDING_LIBRARY_QLS = map.nu.ql assoc_list.nu.ql array.nu.ql
+NU_LIBRARY_NLS = \
+	io.nu.nl require.nu.nl std_util.nu.nl string.nu.nl term_io.nu.nl \
+	int.nu.nl float.nu.nl char.nu.nl mercury_builtin.nu.nl library.nu.nl \
+	store.nu.nl
+NU_OVERRIDING_LIBRARY_NLS = map.nu.nl assoc_list.nu.nl array.nu.nl
+NU_DEBUG_LIBRARY_NLS = portray.nl debug.nl error.nl
+	
+
+NU_LIBRARY_NOS = $(NU_LIBRARY_NLS:%.nl=$(nos_subdir)%.no)
+NU_OVERRIDING_LIBRARY_NOS = $(NU_OVERRIDING_LIBRARY_NLS:%.nl=$(nos_subdir)%.no)
+NU_DEBUG_LIBRARY_NOS = $(NU_DEBUG_LIBRARY_NLS:%.nl=$(nos_subdir)%.no)
+
+NU_LIBRARY_QLS = $(NU_LIBRARY_NLS:%.nl=$(qls_subdir)%.ql) \
+	$(qls_subdir)sp_lib.ql
+NU_OVERRIDING_LIBRARY_QLS = $(NU_OVERRIDING_LIBRARY_NLS:%.nl=$(qls_subdir)%.ql)
 
 #-----------------------------------------------------------------------------#
 
@@ -236,15 +243,19 @@
 # isn't part of the application, but in this case it is.
 
 library.nu library.nu.debug: $(NU_LIBRARY_NOS) $(NU_OVERRIDING_LIBRARY_NOS)
-library.sicstus library.sicstus.debug: sp_builtin.ql $(NU_LIBRARY_QLS) $(NU_OVERRIDING_LIBRARY_QLS)
-
-library.nu.debug: error.no debug.no portray.no
-library.sicstus library.sicstus.debug: portray.ql
-
-sp_builtin.ql $(library.qls) $(NU_LIBRARY_QLS) $(NU_OVERRIDING_LIBRARY_QLS) portray.ql: sicstus_compile
+library.sicstus library.sicstus.debug: $(qls_subdir)sp_builtin.ql \
+	$(NU_LIBRARY_QLS) $(NU_OVERRIDING_LIBRARY_QLS)
 
-$(library.nos) $(NU_LIBRARY_NOS) $(NU_OVERRIDING_LIBRARY_NOS) error.no \
-	debug.no portray.no: nc_builtin.nl
+library.nu.debug: $(nos_subdir)error.no $(nos_subdir)debug.no \
+	$(nos_subdir)portray.no
+library.sicstus library.sicstus.debug: $(qls_subdir)portray.ql
+
+sp_builtin.ql $(library.qls) $(NU_LIBRARY_QLS) $(NU_OVERRIDING_LIBRARY_QLS) \
+$(qls_subdir)portray.ql: sicstus_compile
+
+$(library.nos) $(NU_LIBRARY_NOS) $(NU_OVERRIDING_LIBRARY_NOS) \
+	$(nos_subdir)error.no $(nos_subdir)debug.no $(nos_subdir)portray.no: \
+	nc_builtin.nl
 
 #-----------------------------------------------------------------------------#
 
@@ -280,7 +291,7 @@
 # We need to clean up the .no and .ql files for *.nu.nl, etc.
 
 clean:
-	rm -f *.no *.ql
+	rm -f $(nos_subdir)*.no $(qls_subdir)*.ql
 
 realclean:
 	rm -f libmercury.a libmercury.so libmercury.init
@@ -359,13 +370,15 @@
 .PHONY: install_library_nu
 install_library_nu: $(library.nos) $(NU_LIBRARY_NOS) \
 			$(NU_OVERRIDING_LIBRARY_NOS) \
-			error.no debug.no portray.no nc_builtin.nl
+			$(nos_subdir)error.no $(nos_subdir)debug.no \
+			$(nos_subdir)portray.no nc_builtin.nl
 	[ -d $(INSTALL_NU_DIR) ] || mkdir -p $(INSTALL_NU_DIR)
 	cp `vpath_find nc_builtin.nl` $(INSTALL_NU_DIR)
 	[ -d $(INSTALL_NU_ARCH_DIR) ] || mkdir -p $(INSTALL_NU_ARCH_DIR)
 	cp `vpath_find $(library.nos) $(NU_LIBRARY_NOS) \
 		$(NU_OVERRIDING_LIBRARY_NOS) \
-		error.no debug.no portray.no` $(INSTALL_NU_ARCH_DIR)
+		$(nos_subdir)error.no $(nos_subdir)debug.no \
+		$(nos_subdir)portray.no` $(INSTALL_NU_ARCH_DIR)
 
 .PHONY: install_interpreter_nu
 install_interpreter_nu: library.nu
Index: scripts/mnl.in
===================================================================
RCS file: /home/mercury1/repository/mercury/scripts/mnl.in,v
retrieving revision 1.9
diff -u -r1.9 mnl.in
--- mnl.in	1997/07/27 15:09:40	1.9
+++ mnl.in	1998/03/27 15:06:18
@@ -26,7 +26,7 @@
 NULIBDIR=${MERCURY_NU_LIB_DIR=@LIBDIR@/nuprolog/@FULLARCH@}
 LIBRARY_OBJS=${MERCURY_NU_LIB_OBJS=" `cd $NULIBDIR; echo *.no` "}
 OVERRIDING_LIBRARY_OBJS=${MERCURY_NU_OVERRIDING_LIB_OBJS=""}
-debug_objs="portray.no debug.no error.no"
+debug_objs=${MERCURY_NU_DEBUG_LIB_OBJS="portray.no debug.no error.no"}
 
 options=
 verbose=false
-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.



More information about the developers mailing list