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

Re: [PATCH v2 4/5] Makefile: don't use "FORCE" for tags targets

From
Ramsay Jones <ramsay@ramsayjones.plus.com>
Date
Jun 30, 2021, 00:05 UTC
Message-ID
<67c45b13-df8f-8065-377a-fbd2f80992ee@ramsayjones.plus.com>
In-Reply-To
<patch-4.5-b924cc3f56-20210629T110837Z-avarab@gmail.com>
On 29/06/2021 12:12, Ævar Arnfjörð Bjarmason wrote:
Show 30 quoted lines
> Remove the "FORCE" dependency from the "tags", "TAGS" and "cscope.out"
> targets, instead make them depend on whether or not the relevant
> source files have changed.
> 
> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
> ---
>  Makefile | 12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 2e3b257164..7b0d9773b0 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -2727,19 +2727,21 @@ FIND_SOURCE_FILES = ( \
>  		| sed -e 's|^\./||' \
>  	)
>  
> -$(ETAGS_TARGET): FORCE
> +FOUND_SOURCE_FILES = $(shell $(FIND_SOURCE_FILES))
> +
> +$(ETAGS_TARGET): $(FOUND_SOURCE_FILES)
>  	$(QUIET_GEN)$(RM) "$(ETAGS_TARGET)+" && \
>  	$(FIND_SOURCE_FILES) | xargs etags -a -o "$(ETAGS_TARGET)+" && \
>  	mv "$(ETAGS_TARGET)+" "$(ETAGS_TARGET)"
>  
> -tags: FORCE
> +tags: $(FOUND_SOURCE_FILES)
>  	$(QUIET_GEN)$(RM) tags+ && \
>  	$(FIND_SOURCE_FILES) | xargs ctags -a -o tags+ && \
>  	mv tags+ tags
I was expecting to see the above targets to be changed, similarly to ...
Show 6 quoted lines
>  
> -cscope.out:
> +cscope.out: $(FOUND_SOURCE_FILES)
>  	$(QUIET_GEN)$(RM) cscope.out && \
> -	$(FIND_SOURCE_FILES) | xargs cscope -f$@ -b
> +	echo $(FOUND_SOURCE_FILES) | xargs cscope -f$@ -b

... this hunk (ie. 'an "echo <list> | xargs" pattern') Indeed, the above phrase was taken from the commit message of the next patch (5/5), which implies that this change had already happened (presumably in this patch).

ATB, Ramsay Jones

Show 13 quoted lines
>  
>  .PHONY: cscope
>  cscope: cscope.out
> @@ -2923,7 +2925,7 @@ check: config-list.h command-list.h
>  		exit 1; \
>  	fi
>  
> -FOUND_C_SOURCES = $(filter %.c,$(shell $(FIND_SOURCE_FILES)))
> +FOUND_C_SOURCES = $(filter %.c,$(FOUND_SOURCE_FILES))
>  COCCI_SOURCES = $(filter-out $(THIRD_PARTY_SOURCES),$(FOUND_C_SOURCES))
>  
>  %.cocci.patch: %.cocci $(COCCI_SOURCES)
> 
Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 22 of 45 in “Makefile: "make tags" fixes & cleanup”
  1. 0/3 Makefile: "make tags" fixes & cleanupÆvar Arnfjörð Bjarmason, Jun 22, 2021
  2. 1/3 Makefile: move ".PHONY: cscope" near its targetÆvar Arnfjörð Bjarmason, Jun 22, 2021
  3. 2/3 Makefile: fix "cscope" target to refer to cscope.outÆvar Arnfjörð Bjarmason, Jun 22, 2021
  4. Jeff KingJun 22, 2021
  5. Chris TorekJun 22, 2021
  6. Felipe ContrerasJun 23, 2021
  7. Felipe ContrerasJun 23, 2021
  8. Felipe ContrerasJun 23, 2021
  9. 3/3 Makefile: don't use "FORCE" for tags targetsÆvar Arnfjörð Bjarmason, Jun 22, 2021
  10. Jeff KingJun 22, 2021
  11. Felipe ContrerasJun 23, 2021
  12. Taylor BlauJun 22, 2021
  13. Junio C HamanoJun 29, 2021
  14. Ævar Arnfjörð BjarmasonJun 29, 2021
  15. 0/5 Makefile: "make tags" fixes & cleanupÆvar Arnfjörð Bjarmason, Jun 29, 2021
  16. 1/5 Makefile: move ".PHONY: cscope" near its targetÆvar Arnfjörð Bjarmason, Jun 29, 2021
  17. 2/5 Makefile: add QUIET_GEN to "cscope" targetÆvar Arnfjörð Bjarmason, Jun 29, 2021
  18. 3/5 Makefile: fix "cscope" target to refer to cscope.outÆvar Arnfjörð Bjarmason, Jun 29, 2021
  19. Jeff KingJul 1, 2021
  20. Jeff KingJul 1, 2021
  21. 4/5 Makefile: don't use "FORCE" for tags targetsÆvar Arnfjörð Bjarmason, Jun 29, 2021
  22. Ramsay JonesJun 30, 2021
  23. 5/5 Makefile: normalize clobbering & xargs for tags targetsÆvar Arnfjörð Bjarmason, Jun 29, 2021
  24. 0/5 Makefile: "make tags" fixes & cleanupÆvar Arnfjörð Bjarmason, Jul 21, 2021
  25. 1/5 Makefile: move ".PHONY: cscope" near its targetÆvar Arnfjörð Bjarmason, Jul 21, 2021
  26. 2/5 Makefile: add QUIET_GEN to "cscope" targetÆvar Arnfjörð Bjarmason, Jul 21, 2021
  27. 3/5 Makefile: don't use "FORCE" for tags targetsÆvar Arnfjörð Bjarmason, Jul 21, 2021
  28. 4/5 Makefile: the "cscope" target always creates a "cscope.out"Ævar Arnfjörð Bjarmason, Jul 21, 2021
  29. Junio C HamanoJul 22, 2021
  30. Taylor BlauJul 22, 2021
  31. Junio C HamanoJul 22, 2021
  32. Ævar Arnfjörð BjarmasonJul 22, 2021
  33. 5/5 Makefile: normalize clobbering & xargs for tags targetsÆvar Arnfjörð Bjarmason, Jul 21, 2021
  34. Jeff KingJul 23, 2021
  35. Jeff KingJul 23, 2021
  36. Jeff KingJul 23, 2021
  37. Junio C HamanoJul 23, 2021
  38. Felipe ContrerasJul 23, 2021
  39. Felipe ContrerasJul 23, 2021
  40. 0/5 Makefile: "make tags" fixes & cleanupÆvar Arnfjörð Bjarmason, Aug 4, 2021
  41. 1/5 Makefile: move ".PHONY: cscope" near its targetÆvar Arnfjörð Bjarmason, Aug 4, 2021
  42. 2/5 Makefile: add QUIET_GEN to "cscope" targetÆvar Arnfjörð Bjarmason, Aug 4, 2021
  43. 3/5 Makefile: don't use "FORCE" for tags targetsÆvar Arnfjörð Bjarmason, Aug 4, 2021
  44. 4/5 Makefile: remove "cscope.out", not "cscope*" in cscope.out targetÆvar Arnfjörð Bjarmason, Aug 4, 2021
  45. 5/5 Makefile: normalize clobbering & xargs for tags targetsÆvar Arnfjörð Bjarmason, Aug 4, 2021

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.