diff: pass --warn-undefined-variables to GNU make

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Mar 27 19:33:21 AEDT 1998


scripts/mmake.in:
	Pass `--warn-undefined-variables', except when making dependencies.

runtime/Mmakefile:
scripts/Mmake.vars.in:
	Add empty definitions of a few variables, to avoid warnings with
	`--warn-undefined-variables'.

cvs diff  runtime/Mmakefile scripts/Mmake.vars.in scripts/mmake.in
Index: runtime/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/Mmakefile,v
retrieving revision 1.23
diff -u -r1.23 Mmakefile
--- Mmakefile	1998/03/17 03:31:28	1.23
+++ Mmakefile	1998/03/19 17:08:30
@@ -129,6 +129,12 @@
 
 include $(MERCURY_DIR)/Makefile.DLLs
 
+else
+
+LIBMER_DLL_H =
+LIBMER_GLOBALS_H =
+DLL_DEF_LIB =
+
 endif
 
 #-----------------------------------------------------------------------------#
Index: scripts/Mmake.vars.in
===================================================================
RCS file: /home/mercury1/repository/mercury/scripts/Mmake.vars.in,v
retrieving revision 1.16
diff -u -r1.16 Mmake.vars.in
--- Mmake.vars.in	1998/03/20 02:58:24	1.16
+++ Mmake.vars.in	1998/03/22 10:36:38
@@ -95,6 +95,10 @@
 # Set `RM_C' to `:' if you want to keep the intermediate `.c' files.
 RM_C		= rm
 
+# lists of targets that depend on $(MLOBJS) and $(MLPICOBJS)
+MLOBJS_DEPS = 
+MLPICOBJS_DEPS = 
+
 #-----------------------------------------------------------------------------#
 #
 # The following variables specify the names of the subdirectories used,
@@ -131,11 +135,13 @@
 nos_subdir=
 qls_subdir=
 deps_subdir=
+int0s_subdir=
 ints_subdir=
 int2s_subdir=
 int3s_subdir=
 opts_subdir=
 trans_opts_subdir=
+date0s_subdir=
 dates_subdir=
 date3s_subdir=
 optdates_subdir=
Index: scripts/mmake.in
===================================================================
RCS file: /home/mercury1/repository/mercury/scripts/mmake.in,v
retrieving revision 1.15
diff -u -r1.15 mmake.in
--- mmake.in	1998/03/18 08:09:50	1.15
+++ mmake.in	1998/03/22 10:43:04
@@ -119,6 +119,7 @@
 		mmake=""
 	fi
 fi
+
 case $use_subdirs in
 	no)
 		deps="`echo *.dep`"
@@ -153,6 +154,17 @@
 
 MMAKE_MAKE_CMD="${MMAKE_MAKE} -f $tmp -r"
 
+# Enable checking for undefined variables -- but not when making the
+# dependencies.
+case "$@" in
+	dep*|*.dep*)
+		MMAKE_MAKE_OPTS=""
+		;;
+	*)
+		MMAKE_MAKE_OPTS="--warn-undefined-variables"
+		;;
+esac
+
 if $verbose; then
 	echo MMAKE=$MMAKE
 	echo export MMAKE
@@ -165,7 +177,7 @@
 	echo MERCURY_DEFAULT_GRADE=$MERCURY_DEFAULT_GRADE
 	echo export MERCURY_DEFAULT_GRADE
 	echo cat ${MMAKE_VARS} $deps $ds $mmake ${MMAKE_RULES} ">" $tmp
-	echo ${MMAKE_MAKE} -f $tmp -r "$@"
+	echo ${MMAKE_MAKE} ${MMAKE_MAKE_OPTS} -f $tmp -r "$@"
 fi
 export MMAKE
 export MMAKE_MAKE_CMD
@@ -177,5 +189,5 @@
 	# Note that we can't use `exec' here, because if we did that,
 	# that `trap' code which removes $tmp would never get executed.
 	0) ${MMAKE_MAKE} -f $tmp -r ;;
-	*) ${MMAKE_MAKE} -f $tmp -r "$@" ;;
+	*) ${MMAKE_MAKE} ${MMAKE_MAKE_OPTS} -f $tmp -r "$@" ;;
 esac

-- 
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