git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC/PATCH] Avoid TAGS/tags warning from GNU Make

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Sep 4, 2010, 16:34 UTC
Message-ID
<20100904163407.GA31513@burratino>
In-Reply-To
<7v8w3hxz81.fsf@alter.siamese.dyndns.org>
Junio C Hamano wrote:
Show 6 quoted lines
> +++ b/Makefile
> @@ -390,6 +390,8 @@ SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH)) \
>  	  $(patsubst %.py,%,$(SCRIPT_PYTHON)) \
>  	  git-instaweb
>  
> +ETAGS_TARGET = TAGS
[...]
Show 10 quoted lines
> @@ -1954,9 +1957,9 @@ info:
>  pdf:
>  	$(MAKE) -C Documentation pdf
>  
> -TAGS:
> -	$(RM) TAGS
> -	$(FIND) . -name '*.[hcS]' -print | xargs etags -a
> +$(ETAGS_TARGET):
> +	$(RM) $(ETAGS_TARGET)
> +	$(FIND) . -name '*.[hcS]' -print | xargs etags -a -o $(ETAGS_TARGET)
Nice.
Show 6 quoted lines
> @@ -2252,7 +2255,7 @@ endif
>  
>  .PHONY: all install clean strip
>  .PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell
> -.PHONY: FORCE TAGS tags cscope
> +.PHONY: FORCE cscope
make: `tags' is up to date.
How about something like this squashed in or on top?
-- 8< --
Subject: Makefile: regenerate editor tag files when asked

tags and TAGS depend on all source files, but it is easier to teach the Makefile to regenerate them every time the user asks than to declare that.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 Makefile |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 52252d4..205fe58 100644
--- a/Makefile
+++ b/Makefile
@@ -1955,11 +1955,11 @@ info:
 pdf:
 	$(MAKE) -C Documentation pdf
 
-$(ETAGS_TARGET):
+$(ETAGS_TARGET): FORCE
 	$(RM) $(ETAGS_TARGET)
 	$(FIND) . -name '*.[hcS]' -print | xargs etags -a -o $(ETAGS_TARGET)
 
-tags:
+tags: FORCE
 	$(RM) tags
 	$(FIND) . -name '*.[hcS]' -print | xargs ctags -a
 
-- 
1.7.2.3
Previous: Junio C Hamano
Message 4 of 4 in “Avoid TAGS/tags warning from GNU Make”
  1. Avoid TAGS/tags warning from GNU MakeJonathan Nieder, Sep 4, 2010
  2. Matthieu MoySep 4, 2010
  3. Junio C HamanoSep 4, 2010
  4. Jonathan NiederSep 4, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.