[m-rev.] For review: Fix 'tags' make target in compiler directory.

Paul Bone pbone at csse.unimelb.edu.au
Fri Sep 12 17:31:51 AEST 2008


For review by anyone:

Estimated hours taken: 0.1
Branches: main

The 'tags' target in the compiler directory often does nothing when it should
rebuild the tags file.  This occurs because mmake uses VPATH to find
../library/tags which is up to date and decides not to build the tags target.

This solution is also used in the deep_profiler directory.

compiler/Mmakefile:
    As above.

Index: compiler/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/Mmakefile,v
retrieving revision 1.99
diff -u -p -r1.99 Mmakefile
--- compiler/Mmakefile	22 Feb 2008 07:27:56 -0000	1.99
+++ compiler/Mmakefile	11 Sep 2008 22:32:00 -0000
@@ -269,13 +269,23 @@ ints:	$(MC_PROG).ints
 
 #-----------------------------------------------------------------------------#
 
-tags:	$(PREPROCESSED_M_FILES) *.m $(LIBRARY_DIR)/*.m $(MDBCOMP_DIR)/*.m
+# We need the shenanigans with .deep_tags to avoid situations in which an
+# "mmake tags" in this directory does nothing even in the absence of a tags
+# file in this directory, because mmake uses VPATH to find ../library/tags
+# and believes it to be the tags file we are asking for.
+
+.PHONY: tags
+tags:	.compiler_tags
+
+.compiler_tags:	$(PREPROCESSED_M_FILES) *.m $(LIBRARY_DIR)/*.m $(MDBCOMP_DIR)/*.m
 	$(MTAGS) $(MTAGSFLAGS) *.m $(LIBRARY_DIR)/*.m $(MDBCOMP_DIR)/*.m
+	touch .compiler_tags
 
 .PHONY: tags_file_exists
 tags_file_exists:
 	@if test ! -f tags; then echo making tags ; \
 	$(MTAGS) $(MTAGSFLAGS) *.m $(LIBRARY_DIR)/*.m $(MDBCOMP_DIR)/*.m ; fi
+	touch .compiler_tags
 
 $(MC_PROG).stats: source_stats.awk $($(MC_PROG).ms)
 	awk -f `vpath_find source_stats.awk` \

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mercurylang.org/archives/reviews/attachments/20080912/25e65979/attachment.sig>


More information about the reviews mailing list