[m-rev.] for post-commit review: fix "mmake tags"
Zoltan Somogyi
zs at csse.unimelb.edu.au
Tue Sep 22 14:36:32 AEST 2009
compiler/Mmakefile:
Fix an old bug. The action for the target "tags_file_exists", which is
implicitly remade whenever we rebuild the compiler, used to always
touch .compiler_tags. This led the "tags" target to believe that
the tags file (whose logical timestamp .compiler_tags represents)
is at least as new as all the .m files, causing it to not actually
remake the tags file, even when it should have.
We now touch .compiler_tags only when rebuilding the tags file.
*/Mmakefile:
Make the actions for tags follow the scheme in compiler/Mmakefile
where needed.
Zoltan.
Index: browser/Mmakefile
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/browser/Mmakefile,v
retrieving revision 1.56
diff -u -b -r1.56 Mmakefile
--- browser/Mmakefile 14 Sep 2009 05:58:22 -0000 1.56
+++ browser/Mmakefile 21 Sep 2009 06:18:52 -0000
@@ -194,13 +194,20 @@
#-----------------------------------------------------------------------------#
-tags: $(MTAGS) $($(BROWSER_LIB_NAME).ms)
+tags: .browser_tags
+
+.browser_tags: $(MTAGS) $($(BROWSER_LIB_NAME).ms) \
+ $(wildcard $(LIBRARY_DIR)/*.m) \
+ $(wildcard $(MDBCOMP_DIR)/*.m)
$(MTAGS) $($(BROWSER_LIB_NAME).ms) ../mdbcomp/*.m ../library/*.m
+ @touch .browser_tags
.PHONY: tags_file_exists
tags_file_exists:
@if test ! -f tags; then echo making tags; \
- $(MTAGS) $($(BROWSER_LIB_NAME).ms) ../mdbcomp/*.m ../library/*.m ; fi
+ $(MTAGS) $($(BROWSER_LIB_NAME).ms) ../mdbcomp/*.m ../library/*.m; \
+ touch .browser_tags; \
+ fi
$(BROWSER_LIB_NAME).stats: $(COMPILER_DIR)/source_stats.awk \
$($(BROWSER_LIB_NAME).ms)
Index: compiler/Mmakefile
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/Mmakefile,v
retrieving revision 1.105
diff -u -b -r1.105 Mmakefile
--- compiler/Mmakefile 17 Aug 2009 10:19:10 -0000 1.105
+++ compiler/Mmakefile 21 Sep 2009 06:22:04 -0000
@@ -281,18 +281,19 @@
.PHONY: tags
tags: .compiler_tags
-.compiler_tags: $(PREPROCESSED_M_FILES) \
+.compiler_tags: $(MTAGS) $(PREPROCESSED_M_FILES) \
$(wildcard *.m) \
$(wildcard $(LIBRARY_DIR)/*.m) \
$(wildcard $(MDBCOMP_DIR)/*.m)
$(MTAGS) $(MTAGSFLAGS) *.m $(LIBRARY_DIR)/*.m $(MDBCOMP_DIR)/*.m
- touch .compiler_tags
+ @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
+ @if test ! -f tags; then echo making tags; \
+ $(MTAGS) $(MTAGSFLAGS) *.m $(LIBRARY_DIR)/*.m $(MDBCOMP_DIR)/*.m; \
+ touch .compiler_tags; \
+ fi
$(MC_PROG).stats: source_stats.awk $($(MC_PROG).ms)
awk -f `vpath_find source_stats.awk` \
Index: deep_profiler/Mmakefile
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/deep_profiler/Mmakefile,v
retrieving revision 1.32
diff -u -b -r1.32 Mmakefile
--- deep_profiler/Mmakefile 17 Aug 2009 10:19:26 -0000 1.32
+++ deep_profiler/Mmakefile 21 Sep 2009 06:19:46 -0000
@@ -153,13 +153,14 @@
$(wildcard $(MDBCOMP_DIR)/*.m) \
$(wildcard $(LIBRARY_DIR)/*.m)
$(MTAGS) $(DEEP_MS) $(MDBCOMP_DIR)/*.m $(LIBRARY_DIR)/*.m
- touch .deep_tags
+ @touch .deep_tags
.PHONY: tags_file_exists
tags_file_exists:
@if test ! -f tags; then echo making tags; \
$(MTAGS) $(DEEP_MS) $(MDBCOMP_DIR)/*.m $(LIBRARY_DIR)/*.m; \
- touch .deep_tags; fi
+ touch .deep_tags; \
+ fi
#-----------------------------------------------------------------------------#
Index: library/Mmakefile
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/library/Mmakefile,v
retrieving revision 1.166
diff -u -b -r1.166 Mmakefile
--- library/Mmakefile 15 Sep 2009 04:43:37 -0000 1.166
+++ library/Mmakefile 21 Sep 2009 06:20:07 -0000
@@ -204,8 +204,9 @@
.PHONY: tags_file_exists
tags_file_exists:
- @if test ! -f tags; then echo making tags ; \
- $(MTAGS) $($(STD_LIB_NAME).ms) ; fi
+ @if test ! -f tags; then echo making tags; \
+ $(MTAGS) $($(STD_LIB_NAME).ms); \
+ fi
$(STD_LIB_NAME).stats: $(COMPILER_DIR)/source_stats.awk $($(STD_LIB_NAME).ms)
awk -f $(COMPILER_DIR)/source_stats.awk \
Index: mdbcomp/Mmakefile
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/mdbcomp/Mmakefile,v
retrieving revision 1.14
diff -u -b -r1.14 Mmakefile
--- mdbcomp/Mmakefile 14 Sep 2009 05:58:22 -0000 1.14
+++ mdbcomp/Mmakefile 21 Sep 2009 06:20:39 -0000
@@ -158,13 +158,19 @@
#-----------------------------------------------------------------------------#
-tags: $(MTAGS) $($(MDBCOMP_LIB_NAME).ms)
+tags: .mdbcomp_tags
+
+.mdbcomp_tags: $(MTAGS) $($(MDBCOMP_LIB_NAME).ms) \
+ $(wildcard $(LIBRARY_DIR)/*.m)
$(MTAGS) $($(MDBCOMP_LIB_NAME).ms) ../library/*.m
+ @touch .mdbcomp_tags
.PHONY: tags_file_exists
tags_file_exists:
@if test ! -f tags; then echo making tags; \
- $(MTAGS) $($(MDBCOMP_LIB_NAME).ms) ../library/*.m ; fi
+ $(MTAGS) $($(MDBCOMP_LIB_NAME).ms) ../library/*.m ; \
+ touch .mdbcomp_tags ; \
+ fi
$(MDBCOMP_LIB_NAME).stats: $(COMPILER_DIR)/source_stats.awk \
$($(MDBCOMP_LIB_NAME).ms)
Index: profiler/Mmakefile
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/profiler/Mmakefile,v
retrieving revision 1.33
diff -u -b -r1.33 Mmakefile
--- profiler/Mmakefile 22 Jun 2009 02:58:56 -0000 1.33
+++ profiler/Mmakefile 21 Sep 2009 06:21:03 -0000
@@ -58,13 +58,18 @@
#-----------------------------------------------------------------------------#
-tags: $(MTAGS) $(mercury_profile.ms) $(LIBRARY_DIR)/*.m
+tags: .profiler_tags
+
+.profiler_tags: $(MTAGS) $(mercury_profile.ms) $(wildcard $(LIBRARY_DIR)/*.m)
$(MTAGS) $(mercury_profile.ms) $(LIBRARY_DIR)/*.m
+ @touch .profiler_tags
.PHONY: tags_file_exists
tags_file_exists:
@if test ! -f tags; then echo making tags; \
- $(MTAGS) $(mercury_profile.ms) $(LIBRARY_DIR)/*.m ; fi
+ $(MTAGS) $(mercury_profile.ms) $(LIBRARY_DIR)/*.m ; \
+ touch .profiler_tags ; \
+ fi
#-----------------------------------------------------------------------------#
Index: slice/Mmakefile
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/slice/Mmakefile,v
retrieving revision 1.19
diff -u -b -r1.19 Mmakefile
--- slice/Mmakefile 17 Aug 2009 10:19:39 -0000 1.19
+++ slice/Mmakefile 21 Sep 2009 06:21:19 -0000
@@ -127,16 +127,20 @@
#-----------------------------------------------------------------------------#
-tags: $(MTAGS) $(mslice.ms) $(mdice.ms) $(mtc_union.ms) $(mcov.ms) \
+tags: .slice_tags
+
+.slice_tags: $(MTAGS) $(mslice.ms) $(mdice.ms) $(mtc_union.ms) $(mcov.ms) \
$(mtc_diff.ms) $(wildcard $(LIBRARY_DIR)/*.m)
$(MTAGS) $(mslice.ms) $(mdice.ms) $(mtc_union.ms) $(mcov.ms) \
$(mtc_diff.ms) $(LIBRARY_DIR)/*.m
+ @touch .slice_tags
.PHONY: tags_file_exists
tags_file_exists:
@if test ! -f tags; then echo making tags; \
$(MTAGS) $(mslice.ms) $(mdice.ms) $(mtc_union.ms) \
$(mcov.ms) $(mtc_union.ms) $(LIBRARY_DIR)/*.m; \
+ touch .slice_tags; \
fi
#-----------------------------------------------------------------------------#
Index: ssdb/Mmakefile
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/ssdb/Mmakefile,v
retrieving revision 1.5
diff -u -b -r1.5 Mmakefile
--- ssdb/Mmakefile 14 Sep 2009 05:58:23 -0000 1.5
+++ ssdb/Mmakefile 21 Sep 2009 06:21:55 -0000
@@ -193,13 +193,19 @@
#-----------------------------------------------------------------------------#
-tags: $(MTAGS) $($(SSDB_LIB_NAME).ms)
+tags: .ssdb_tags
+
+.ssdb_tags: $(MTAGS) $($(SSDB_LIB_NAME).ms) \
+ $(wildcard $(MDBCOMP_DIR)/*.m) $(wildcard $(LIBRARY_DIR)/*.m)
$(MTAGS) $($(SSDB_LIB_NAME).ms) ../mdbcomp/*.m ../library/*.m
+ @touch .ssdb_tags
.PHONY: tags_file_exists
tags_file_exists:
@if test ! -f tags; then echo making tags; \
- $(MTAGS) $($(SSDB_LIB_NAME).ms) ../mdbcomp/*.m ../library/*.m ; fi
+ $(MTAGS) $($(SSDB_LIB_NAME).ms) ../mdbcomp/*.m ../library/*.m; \
+ touch .ssdb_tags; \
+ fi
$(SSDB_LIB_NAME).stats: $(COMPILER_DIR)/source_stats.awk \
$($(SSDB_LIB_NAME).ms)
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to: mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions: mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------
More information about the reviews
mailing list