[m-rev.] For review: Fix 'tags' make target in compiler directory.
Julien Fischer
juliensf at csse.unimelb.edu.au
Thu Sep 18 23:06:04 AEST 2008
On Fri, 12 Sep 2008, Paul Bone wrote:
>
> 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
The "shenanigans" are with .compiler_tags here, not .deep_tags.
> +# "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` \
>
That's fine otherwise.
Julien.
--------------------------------------------------------------------------
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