[m-dev.] diff: keeping trace namespace-clean

Zoltan Somogyi zs at cs.mu.OZ.AU
Tue Jan 9 16:11:26 AEDT 2001


Mmake.common.in:
runtime/Mmakefile:
	Move the rule for creating foo.o.obj_check files, which can be used to
	check for name-space violations, from runtime/Mmakefile to
	Mmake.common.

trace/Mmakefile:
	Add an entry for checking the name-space cleanliness of the trace
	directory, using the rule now in Mmake.common.

Zoltan.

cvs diff: Diffing .
Index: Mmake.common.in
===================================================================
RCS file: /home/mercury1/repository/mercury/Mmake.common.in,v
retrieving revision 1.48
diff -u -b -r1.48 Mmake.common.in
--- Mmake.common.in	2000/09/22 08:23:44	1.48
+++ Mmake.common.in	2001/01/08 15:17:26
@@ -201,3 +201,24 @@
 -include $(MERCURY_DIR)/Mmake.params
 
 #-----------------------------------------------------------------------------#
+
+# This rule checks that object files are properly namespace-clean, with
+# regard to the global symbols that they define.
+# For an object file foo.o, it produces a file foo.o.obj_check that
+# contains a list of all the globals defined by that object that
+# do not start with `MR_', `mercury_', or `entry_'.
+
+%.obj_check: %
+	nm -g $< | awk '$$1 != "U" { print $$3; }' | \
+		grep -v -e '^_entry' -e '^MR_' -e '^mercury_' | \
+		sort -u > $@
+	@if cmp -s /dev/null $@; then \
+		true; \
+	else \
+		echo "** Global symbols in user namespace:"; \
+		cat $@; \
+		echo "(You may need to add MR_ prefixes to these names.)"; \
+		exit 1; \
+	fi
+
+#-----------------------------------------------------------------------------#
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
cvs diff: Diffing bytecode
cvs diff: Diffing compiler
cvs diff: Diffing compiler/notes
cvs diff: Diffing debian
cvs diff: Diffing doc
cvs diff: Diffing extras
cvs diff: Diffing extras/aditi
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/concurrency
cvs diff: Diffing extras/curses
cvs diff: Diffing extras/curses/sample
cvs diff: Diffing extras/dynamic_linking
cvs diff: Diffing extras/graphics
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/lazy_evaluation
cvs diff: Diffing extras/logged_output
cvs diff: Diffing extras/moose
cvs diff: Diffing extras/moose/samples
cvs diff: Diffing extras/morphine
cvs diff: Diffing extras/morphine/non-regression-tests
cvs diff: Diffing extras/morphine/scripts
cvs diff: Diffing extras/morphine/source
cvs diff: Diffing extras/odbc
cvs diff: Diffing extras/posix
cvs diff: Diffing extras/references
cvs diff: Diffing extras/references/samples
cvs diff: Diffing extras/references/tests
cvs diff: Diffing extras/stream
cvs diff: Diffing extras/trailed_update
cvs diff: Diffing extras/trailed_update/samples
cvs diff: Diffing extras/trailed_update/tests
cvs diff: Diffing extras/xml
cvs diff: Diffing extras/xml/samples
cvs diff: Diffing library
cvs diff: Diffing profiler
cvs diff: Diffing robdd
cvs diff: Diffing runtime
Index: runtime/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/Mmakefile,v
retrieving revision 1.65
diff -u -b -r1.65 Mmakefile
--- runtime/Mmakefile	2001/01/01 04:04:01	1.65
+++ runtime/Mmakefile	2001/01/08 15:17:26
@@ -320,27 +320,6 @@
 .PHONY: check_headers
 check_headers: check_headers_self_contained check_headers_macros
 
-#
-# $(OBJ_CHECKS) is used to check that the objects are properly
-# namespace-clean, with regard to the global symbols that they define.
-# For each object file foo.o, the rule below produces a file
-# foo.o.obj_check that contains a list of all the globals defined
-# by that object that do not start with `MR_', `mercury_', or `entry_'.
-# 
-
-%.obj_check: %
-	nm -g $< | awk '$$1 != "U" { print $$3; }' | \
-		grep -v -e '^_entry' -e '^MR_' -e '^mercury_' | \
-		sort -u > $@
-	@if cmp -s /dev/null $@; then \
-		true; \
-	else \
-		echo "** Global symbols in user namespace:"; \
-		cat $@; \
-		echo "(You may need to add MR_ prefixes to these names.)"; \
-		exit 1; \
-	fi
-
 .PHONY: check_objs
 check_objs: $(OBJ_CHECKS)
 
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 samples/muz
cvs diff: Diffing samples/rot13
cvs diff: Diffing samples/solutions
cvs diff: Diffing samples/tests
cvs diff: Diffing samples/tests/c_interface
cvs diff: Diffing samples/tests/c_interface/c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/tests/c_interface/mercury_calls_c
cvs diff: Diffing samples/tests/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/tests/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/tests/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/tests/diff
cvs diff: Diffing samples/tests/muz
cvs diff: Diffing samples/tests/rot13
cvs diff: Diffing samples/tests/solutions
cvs diff: Diffing samples/tests/toplevel
cvs diff: Diffing scripts
cvs diff: Diffing tests
cvs diff: Diffing tests/benchmarks
cvs diff: Diffing tests/debugger
cvs diff: Diffing tests/debugger/declarative
cvs diff: Diffing tests/dppd
cvs diff: Diffing tests/general
cvs diff: Diffing tests/general/accumulator
cvs diff: Diffing tests/hard_coded
cvs diff: Diffing tests/hard_coded/exceptions
cvs diff: Diffing tests/hard_coded/purity
cvs diff: Diffing tests/hard_coded/sub-modules
cvs diff: Diffing tests/hard_coded/typeclasses
cvs diff: Diffing tests/invalid
cvs diff: Diffing tests/invalid/purity
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
cvs diff: Diffing trace
Index: trace/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/trace/Mmakefile,v
retrieving revision 1.18
diff -u -b -r1.18 Mmakefile
--- trace/Mmakefile	2000/08/17 05:31:11	1.18
+++ trace/Mmakefile	2001/01/08 15:14:58
@@ -75,6 +75,7 @@
 
 OBJS		= $(CFILES:.c=.$O)
 PIC_OBJS	= $(CFILES:.c=.$(EXT_FOR_PIC_OBJECTS))
+OBJ_CHECKS	= $(OBJS:%=%.obj_check)
 
 LDFLAGS		= -L$(BROWSER_DIR) -L$(LIBRARY_DIR) \
 			-L$(RUNTIME_DIR) -L$(BOEHM_GC_DIR)
@@ -151,6 +152,9 @@
 		$(MGNUC) $(MGNUCFLAGS) -c tmp.c || exit 1; \
 	done
 	rm -f tmp.c
+
+.PHONY: check_objs
+check_objs: $(OBJ_CHECKS)
 
 #-----------------------------------------------------------------------------#
 
cvs diff: Diffing trial
cvs diff: Diffing util
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list