{"thread":{"id":"55987","subject":"[PATCH 0/3] Makefile: \"make tags\" fixes & cleanup","startedAt":"2021-06-22T14:21:32Z","lastAt":"2021-08-04T22:54:53Z","messageCount":45,"participants":["Ævar Arnfjörð Bjarmason","Taylor Blau","Jeff King","Chris Torek","Felipe Contreras","Junio C Hamano","Ramsay Jones"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"428195","messageId":"cover-0.3-00000000000-20210622T141844Z-avarab@gmail.com","threadId":"55987","inReplyTo":null,"subject":"[PATCH 0/3] Makefile: \"make tags\" fixes & cleanup","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-06-22T14:21:24Z","receivedAt":"2021-06-22T14:21:32Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"A small series to fix the various \"tags\" targets, i.e. \"make tags TAGS\ncscope\". We'll now properly detect their dependencies, so we don't\nneedlessly run them every time. I have this as part of my standard\n\"make git\" command, so doing nothing when we have nothing to do is\npreferrable, especially when my editor will eagerly reload the TAGS\nfile every time it changes.\n\nAs noted in 3/3 this is better on top of my just-submitted\n.DELETE_ON_ERROR change[1], but will also work independently of that\npatch/series.\n\n1. https://lore.kernel.org/git/patch-1.1-9420448e74f-20210622T141100Z-avarab@gmail.com/\n\nÆvar Arnfjörð Bjarmason (3):\n  Makefile: move \".PHONY: cscope\" near its target\n  Makefile: fix \"cscope\" target to refer to cscope.out\n  Makefile: don't use \"FORCE\" for tags targets\n\n .gitignore |  2 +-\n Makefile   | 31 +++++++++++++++++--------------\n 2 files changed, 18 insertions(+), 15 deletions(-)\n\n-- \n2.32.0.599.g3967b4fa4ac\n\n"},{"id":"428196","messageId":"patch-1.3-383a90c8ace-20210622T141844Z-avarab@gmail.com","threadId":"55987","inReplyTo":"cover-0.3-00000000000-20210622T141844Z-avarab@gmail.com","subject":"[PATCH 1/3] Makefile: move \".PHONY: cscope\" near its target","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-06-22T14:21:25Z","receivedAt":"2021-06-22T14:21:35Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Move the \".PHONY: cscope\" rule to live alongside the \"cscope\" target\nitself, not to be all the way near the bottom where we define the\n\"FORCE\" rule.\n\nThat line was last modified in 2f76919517e (MinGW: avoid collisions\nbetween \"tags\" and \"TAGS\", 2010-09-28).\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n Makefile | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/Makefile b/Makefile\nindex c3565fc0f8f..4dd9711a653 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2737,6 +2737,7 @@ tags: FORCE\n \t$(FIND_SOURCE_FILES) | xargs ctags -a -o tags+ && \\\n \tmv tags+ tags\n \n+.PHONY: cscope\n cscope:\n \t$(RM) cscope*\n \t$(FIND_SOURCE_FILES) | xargs cscope -b\n@@ -3245,7 +3246,7 @@ endif\n \n .PHONY: all install profile-clean cocciclean clean strip\n .PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell\n-.PHONY: FORCE cscope\n+.PHONY: FORCE\n \n ### Check documentation\n #\n-- \n2.32.0.599.g3967b4fa4ac\n\n"},{"id":"428197","messageId":"patch-2.3-ea39f1f5cd2-20210622T141844Z-avarab@gmail.com","threadId":"55987","inReplyTo":"cover-0.3-00000000000-20210622T141844Z-avarab@gmail.com","subject":"[PATCH 2/3] Makefile: fix \"cscope\" target to refer to cscope.out","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-06-22T14:21:26Z","receivedAt":"2021-06-22T14:21:36Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"The cscope target added in a2a9150bf06 (makefile: Add a cscope target,\n2007-10-06) has for some reason been referring to cscope* instead of\ncscope.out. Let's generate the cscope.out file directly so we don't\nneed to speculate.\n\nThe \"-fcscope.out\" (note, no whitespace) argument is enabled by\ndefault on my system's cscope 15.9, but let's provide it explicitly\nfor good measure.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n .gitignore | 2 +-\n Makefile   | 9 +++++----\n 2 files changed, 6 insertions(+), 5 deletions(-)\n\ndiff --git a/.gitignore b/.gitignore\nindex 311841f9bed..d74029c1ca7 100644\n--- a/.gitignore\n+++ b/.gitignore\n@@ -217,7 +217,7 @@\n /.vscode/\n /tags\n /TAGS\n-/cscope*\n+/cscope.out\n /compile_commands.json\n *.hcc\n *.obj\ndiff --git a/Makefile b/Makefile\nindex 4dd9711a653..25d2a3e5ddc 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2737,10 +2737,11 @@ tags: FORCE\n \t$(FIND_SOURCE_FILES) | xargs ctags -a -o tags+ && \\\n \tmv tags+ tags\n \n+cscope.out:\n+\t$(FIND_SOURCE_FILES) | xargs cscope -f$@ -b\n+\n .PHONY: cscope\n-cscope:\n-\t$(RM) cscope*\n-\t$(FIND_SOURCE_FILES) | xargs cscope -b\n+cscope: cscope.out\n \n ### Detect prefix changes\n TRACK_PREFIX = $(bindir_SQ):$(gitexecdir_SQ):$(template_dir_SQ):$(prefix_SQ):\\\n@@ -3211,7 +3212,7 @@ clean: profile-clean coverage-clean cocciclean\n \t$(RM) $(HCC)\n \t$(RM) -r bin-wrappers $(dep_dirs) $(compdb_dir) compile_commands.json\n \t$(RM) -r po/build/\n-\t$(RM) *.pyc *.pyo */*.pyc */*.pyo $(GENERATED_H) $(ETAGS_TARGET) tags cscope*\n+\t$(RM) *.pyc *.pyo */*.pyc */*.pyo $(GENERATED_H) $(ETAGS_TARGET) tags cscope.out\n \t$(RM) -r .dist-tmp-dir .doc-tmp-dir\n \t$(RM) $(GIT_TARNAME).tar.gz\n \t$(RM) $(htmldocs).tar.gz $(manpages).tar.gz\n-- \n2.32.0.599.g3967b4fa4ac\n\n"},{"id":"428198","messageId":"patch-3.3-67fc87665d6-20210622T141844Z-avarab@gmail.com","threadId":"55987","inReplyTo":"cover-0.3-00000000000-20210622T141844Z-avarab@gmail.com","subject":"[PATCH 3/3] Makefile: don't use \"FORCE\" for tags targets","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-06-22T14:21:27Z","receivedAt":"2021-06-22T14:21:37Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Remove the \"FORCE\" dependency from the \"tags\", \"TAGS\" and \"cscope.out\"\ntargets, instead make them depend on whether or not the relevant\nsource files have changed.\n\nI'm also removing the \"-o\" option from them, that seems to have been\ncargo-culted when they were initially added in f81e7c626f3 (Makefile:\nAdd TAGS and tags targets, 2006-03-18). It would make sense to use\nthat option if we had been appending to tag files, it doesn't make any\nsense that it was used after we'd just removed the files file being\nappended to.\n\nThis will potentially cause a partial file to be left behind if the\ncommand dies, but my in-flight series to use the \".DELETE_ON_ERROR\"\nflag in the Makefile[1] will make that problem go away. I think even\nwithout that it's not problem we need to worry about in these cases.\n\n1. https://lore.kernel.org/git/patch-1.1-9420448e74f-20210622T141100Z-avarab@gmail.com/\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n Makefile | 21 +++++++++++----------\n 1 file changed, 11 insertions(+), 10 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 25d2a3e5ddc..89d261230fb 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2727,18 +2727,19 @@ FIND_SOURCE_FILES = ( \\\n \t\t| sed -e 's|^\\./||' \\\n \t)\n \n-$(ETAGS_TARGET): FORCE\n-\t$(QUIET_GEN)$(RM) \"$(ETAGS_TARGET)+\" && \\\n-\t$(FIND_SOURCE_FILES) | xargs etags -a -o \"$(ETAGS_TARGET)+\" && \\\n-\tmv \"$(ETAGS_TARGET)+\" \"$(ETAGS_TARGET)\"\n+FOUND_SOURCE_FILES = $(shell $(FIND_SOURCE_FILES))\n \n-tags: FORCE\n-\t$(QUIET_GEN)$(RM) tags+ && \\\n-\t$(FIND_SOURCE_FILES) | xargs ctags -a -o tags+ && \\\n-\tmv tags+ tags\n+$(ETAGS_TARGET): $(FOUND_SOURCE_FILES)\n+\t$(QUIET_GEN)echo $(FOUND_SOURCE_FILES) | \\\n+\txargs etags -o $@\n+\n+tags: $(FOUND_SOURCE_FILES)\n+\t$(QUIET_GEN)echo $(FOUND_SOURCE_FILES) | \\\n+\txargs ctags -o $@\n \n cscope.out:\n-\t$(FIND_SOURCE_FILES) | xargs cscope -f$@ -b\n+\t$(QUIET_GEN)echo $(FOUND_SOURCE_FILES) | \\\n+\txargs cscope -f$@ -b\n \n .PHONY: cscope\n cscope: cscope.out\n@@ -2922,7 +2923,7 @@ check: config-list.h command-list.h\n \t\texit 1; \\\n \tfi\n \n-FOUND_C_SOURCES = $(filter %.c,$(shell $(FIND_SOURCE_FILES)))\n+FOUND_C_SOURCES = $(filter %.c,$(FOUND_SOURCE_FILES))\n COCCI_SOURCES = $(filter-out $(THIRD_PARTY_SOURCES),$(FOUND_C_SOURCES))\n \n %.cocci.patch: %.cocci $(COCCI_SOURCES)\n-- \n2.32.0.599.g3967b4fa4ac\n\n"},{"id":"428200","messageId":"YNH+zsXDnRsT3uvZ@nand.local","threadId":"55987","inReplyTo":"cover-0.3-00000000000-20210622T141844Z-avarab@gmail.com","subject":"Re: [PATCH 0/3] Makefile: \"make tags\" fixes & cleanup","fromName":"Taylor Blau","fromEmail":"me@ttaylorr.com","sentAt":"2021-06-22T15:16:30Z","receivedAt":"2021-06-22T15:16:33Z","isPatch":true,"sender":{"key":"me@ttaylorr.com","avatar":"https://avatars.githubusercontent.com/u/301000140?v=4"},"body":"On Tue, Jun 22, 2021 at 04:21:24PM +0200, Ævar Arnfjörð Bjarmason wrote:\n> A small series to fix the various \"tags\" targets, i.e. \"make tags TAGS\n> cscope\". We'll now properly detect their dependencies, so we don't\n> needlessly run them every time. I have this as part of my standard\n> \"make git\" command, so doing nothing when we have nothing to do is\n> preferrable, especially when my editor will eagerly reload the TAGS\n> file every time it changes.\n\n:-). Very nice.\n\n> As noted in 3/3 this is better on top of my just-submitted\n> .DELETE_ON_ERROR change[1], but will also work independently of that\n> patch/series.\n\nI took a look at this and [1], and I agree that 3/3 is probably better\napplied after [1], since it doesn't leave any gap between the existing\nbehavior of \">$@+ && mv $@+ $@\" and \">$@\" with .DELETE_ON_ERROR.\n\nBut I don't feel strongly about the order in which the two are applied.\nYour 3/3 without [1] isn't wrong, it just leaves us the opportunity to\npermanently leave around a broken tags file permanently, whereas having\n[1] applied ahead of time means that the broken tags file is only\nvisible racily.\n\nI reviewed these patches carefully, and they look good to me. I'm\ndelighted that `make tags` is no longer PHONY.\n\n    Reviewed-by: Taylor Blau <me@ttaylorr.com>\n\nThanks,\nTaylor\n"},{"id":"428229","messageId":"YNI5KVGT2mLlTrnz@coredump.intra.peff.net","threadId":"55987","inReplyTo":"patch-2.3-ea39f1f5cd2-20210622T141844Z-avarab@gmail.com","subject":"Re: [PATCH 2/3] Makefile: fix \"cscope\" target to refer to cscope.out","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2021-06-22T19:25:29Z","receivedAt":"2021-06-22T19:25:32Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Jun 22, 2021 at 04:21:26PM +0200, Ævar Arnfjörð Bjarmason wrote:\n\n> The cscope target added in a2a9150bf06 (makefile: Add a cscope target,\n> 2007-10-06) has for some reason been referring to cscope* instead of\n> cscope.out. Let's generate the cscope.out file directly so we don't\n> need to speculate.\n> \n> The \"-fcscope.out\" (note, no whitespace) argument is enabled by\n> default on my system's cscope 15.9, but let's provide it explicitly\n> for good measure.\n\nI don't use cscope myself, but it can generate other files (e.g., with\n\"-q\"). It looks like we don't even allow people to set $(CSCOPE),\nthough, so that shouldn't ever happen.\n\n(I wonder if anybody even really uses cscope. I wanted to love it as a\nbetter form of ctags, but I have always found it so baroque and\ncomplicated that it ends up being a waste of my time to try it).\n\n> +cscope.out:\n> +\t$(FIND_SOURCE_FILES) | xargs cscope -f$@ -b\n> +\n>  .PHONY: cscope\n> -cscope:\n> -\t$(RM) cscope*\n> -\t$(FIND_SOURCE_FILES) | xargs cscope -b\n> +cscope: cscope.out\n\nThis drops the $(RM). Does cscope always overwrite the output file, or\ndoes it append? Just trying \"cscope -b foo.c; cscope -b bar.c\", it looks\nlike it overwrites. Which makes your patch correct, but that existing\n\"xargs\" is somewhat questionable (if it splits into two commands, the\nfirst half will get dropped).\n\n-Peff\n"},{"id":"428230","messageId":"YNI5xsHWqOd3kv1y@coredump.intra.peff.net","threadId":"55987","inReplyTo":"patch-3.3-67fc87665d6-20210622T141844Z-avarab@gmail.com","subject":"Re: [PATCH 3/3] Makefile: don't use \"FORCE\" for tags targets","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2021-06-22T19:28:06Z","receivedAt":"2021-06-22T19:28:10Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Jun 22, 2021 at 04:21:27PM +0200, Ævar Arnfjörð Bjarmason wrote:\n\n> Remove the \"FORCE\" dependency from the \"tags\", \"TAGS\" and \"cscope.out\"\n> targets, instead make them depend on whether or not the relevant\n> source files have changed.\n> \n> I'm also removing the \"-o\" option from them, that seems to have been\n> cargo-culted when they were initially added in f81e7c626f3 (Makefile:\n> Add TAGS and tags targets, 2006-03-18). It would make sense to use\n> that option if we had been appending to tag files, it doesn't make any\n> sense that it was used after we'd just removed the files file being\n> appended to.\n\nYou mean \"-a\" in this second paragraph, right?\n\nI think it would help if xargs splits the source file list across\nmultiple invocations of the command.\n\n-Peff\n"},{"id":"428232","messageId":"CAPx1Gve+Zf4PHMVjv3gCTaW_0Fh6W7xL+J4bnAU0FA8OV7SR2w@mail.gmail.com","threadId":"55987","inReplyTo":"YNI5KVGT2mLlTrnz@coredump.intra.peff.net","subject":"Re: [PATCH 2/3] Makefile: fix \"cscope\" target to refer to cscope.out","fromName":"Chris Torek","fromEmail":"chris.torek@gmail.com","sentAt":"2021-06-22T19:49:09Z","receivedAt":"2021-06-22T19:49:24Z","isPatch":true,"sender":{"key":"chris.torek@gmail.com","avatar":"https://avatars.githubusercontent.com/u/16826774?v=4"},"body":"On Tue, Jun 22, 2021 at 12:26 PM Jeff King <peff@peff.net> wrote:\n> (I wonder if anybody even really uses cscope. I wanted to love it as a\n> better form of ctags, but I have always found it so baroque and\n> complicated that it ends up being a waste of my time to try it).\n\nI use cscope all the time, from vim.  If you use vim, you'll probably want\ncscope_maps.vim.\n\n(Sadly, cscope is not very good at C++.)\n\nI think you're right about the xargs issue here.\n\nChris\n"},{"id":"428318","messageId":"60d38ac74a93d_4290208ae@natae.notmuch","threadId":"55987","inReplyTo":"patch-2.3-ea39f1f5cd2-20210622T141844Z-avarab@gmail.com","subject":"RE: [PATCH 2/3] Makefile: fix \"cscope\" target to refer to cscope.out","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2021-06-23T19:25:59Z","receivedAt":"2021-06-23T19:26:04Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Ævar Arnfjörð Bjarmason wrote:\n\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -2737,10 +2737,11 @@ tags: FORCE\n>  \t$(FIND_SOURCE_FILES) | xargs ctags -a -o tags+ && \\\n>  \tmv tags+ tags\n>  \n> +cscope.out:\n> +\t$(FIND_SOURCE_FILES) | xargs cscope -f$@ -b\n> +\n>  .PHONY: cscope\n> -cscope:\n> -\t$(RM) cscope*\n> -\t$(FIND_SOURCE_FILES) | xargs cscope -b\n> +cscope: cscope.out\n\nThe reason for the $(RM) removal is not explained in the commit message.\n\nOtherwise the pach looks good to me.\n\n-- \nFelipe Contreras"},{"id":"428319","messageId":"60d390343798b_4290208e3@natae.notmuch","threadId":"55987","inReplyTo":"patch-3.3-67fc87665d6-20210622T141844Z-avarab@gmail.com","subject":"RE: [PATCH 3/3] Makefile: don't use \"FORCE\" for tags targets","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2021-06-23T19:49:08Z","receivedAt":"2021-06-23T19:49:14Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Ævar Arnfjörð Bjarmason wrote:\n> Remove the \"FORCE\" dependency from the \"tags\", \"TAGS\" and \"cscope.out\"\n> targets, instead make them depend on whether or not the relevant\n> source files have changed.\n\nVery nice.\n\n> I'm also removing the \"-o\" option from them,\n\nAs Jeff already pointed out, this is probably \"-a\".\n\nOther than that looks good to me.\n\n-- \nFelipe Contreras"},{"id":"428320","messageId":"60d390a81f618_429020823@natae.notmuch","threadId":"55987","inReplyTo":"YNI5KVGT2mLlTrnz@coredump.intra.peff.net","subject":"Re: [PATCH 2/3] Makefile: fix \"cscope\" target to refer to cscope.out","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2021-06-23T19:51:04Z","receivedAt":"2021-06-23T19:51:08Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Jeff King wrote:\n> I don't use cscope myself, but it can generate other files (e.g., with\n> \"-q\"). It looks like we don't even allow people to set $(CSCOPE),\n> though, so that shouldn't ever happen.\n> \n> (I wonder if anybody even really uses cscope.\n\nI do. I don't use it regularly, as I find `git grep` sufficient most of\nthe time, but sometimes I do use cscope.\n\n-- \nFelipe Contreras\n"},{"id":"428322","messageId":"60d39159291c2_4290208c9@natae.notmuch","threadId":"55987","inReplyTo":"CAPx1Gve+Zf4PHMVjv3gCTaW_0Fh6W7xL+J4bnAU0FA8OV7SR2w@mail.gmail.com","subject":"Re: [PATCH 2/3] Makefile: fix \"cscope\" target to refer to cscope.out","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2021-06-23T19:54:01Z","receivedAt":"2021-06-23T19:54:07Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Chris Torek wrote:\n> On Tue, Jun 22, 2021 at 12:26 PM Jeff King <peff@peff.net> wrote:\n> > (I wonder if anybody even really uses cscope. I wanted to love it as a\n> > better form of ctags, but I have always found it so baroque and\n> > complicated that it ends up being a waste of my time to try it).\n> \n> I use cscope all the time, from vim.  If you use vim, you'll probably want\n> cscope_maps.vim.\n\nOr just set cscopetag.\n\n-- \nFelipe Contreras\n"},{"id":"428720","messageId":"xmqqa6n9yyim.fsf@gitster.g","threadId":"55987","inReplyTo":"cover-0.3-00000000000-20210622T141844Z-avarab@gmail.com","subject":"Re: [PATCH 0/3] Makefile: \"make tags\" fixes & cleanup","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-06-29T06:29:21Z","receivedAt":"2021-06-29T06:29:27Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:\n\n> A small series to fix the various \"tags\" targets, i.e. \"make tags TAGS\n> cscope\". We'll now properly detect their dependencies, so we don't\n> needlessly run them every time. I have this as part of my standard\n> \"make git\" command, so doing nothing when we have nothing to do is\n> preferrable, especially when my editor will eagerly reload the TAGS\n> file every time it changes.\n>\n> As noted in 3/3 this is better on top of my just-submitted\n> .DELETE_ON_ERROR change[1], but will also work independently of that\n> patch/series.\n>\n> 1. https://lore.kernel.org/git/patch-1.1-9420448e74f-20210622T141100Z-avarab@gmail.com/\n>\n> Ævar Arnfjörð Bjarmason (3):\n>   Makefile: move \".PHONY: cscope\" near its target\n>   Makefile: fix \"cscope\" target to refer to cscope.out\n>   Makefile: don't use \"FORCE\" for tags targets\n>\n>  .gitignore |  2 +-\n>  Makefile   | 31 +++++++++++++++++--------------\n>  2 files changed, 18 insertions(+), 15 deletions(-)\n\nLooks mostly like good patches, with concrete suggestions for\nimprovements given.  Please do not leave another loose end that\nshould be easy to tie untied and float away to some other topics.\n\nThanks.\n"},{"id":"428732","messageId":"cover-0.5-0000000000-20210629T110837Z-avarab@gmail.com","threadId":"55987","inReplyTo":"cover-0.3-00000000000-20210622T141844Z-avarab@gmail.com","subject":"[PATCH v2 0/5] Makefile: \"make tags\" fixes & cleanup","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-06-29T11:12:54Z","receivedAt":"2021-06-29T11:13:23Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"A v2 of my fixes to the tags targets. This no longer depends on my\n.DELETE_ON_ERROR change, and goes directly on top of \"master\". See [2]\nfor the just-submitted v2 of that other series.\n\nThe big win here is that none of the tags targets depend on \"FORCE\"\nanymore, so we'll only re-generate them if our sources change.\n\nI missed the interaction of the \"-a\" flag and xargs splitting the\narguments into am implicit -n, so in v1 of this we could end up with\nincomplete tag files. In this v2 we more incrementally reach similar\nends, but in the end result retain our rm/gen/mv dance, since it's\nneeded in this case.\n\n1. http://lore.kernel.org/git/cover-0.3-00000000000-20210622T141844Z-avarab@gmail.com\n2. https://lore.kernel.org/git/patch-1.1-2557117855-20210629T084356Z-avarab@gmail.com/\n\nÆvar Arnfjörð Bjarmason (5):\n  Makefile: move \".PHONY: cscope\" near its target\n  Makefile: add QUIET_GEN to \"cscope\" target\n  Makefile: fix \"cscope\" target to refer to cscope.out\n  Makefile: don't use \"FORCE\" for tags targets\n  Makefile: normalize clobbering & xargs for tags targets\n\n .gitignore |  2 +-\n Makefile   | 34 ++++++++++++++++++++--------------\n 2 files changed, 21 insertions(+), 15 deletions(-)\n\nRange-diff against v1:\n1:  383a90c8ac = 1:  dd6cfd6022 Makefile: move \".PHONY: cscope\" near its target\n-:  ---------- > 2:  56daa09738 Makefile: add QUIET_GEN to \"cscope\" target\n2:  ea39f1f5cd ! 3:  35c8b83904 Makefile: fix \"cscope\" target to refer to cscope.out\n    @@ Commit message\n     \n         The cscope target added in a2a9150bf06 (makefile: Add a cscope target,\n         2007-10-06) has for some reason been referring to cscope* instead of\n    -    cscope.out. Let's generate the cscope.out file directly so we don't\n    -    need to speculate.\n    +    cscope.out.\n     \n    -    The \"-fcscope.out\" (note, no whitespace) argument is enabled by\n    -    default on my system's cscope 15.9, but let's provide it explicitly\n    -    for good measure.\n    +    Let's generate the cscope.out file directly so we don't need to\n    +    speculate. The \"-fcscope.out\" (note, no whitespace) argument is\n    +    enabled by default on my system's cscope 15.9, but let's provide it\n    +    explicitly for good measure.\n     \n         Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n     \n    @@ Makefile: tags: FORCE\n      \tmv tags+ tags\n      \n     +cscope.out:\n    ++\t$(QUIET_GEN)$(RM) cscope.out && \\\n     +\t$(FIND_SOURCE_FILES) | xargs cscope -f$@ -b\n     +\n      .PHONY: cscope\n     -cscope:\n    --\t$(RM) cscope*\n    +-\t$(QUIET_GEN)$(RM) cscope* && \\\n     -\t$(FIND_SOURCE_FILES) | xargs cscope -b\n     +cscope: cscope.out\n      \n3:  67fc87665d ! 4:  b924cc3f56 Makefile: don't use \"FORCE\" for tags targets\n    @@ Commit message\n         targets, instead make them depend on whether or not the relevant\n         source files have changed.\n     \n    -    I'm also removing the \"-o\" option from them, that seems to have been\n    -    cargo-culted when they were initially added in f81e7c626f3 (Makefile:\n    -    Add TAGS and tags targets, 2006-03-18). It would make sense to use\n    -    that option if we had been appending to tag files, it doesn't make any\n    -    sense that it was used after we'd just removed the files file being\n    -    appended to.\n    -\n    -    This will potentially cause a partial file to be left behind if the\n    -    command dies, but my in-flight series to use the \".DELETE_ON_ERROR\"\n    -    flag in the Makefile[1] will make that problem go away. I think even\n    -    without that it's not problem we need to worry about in these cases.\n    -\n    -    1. https://lore.kernel.org/git/patch-1.1-9420448e74f-20210622T141100Z-avarab@gmail.com/\n    -\n         Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n     \n      ## Makefile ##\n    @@ Makefile: FIND_SOURCE_FILES = ( \\\n      \t)\n      \n     -$(ETAGS_TARGET): FORCE\n    --\t$(QUIET_GEN)$(RM) \"$(ETAGS_TARGET)+\" && \\\n    --\t$(FIND_SOURCE_FILES) | xargs etags -a -o \"$(ETAGS_TARGET)+\" && \\\n    --\tmv \"$(ETAGS_TARGET)+\" \"$(ETAGS_TARGET)\"\n     +FOUND_SOURCE_FILES = $(shell $(FIND_SOURCE_FILES))\n    ++\n    ++$(ETAGS_TARGET): $(FOUND_SOURCE_FILES)\n    + \t$(QUIET_GEN)$(RM) \"$(ETAGS_TARGET)+\" && \\\n    + \t$(FIND_SOURCE_FILES) | xargs etags -a -o \"$(ETAGS_TARGET)+\" && \\\n    + \tmv \"$(ETAGS_TARGET)+\" \"$(ETAGS_TARGET)\"\n      \n     -tags: FORCE\n    --\t$(QUIET_GEN)$(RM) tags+ && \\\n    --\t$(FIND_SOURCE_FILES) | xargs ctags -a -o tags+ && \\\n    --\tmv tags+ tags\n    -+$(ETAGS_TARGET): $(FOUND_SOURCE_FILES)\n    -+\t$(QUIET_GEN)echo $(FOUND_SOURCE_FILES) | \\\n    -+\txargs etags -o $@\n    -+\n     +tags: $(FOUND_SOURCE_FILES)\n    -+\t$(QUIET_GEN)echo $(FOUND_SOURCE_FILES) | \\\n    -+\txargs ctags -o $@\n    + \t$(QUIET_GEN)$(RM) tags+ && \\\n    + \t$(FIND_SOURCE_FILES) | xargs ctags -a -o tags+ && \\\n    + \tmv tags+ tags\n      \n    - cscope.out:\n    +-cscope.out:\n    ++cscope.out: $(FOUND_SOURCE_FILES)\n    + \t$(QUIET_GEN)$(RM) cscope.out && \\\n     -\t$(FIND_SOURCE_FILES) | xargs cscope -f$@ -b\n    -+\t$(QUIET_GEN)echo $(FOUND_SOURCE_FILES) | \\\n    -+\txargs cscope -f$@ -b\n    ++\techo $(FOUND_SOURCE_FILES) | xargs cscope -f$@ -b\n      \n      .PHONY: cscope\n      cscope: cscope.out\n-:  ---------- > 5:  5195d99e25 Makefile: normalize clobbering & xargs for tags targets\n-- \n2.32.0.613.g20d5ce26552\n\n"},{"id":"428733","messageId":"patch-1.5-dd6cfd6022-20210629T110837Z-avarab@gmail.com","threadId":"55987","inReplyTo":"cover-0.5-0000000000-20210629T110837Z-avarab@gmail.com","subject":"[PATCH v2 1/5] Makefile: move \".PHONY: cscope\" near its target","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-06-29T11:12:55Z","receivedAt":"2021-06-29T11:13:26Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Move the \".PHONY: cscope\" rule to live alongside the \"cscope\" target\nitself, not to be all the way near the bottom where we define the\n\"FORCE\" rule.\n\nThat line was last modified in 2f76919517e (MinGW: avoid collisions\nbetween \"tags\" and \"TAGS\", 2010-09-28).\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n Makefile | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/Makefile b/Makefile\nindex c3565fc0f8..4dd9711a65 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2737,6 +2737,7 @@ tags: FORCE\n \t$(FIND_SOURCE_FILES) | xargs ctags -a -o tags+ && \\\n \tmv tags+ tags\n \n+.PHONY: cscope\n cscope:\n \t$(RM) cscope*\n \t$(FIND_SOURCE_FILES) | xargs cscope -b\n@@ -3245,7 +3246,7 @@ endif\n \n .PHONY: all install profile-clean cocciclean clean strip\n .PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell\n-.PHONY: FORCE cscope\n+.PHONY: FORCE\n \n ### Check documentation\n #\n-- \n2.32.0.613.g20d5ce26552\n\n"},{"id":"428734","messageId":"patch-2.5-56daa09738-20210629T110837Z-avarab@gmail.com","threadId":"55987","inReplyTo":"cover-0.5-0000000000-20210629T110837Z-avarab@gmail.com","subject":"[PATCH v2 2/5] Makefile: add QUIET_GEN to \"cscope\" target","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-06-29T11:12:56Z","receivedAt":"2021-06-29T11:13:26Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Don't show the very verbose $(FIND_SOURCE_FILES) command on every\n\"make cscope\" invocation.\n\nSee my recent 3c80fcb591 (Makefile: add QUIET_GEN to \"tags\" and \"TAGS\"\ntargets, 2021-03-28) for the same fix for the other adjacent targets.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n Makefile | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/Makefile b/Makefile\nindex 4dd9711a65..faa8900097 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2739,7 +2739,7 @@ tags: FORCE\n \n .PHONY: cscope\n cscope:\n-\t$(RM) cscope*\n+\t$(QUIET_GEN)$(RM) cscope* && \\\n \t$(FIND_SOURCE_FILES) | xargs cscope -b\n \n ### Detect prefix changes\n-- \n2.32.0.613.g20d5ce26552\n\n"},{"id":"428735","messageId":"patch-3.5-35c8b83904-20210629T110837Z-avarab@gmail.com","threadId":"55987","inReplyTo":"cover-0.5-0000000000-20210629T110837Z-avarab@gmail.com","subject":"[PATCH v2 3/5] Makefile: fix \"cscope\" target to refer to cscope.out","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-06-29T11:12:57Z","receivedAt":"2021-06-29T11:13:27Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"The cscope target added in a2a9150bf06 (makefile: Add a cscope target,\n2007-10-06) has for some reason been referring to cscope* instead of\ncscope.out.\n\nLet's generate the cscope.out file directly so we don't need to\nspeculate. The \"-fcscope.out\" (note, no whitespace) argument is\nenabled by default on my system's cscope 15.9, but let's provide it\nexplicitly for good measure.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n .gitignore |  2 +-\n Makefile   | 10 ++++++----\n 2 files changed, 7 insertions(+), 5 deletions(-)\n\ndiff --git a/.gitignore b/.gitignore\nindex 311841f9be..d74029c1ca 100644\n--- a/.gitignore\n+++ b/.gitignore\n@@ -217,7 +217,7 @@\n /.vscode/\n /tags\n /TAGS\n-/cscope*\n+/cscope.out\n /compile_commands.json\n *.hcc\n *.obj\ndiff --git a/Makefile b/Makefile\nindex faa8900097..2e3b257164 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2737,10 +2737,12 @@ tags: FORCE\n \t$(FIND_SOURCE_FILES) | xargs ctags -a -o tags+ && \\\n \tmv tags+ tags\n \n+cscope.out:\n+\t$(QUIET_GEN)$(RM) cscope.out && \\\n+\t$(FIND_SOURCE_FILES) | xargs cscope -f$@ -b\n+\n .PHONY: cscope\n-cscope:\n-\t$(QUIET_GEN)$(RM) cscope* && \\\n-\t$(FIND_SOURCE_FILES) | xargs cscope -b\n+cscope: cscope.out\n \n ### Detect prefix changes\n TRACK_PREFIX = $(bindir_SQ):$(gitexecdir_SQ):$(template_dir_SQ):$(prefix_SQ):\\\n@@ -3211,7 +3213,7 @@ clean: profile-clean coverage-clean cocciclean\n \t$(RM) $(HCC)\n \t$(RM) -r bin-wrappers $(dep_dirs) $(compdb_dir) compile_commands.json\n \t$(RM) -r po/build/\n-\t$(RM) *.pyc *.pyo */*.pyc */*.pyo $(GENERATED_H) $(ETAGS_TARGET) tags cscope*\n+\t$(RM) *.pyc *.pyo */*.pyc */*.pyo $(GENERATED_H) $(ETAGS_TARGET) tags cscope.out\n \t$(RM) -r .dist-tmp-dir .doc-tmp-dir\n \t$(RM) $(GIT_TARNAME).tar.gz\n \t$(RM) $(htmldocs).tar.gz $(manpages).tar.gz\n-- \n2.32.0.613.g20d5ce26552\n\n"},{"id":"428736","messageId":"patch-4.5-b924cc3f56-20210629T110837Z-avarab@gmail.com","threadId":"55987","inReplyTo":"cover-0.5-0000000000-20210629T110837Z-avarab@gmail.com","subject":"[PATCH v2 4/5] Makefile: don't use \"FORCE\" for tags targets","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-06-29T11:12:58Z","receivedAt":"2021-06-29T11:13:29Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Remove the \"FORCE\" dependency from the \"tags\", \"TAGS\" and \"cscope.out\"\ntargets, instead make them depend on whether or not the relevant\nsource files have changed.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n Makefile | 12 +++++++-----\n 1 file changed, 7 insertions(+), 5 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 2e3b257164..7b0d9773b0 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2727,19 +2727,21 @@ FIND_SOURCE_FILES = ( \\\n \t\t| sed -e 's|^\\./||' \\\n \t)\n \n-$(ETAGS_TARGET): FORCE\n+FOUND_SOURCE_FILES = $(shell $(FIND_SOURCE_FILES))\n+\n+$(ETAGS_TARGET): $(FOUND_SOURCE_FILES)\n \t$(QUIET_GEN)$(RM) \"$(ETAGS_TARGET)+\" && \\\n \t$(FIND_SOURCE_FILES) | xargs etags -a -o \"$(ETAGS_TARGET)+\" && \\\n \tmv \"$(ETAGS_TARGET)+\" \"$(ETAGS_TARGET)\"\n \n-tags: FORCE\n+tags: $(FOUND_SOURCE_FILES)\n \t$(QUIET_GEN)$(RM) tags+ && \\\n \t$(FIND_SOURCE_FILES) | xargs ctags -a -o tags+ && \\\n \tmv tags+ tags\n \n-cscope.out:\n+cscope.out: $(FOUND_SOURCE_FILES)\n \t$(QUIET_GEN)$(RM) cscope.out && \\\n-\t$(FIND_SOURCE_FILES) | xargs cscope -f$@ -b\n+\techo $(FOUND_SOURCE_FILES) | xargs cscope -f$@ -b\n \n .PHONY: cscope\n cscope: cscope.out\n@@ -2923,7 +2925,7 @@ check: config-list.h command-list.h\n \t\texit 1; \\\n \tfi\n \n-FOUND_C_SOURCES = $(filter %.c,$(shell $(FIND_SOURCE_FILES)))\n+FOUND_C_SOURCES = $(filter %.c,$(FOUND_SOURCE_FILES))\n COCCI_SOURCES = $(filter-out $(THIRD_PARTY_SOURCES),$(FOUND_C_SOURCES))\n \n %.cocci.patch: %.cocci $(COCCI_SOURCES)\n-- \n2.32.0.613.g20d5ce26552\n\n"},{"id":"428737","messageId":"patch-5.5-5195d99e25-20210629T110837Z-avarab@gmail.com","threadId":"55987","inReplyTo":"cover-0.5-0000000000-20210629T110837Z-avarab@gmail.com","subject":"[PATCH v2 5/5] Makefile: normalize clobbering & xargs for tags targets","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-06-29T11:12:59Z","receivedAt":"2021-06-29T11:13:30Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Since the \"tags\", \"TAGS\" and \"cscope.out\" targets rely on ping into\nxargs with an \"echo <list> | xargs\" pattern, we need to make sure\nwe're in an append mode.\n\nUnlike recent changes of mine to make use of \".DELETE_ON_ERROR\" we\nreally do need the \"rm $@+\" at the beginning (note, not \"rm $@\").\n\nThis is because the xargs command may decide on multiple invocations\nof the program. We need to make sure we've got a union of its results\nat the end.\n\nFor \"ctags\" and \"etags\" we used the \"-a\" flag for this, for cscope\nthat behavior is the default. Its \"-u\" flag disables its equivalent of\nan implicit \"-a\" flag.\n\nLet's also consistently use the $@ and $@+ names instead of needlessly\nhardcoding or referring to more verbose names in the \"tags\" and \"TAGS\"\nrules.\n\nThese targets could perhaps be improved in the future by factoring\nthis \"echo <list> | xargs\" pattern so that we make intermediate tags\nfiles for each source file, and then assemble them into one \"tags\"\nfile at the end.\n\nThe etags manual page suggests that doing that (or perhaps just\n--update) might be counter-productive, in any case, the tag building\nis fast enough for me, so I'm leaving that for now.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n Makefile | 17 +++++++++--------\n 1 file changed, 9 insertions(+), 8 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 7b0d9773b0..926c9efe43 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2730,18 +2730,19 @@ FIND_SOURCE_FILES = ( \\\n FOUND_SOURCE_FILES = $(shell $(FIND_SOURCE_FILES))\n \n $(ETAGS_TARGET): $(FOUND_SOURCE_FILES)\n-\t$(QUIET_GEN)$(RM) \"$(ETAGS_TARGET)+\" && \\\n-\t$(FIND_SOURCE_FILES) | xargs etags -a -o \"$(ETAGS_TARGET)+\" && \\\n-\tmv \"$(ETAGS_TARGET)+\" \"$(ETAGS_TARGET)\"\n+\t$(QUIET_GEN)$(RM) $@+ && \\\n+\techo $(FOUND_SOURCE_FILES) | xargs etags -a -o $@+ && \\\n+\tmv $@+ $@\n \n tags: $(FOUND_SOURCE_FILES)\n-\t$(QUIET_GEN)$(RM) tags+ && \\\n-\t$(FIND_SOURCE_FILES) | xargs ctags -a -o tags+ && \\\n-\tmv tags+ tags\n+\t$(QUIET_GEN)$(RM) $@+ && \\\n+\techo $(FOUND_SOURCE_FILES) | xargs ctags -a -o $@+ && \\\n+\tmv $@+ $@\n \n cscope.out: $(FOUND_SOURCE_FILES)\n-\t$(QUIET_GEN)$(RM) cscope.out && \\\n-\techo $(FOUND_SOURCE_FILES) | xargs cscope -f$@ -b\n+\t$(QUIET_GEN)$(RM) $@+ && \\\n+\techo $(FOUND_SOURCE_FILES) | xargs cscope -f$@+ -b && \\\n+\tmv $@+ $@\n \n .PHONY: cscope\n cscope: cscope.out\n-- \n2.32.0.613.g20d5ce26552\n\n"},{"id":"428741","messageId":"87tulgg9hl.fsf@evledraar.gmail.com","threadId":"55987","inReplyTo":"xmqqa6n9yyim.fsf@gitster.g","subject":"Re: [PATCH 0/3] Makefile: \"make tags\" fixes & cleanup","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-06-29T12:07:00Z","receivedAt":"2021-06-29T12:07:26Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Mon, Jun 28 2021, Junio C Hamano wrote:\n\n> Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:\n>\n>> A small series to fix the various \"tags\" targets, i.e. \"make tags TAGS\n>> cscope\". We'll now properly detect their dependencies, so we don't\n>> needlessly run them every time. I have this as part of my standard\n>> \"make git\" command, so doing nothing when we have nothing to do is\n>> preferrable, especially when my editor will eagerly reload the TAGS\n>> file every time it changes.\n>>\n>> As noted in 3/3 this is better on top of my just-submitted\n>> .DELETE_ON_ERROR change[1], but will also work independently of that\n>> patch/series.\n>>\n>> 1. https://lore.kernel.org/git/patch-1.1-9420448e74f-20210622T141100Z-avarab@gmail.com/\n>>\n>> Ævar Arnfjörð Bjarmason (3):\n>>   Makefile: move \".PHONY: cscope\" near its target\n>>   Makefile: fix \"cscope\" target to refer to cscope.out\n>>   Makefile: don't use \"FORCE\" for tags targets\n>>\n>>  .gitignore |  2 +-\n>>  Makefile   | 31 +++++++++++++++++--------------\n>>  2 files changed, 18 insertions(+), 15 deletions(-)\n>\n> Looks mostly like good patches, with concrete suggestions for\n> improvements given.  Please do not leave another loose end that\n> should be easy to tie untied and float away to some other topics.\n\nIn the v2 re-roll of both I detached these two topics from each other,\nas it turns out it wasn't needed to begin with. Sorry about that.\n"},{"id":"428791","messageId":"67c45b13-df8f-8065-377a-fbd2f80992ee@ramsayjones.plus.com","threadId":"55987","inReplyTo":"patch-4.5-b924cc3f56-20210629T110837Z-avarab@gmail.com","subject":"Re: [PATCH v2 4/5] Makefile: don't use \"FORCE\" for tags targets","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2021-06-30T00:05:31Z","receivedAt":"2021-06-30T00:13:09Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\n\nOn 29/06/2021 12:12, Ævar Arnfjörð Bjarmason wrote:\n> Remove the \"FORCE\" dependency from the \"tags\", \"TAGS\" and \"cscope.out\"\n> targets, instead make them depend on whether or not the relevant\n> source files have changed.\n> \n> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n> ---\n>  Makefile | 12 +++++++-----\n>  1 file changed, 7 insertions(+), 5 deletions(-)\n> \n> diff --git a/Makefile b/Makefile\n> index 2e3b257164..7b0d9773b0 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -2727,19 +2727,21 @@ FIND_SOURCE_FILES = ( \\\n>  \t\t| sed -e 's|^\\./||' \\\n>  \t)\n>  \n> -$(ETAGS_TARGET): FORCE\n> +FOUND_SOURCE_FILES = $(shell $(FIND_SOURCE_FILES))\n> +\n> +$(ETAGS_TARGET): $(FOUND_SOURCE_FILES)\n>  \t$(QUIET_GEN)$(RM) \"$(ETAGS_TARGET)+\" && \\\n>  \t$(FIND_SOURCE_FILES) | xargs etags -a -o \"$(ETAGS_TARGET)+\" && \\\n>  \tmv \"$(ETAGS_TARGET)+\" \"$(ETAGS_TARGET)\"\n>  \n> -tags: FORCE\n> +tags: $(FOUND_SOURCE_FILES)\n>  \t$(QUIET_GEN)$(RM) tags+ && \\\n>  \t$(FIND_SOURCE_FILES) | xargs ctags -a -o tags+ && \\\n>  \tmv tags+ tags\n\nI was expecting to see the above targets to be changed, similarly to ...\n\n>  \n> -cscope.out:\n> +cscope.out: $(FOUND_SOURCE_FILES)\n>  \t$(QUIET_GEN)$(RM) cscope.out && \\\n> -\t$(FIND_SOURCE_FILES) | xargs cscope -f$@ -b\n> +\techo $(FOUND_SOURCE_FILES) | xargs cscope -f$@ -b\n\n... this hunk (ie. 'an \"echo <list> | xargs\" pattern')\nIndeed, the above phrase was taken from the commit message of\nthe next patch (5/5), which implies that this change had already\nhappened (presumably in this patch).\n\nATB,\nRamsay Jones\n\n>  \n>  .PHONY: cscope\n>  cscope: cscope.out\n> @@ -2923,7 +2925,7 @@ check: config-list.h command-list.h\n>  \t\texit 1; \\\n>  \tfi\n>  \n> -FOUND_C_SOURCES = $(filter %.c,$(shell $(FIND_SOURCE_FILES)))\n> +FOUND_C_SOURCES = $(filter %.c,$(FOUND_SOURCE_FILES))\n>  COCCI_SOURCES = $(filter-out $(THIRD_PARTY_SOURCES),$(FOUND_C_SOURCES))\n>  \n>  %.cocci.patch: %.cocci $(COCCI_SOURCES)\n> \n"},{"id":"428992","messageId":"YN5AeMiTiHFrFW/7@coredump.intra.peff.net","threadId":"55987","inReplyTo":"patch-3.5-35c8b83904-20210629T110837Z-avarab@gmail.com","subject":"Re: [PATCH v2 3/5] Makefile: fix \"cscope\" target to refer to cscope.out","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2021-07-01T22:23:52Z","receivedAt":"2021-07-01T22:23:54Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Jun 29, 2021 at 01:12:57PM +0200, Ævar Arnfjörð Bjarmason wrote:\n\n> diff --git a/Makefile b/Makefile\n> index faa8900097..2e3b257164 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -2737,10 +2737,12 @@ tags: FORCE\n>  \t$(FIND_SOURCE_FILES) | xargs ctags -a -o tags+ && \\\n>  \tmv tags+ tags\n>  \n> +cscope.out:\n> +\t$(QUIET_GEN)$(RM) cscope.out && \\\n> +\t$(FIND_SOURCE_FILES) | xargs cscope -f$@ -b\n> +\n>  .PHONY: cscope\n> -cscope:\n> -\t$(QUIET_GEN)$(RM) cscope* && \\\n> -\t$(FIND_SOURCE_FILES) | xargs cscope -b\n> +cscope: cscope.out\n\nDoesn't this break subsequent runs after the first generation? With a\nphony \"cscope\" target, \"make cscope\" will always run the command, even\nif it's not necessary. But with a real \"cscope.out\" target but not\ndependencies, it will _never_ run it, even if one of the files changed.\n\nE.g., with your patch:\n\n  $ make cscope.out\n    GEN cscope.out\n\n  $ make cscope.out\n  make: 'cscope.out' is up to date.\n\n  $ echo 'void foo(void) { }' >>git.c\n  $ make cscope.out\n  GIT_VERSION = 2.32.0.96.g5daee1b7bb.dirty\n  make: 'cscope.out' is up to date.\n\n-Peff\n"},{"id":"428993","messageId":"YN5AwdVC3QAcy2tA@coredump.intra.peff.net","threadId":"55987","inReplyTo":"YN5AeMiTiHFrFW/7@coredump.intra.peff.net","subject":"Re: [PATCH v2 3/5] Makefile: fix \"cscope\" target to refer to cscope.out","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2021-07-01T22:25:05Z","receivedAt":"2021-07-01T22:25:07Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Jul 01, 2021 at 06:23:52PM -0400, Jeff King wrote:\n\n> On Tue, Jun 29, 2021 at 01:12:57PM +0200, Ævar Arnfjörð Bjarmason wrote:\n> \n> > diff --git a/Makefile b/Makefile\n> > index faa8900097..2e3b257164 100644\n> > --- a/Makefile\n> > +++ b/Makefile\n> > @@ -2737,10 +2737,12 @@ tags: FORCE\n> >  \t$(FIND_SOURCE_FILES) | xargs ctags -a -o tags+ && \\\n> >  \tmv tags+ tags\n> >  \n> > +cscope.out:\n> > +\t$(QUIET_GEN)$(RM) cscope.out && \\\n> > +\t$(FIND_SOURCE_FILES) | xargs cscope -f$@ -b\n> > +\n> >  .PHONY: cscope\n> > -cscope:\n> > -\t$(QUIET_GEN)$(RM) cscope* && \\\n> > -\t$(FIND_SOURCE_FILES) | xargs cscope -b\n> > +cscope: cscope.out\n> \n> Doesn't this break subsequent runs after the first generation? With a\n> phony \"cscope\" target, \"make cscope\" will always run the command, even\n> if it's not necessary. But with a real \"cscope.out\" target but not\n> dependencies, it will _never_ run it, even if one of the files changed.\n> \n> E.g., with your patch:\n> \n>   $ make cscope.out\n>     GEN cscope.out\n> \n>   $ make cscope.out\n>   make: 'cscope.out' is up to date.\n> \n>   $ echo 'void foo(void) { }' >>git.c\n>   $ make cscope.out\n>   GIT_VERSION = 2.32.0.96.g5daee1b7bb.dirty\n>   make: 'cscope.out' is up to date.\n\nAh, I see it is un-broken in the next commit, which adds actual\ndependencies. I think it is OK to have a temporarily-broken state in the\nhistory for something so trivial, but it might be worth mentioning it in\nthe commit message.\n\n-Peff\n"},{"id":"430825","messageId":"cover-0.5-00000000000-20210721T231900Z-avarab@gmail.com","threadId":"55987","inReplyTo":"cover-0.5-0000000000-20210629T110837Z-avarab@gmail.com","subject":"[PATCH v3 0/5] Makefile: \"make tags\" fixes & cleanup","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-07-21T23:23:01Z","receivedAt":"2021-07-21T23:23:15Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"The big win here is that none of the tags targets depend on \"FORCE\"\nanymore, so we'll only re-generate them if our sources change.\n\nFor v2, see\nhttps://lore.kernel.org/git/cover-0.5-0000000000-20210629T110837Z-avarab@gmail.com/\n\nThis fixes the series per feedback from Jeff King and Ramsay Jones,\ni.e:\n\n * In v2 the 3/5 broke things in a way that 4/5 fixed, that's now\n   re-arranged and fixed.\n\n * I now use $(FOUND_SOURCE_FILES) instead of $(FIND_SOURCE_FILES)\n   consistently. I was redundantly re-running the \"find\" command.\n\n\nÆvar Arnfjörð Bjarmason (5):\n  Makefile: move \".PHONY: cscope\" near its target\n  Makefile: add QUIET_GEN to \"cscope\" target\n  Makefile: don't use \"FORCE\" for tags targets\n  Makefile: the \"cscope\" target always creates a \"cscope.out\"\n  Makefile: normalize clobbering & xargs for tags targets\n\n .gitignore |  2 +-\n Makefile   | 34 ++++++++++++++++++++--------------\n 2 files changed, 21 insertions(+), 15 deletions(-)\n\nRange-diff against v2:\n1:  dd6cfd6022c = 1:  6b4ddc126d9 Makefile: move \".PHONY: cscope\" near its target\n2:  56daa09738f = 2:  d3d5d332e92 Makefile: add QUIET_GEN to \"cscope\" target\n4:  b924cc3f566 ! 3:  9dd69d68178 Makefile: don't use \"FORCE\" for tags targets\n    @@ Metadata\n      ## Commit message ##\n         Makefile: don't use \"FORCE\" for tags targets\n     \n    -    Remove the \"FORCE\" dependency from the \"tags\", \"TAGS\" and \"cscope.out\"\n    +    Remove the \"FORCE\" dependency from the \"tags\", \"TAGS\" and \"cscope\"\n         targets, instead make them depend on whether or not the relevant\n         source files have changed.\n     \n    +    For the cscope target we need to change it to depend on the actual\n    +    generated file while we generate while we're at it, as the next commit\n    +    will discuss we always generate a cscope.out file.\n    +\n         Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n     \n      ## Makefile ##\n    @@ Makefile: FIND_SOURCE_FILES = ( \\\n     +\n     +$(ETAGS_TARGET): $(FOUND_SOURCE_FILES)\n      \t$(QUIET_GEN)$(RM) \"$(ETAGS_TARGET)+\" && \\\n    - \t$(FIND_SOURCE_FILES) | xargs etags -a -o \"$(ETAGS_TARGET)+\" && \\\n    +-\t$(FIND_SOURCE_FILES) | xargs etags -a -o \"$(ETAGS_TARGET)+\" && \\\n    ++\techo $(FOUND_SOURCE_FILES) | xargs etags -a -o \"$(ETAGS_TARGET)+\" && \\\n      \tmv \"$(ETAGS_TARGET)+\" \"$(ETAGS_TARGET)\"\n      \n     -tags: FORCE\n     +tags: $(FOUND_SOURCE_FILES)\n      \t$(QUIET_GEN)$(RM) tags+ && \\\n    - \t$(FIND_SOURCE_FILES) | xargs ctags -a -o tags+ && \\\n    +-\t$(FIND_SOURCE_FILES) | xargs ctags -a -o tags+ && \\\n    ++\techo $(FOUND_SOURCE_FILES) | xargs ctags -a -o tags+ && \\\n      \tmv tags+ tags\n      \n    --cscope.out:\n    +-.PHONY: cscope\n    +-cscope:\n     +cscope.out: $(FOUND_SOURCE_FILES)\n    - \t$(QUIET_GEN)$(RM) cscope.out && \\\n    --\t$(FIND_SOURCE_FILES) | xargs cscope -f$@ -b\n    -+\techo $(FOUND_SOURCE_FILES) | xargs cscope -f$@ -b\n    + \t$(QUIET_GEN)$(RM) cscope* && \\\n    +-\t$(FIND_SOURCE_FILES) | xargs cscope -b\n    ++\techo $(FOUND_SOURCE_FILES) | xargs cscope -b\n    ++\n    ++.PHONY: cscope\n    ++cscope: cscope.out\n      \n    - .PHONY: cscope\n    - cscope: cscope.out\n    + ### Detect prefix changes\n    + TRACK_PREFIX = $(bindir_SQ):$(gitexecdir_SQ):$(template_dir_SQ):$(prefix_SQ):\\\n     @@ Makefile: check: config-list.h command-list.h\n      \t\texit 1; \\\n      \tfi\n3:  35c8b839048 ! 4:  f8d151f1f6a Makefile: fix \"cscope\" target to refer to cscope.out\n    @@ Metadata\n     Author: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n     \n      ## Commit message ##\n    -    Makefile: fix \"cscope\" target to refer to cscope.out\n    +    Makefile: the \"cscope\" target always creates a \"cscope.out\"\n     \n    -    The cscope target added in a2a9150bf06 (makefile: Add a cscope target,\n    -    2007-10-06) has for some reason been referring to cscope* instead of\n    +    In the preceding commit the \"cscope\" target was changed to be a phony\n    +    alias for the \"cscope.out\" target.\n    +\n    +    The cscope target was added in a2a9150bf06 (makefile: Add a cscope\n    +    target, 2007-10-06), and has always referred to cscope* instead of to\n         cscope.out.\n     \n    -    Let's generate the cscope.out file directly so we don't need to\n    -    speculate. The \"-fcscope.out\" (note, no whitespace) argument is\n    -    enabled by default on my system's cscope 15.9, but let's provide it\n    -    explicitly for good measure.\n    +    As far as I can tell this ambiguity was never needed. The\n    +    \"-fcscope.out\" (note, no whitespace) argument is enabled by default,\n    +    but let's provide it explicitly for good measure.\n     \n         Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n     \n    @@ .gitignore\n      *.obj\n     \n      ## Makefile ##\n    -@@ Makefile: tags: FORCE\n    - \t$(FIND_SOURCE_FILES) | xargs ctags -a -o tags+ && \\\n    +@@ Makefile: tags: $(FOUND_SOURCE_FILES)\n      \tmv tags+ tags\n      \n    -+cscope.out:\n    -+\t$(QUIET_GEN)$(RM) cscope.out && \\\n    -+\t$(FIND_SOURCE_FILES) | xargs cscope -f$@ -b\n    -+\n    - .PHONY: cscope\n    --cscope:\n    + cscope.out: $(FOUND_SOURCE_FILES)\n     -\t$(QUIET_GEN)$(RM) cscope* && \\\n    --\t$(FIND_SOURCE_FILES) | xargs cscope -b\n    -+cscope: cscope.out\n    +-\techo $(FOUND_SOURCE_FILES) | xargs cscope -b\n    ++\t$(QUIET_GEN)$(RM) cscope.out && \\\n    ++\techo $(FOUND_SOURCE_FILES) | xargs cscope -f$@ -b\n      \n    - ### Detect prefix changes\n    - TRACK_PREFIX = $(bindir_SQ):$(gitexecdir_SQ):$(template_dir_SQ):$(prefix_SQ):\\\n    + .PHONY: cscope\n    + cscope: cscope.out\n     @@ Makefile: clean: profile-clean coverage-clean cocciclean\n      \t$(RM) $(HCC)\n      \t$(RM) -r bin-wrappers $(dep_dirs) $(compdb_dir) compile_commands.json\n5:  5195d99e25c ! 5:  f3ff76d0e98 Makefile: normalize clobbering & xargs for tags targets\n    @@ Metadata\n      ## Commit message ##\n         Makefile: normalize clobbering & xargs for tags targets\n     \n    -    Since the \"tags\", \"TAGS\" and \"cscope.out\" targets rely on ping into\n    +    Since the \"tags\", \"TAGS\" and \"cscope.out\" targets rely on piping into\n         xargs with an \"echo <list> | xargs\" pattern, we need to make sure\n         we're in an append mode.\n     \n    -    Unlike recent changes of mine to make use of \".DELETE_ON_ERROR\" we\n    -    really do need the \"rm $@+\" at the beginning (note, not \"rm $@\").\n    +    Unlike my recent change to make use of \".DELETE_ON_ERROR\" in\n    +    7b76d6bf221 (Makefile: add and use the \".DELETE_ON_ERROR\" flag,\n    +    2021-06-29), we really do need the \"rm $@+\" at the beginning (note,\n    +    not \"rm $@\").\n     \n    -    This is because the xargs command may decide on multiple invocations\n    -    of the program. We need to make sure we've got a union of its results\n    +    This is because the xargs command may decide to invoke the program\n    +    multiple times. We need to make sure we've got a union of its results\n         at the end.\n     \n         For \"ctags\" and \"etags\" we used the \"-a\" flag for this, for cscope\n    @@ Makefile: FIND_SOURCE_FILES = ( \\\n      \n      $(ETAGS_TARGET): $(FOUND_SOURCE_FILES)\n     -\t$(QUIET_GEN)$(RM) \"$(ETAGS_TARGET)+\" && \\\n    --\t$(FIND_SOURCE_FILES) | xargs etags -a -o \"$(ETAGS_TARGET)+\" && \\\n    +-\techo $(FOUND_SOURCE_FILES) | xargs etags -a -o \"$(ETAGS_TARGET)+\" && \\\n     -\tmv \"$(ETAGS_TARGET)+\" \"$(ETAGS_TARGET)\"\n     +\t$(QUIET_GEN)$(RM) $@+ && \\\n     +\techo $(FOUND_SOURCE_FILES) | xargs etags -a -o $@+ && \\\n    @@ Makefile: FIND_SOURCE_FILES = ( \\\n      \n      tags: $(FOUND_SOURCE_FILES)\n     -\t$(QUIET_GEN)$(RM) tags+ && \\\n    --\t$(FIND_SOURCE_FILES) | xargs ctags -a -o tags+ && \\\n    +-\techo $(FOUND_SOURCE_FILES) | xargs ctags -a -o tags+ && \\\n     -\tmv tags+ tags\n     +\t$(QUIET_GEN)$(RM) $@+ && \\\n     +\techo $(FOUND_SOURCE_FILES) | xargs ctags -a -o $@+ && \\\n-- \n2.32.0.955.ge7c5360f7e7\n\n"},{"id":"430826","messageId":"patch-1.5-6b4ddc126d9-20210721T231900Z-avarab@gmail.com","threadId":"55987","inReplyTo":"cover-0.5-00000000000-20210721T231900Z-avarab@gmail.com","subject":"[PATCH v3 1/5] Makefile: move \".PHONY: cscope\" near its target","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-07-21T23:23:02Z","receivedAt":"2021-07-21T23:23:17Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Move the \".PHONY: cscope\" rule to live alongside the \"cscope\" target\nitself, not to be all the way near the bottom where we define the\n\"FORCE\" rule.\n\nThat line was last modified in 2f76919517e (MinGW: avoid collisions\nbetween \"tags\" and \"TAGS\", 2010-09-28).\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n Makefile | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/Makefile b/Makefile\nindex c7c46c017d3..7dd93ef4c3e 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2749,6 +2749,7 @@ tags: FORCE\n \t$(FIND_SOURCE_FILES) | xargs ctags -a -o tags+ && \\\n \tmv tags+ tags\n \n+.PHONY: cscope\n cscope:\n \t$(RM) cscope*\n \t$(FIND_SOURCE_FILES) | xargs cscope -b\n@@ -3260,7 +3261,7 @@ endif\n \n .PHONY: all install profile-clean cocciclean clean strip\n .PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell\n-.PHONY: FORCE cscope\n+.PHONY: FORCE\n \n ### Check documentation\n #\n-- \n2.32.0.955.ge7c5360f7e7\n\n"},{"id":"430827","messageId":"patch-2.5-d3d5d332e92-20210721T231900Z-avarab@gmail.com","threadId":"55987","inReplyTo":"cover-0.5-00000000000-20210721T231900Z-avarab@gmail.com","subject":"[PATCH v3 2/5] Makefile: add QUIET_GEN to \"cscope\" target","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-07-21T23:23:03Z","receivedAt":"2021-07-21T23:23:19Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Don't show the very verbose $(FIND_SOURCE_FILES) command on every\n\"make cscope\" invocation.\n\nSee my recent 3c80fcb591 (Makefile: add QUIET_GEN to \"tags\" and \"TAGS\"\ntargets, 2021-03-28) for the same fix for the other adjacent targets.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n Makefile | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/Makefile b/Makefile\nindex 7dd93ef4c3e..69410095949 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2751,7 +2751,7 @@ tags: FORCE\n \n .PHONY: cscope\n cscope:\n-\t$(RM) cscope*\n+\t$(QUIET_GEN)$(RM) cscope* && \\\n \t$(FIND_SOURCE_FILES) | xargs cscope -b\n \n ### Detect prefix changes\n-- \n2.32.0.955.ge7c5360f7e7\n\n"},{"id":"430828","messageId":"patch-3.5-9dd69d68178-20210721T231900Z-avarab@gmail.com","threadId":"55987","inReplyTo":"cover-0.5-00000000000-20210721T231900Z-avarab@gmail.com","subject":"[PATCH v3 3/5] Makefile: don't use \"FORCE\" for tags targets","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-07-21T23:23:04Z","receivedAt":"2021-07-21T23:23:20Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Remove the \"FORCE\" dependency from the \"tags\", \"TAGS\" and \"cscope\"\ntargets, instead make them depend on whether or not the relevant\nsource files have changed.\n\nFor the cscope target we need to change it to depend on the actual\ngenerated file while we generate while we're at it, as the next commit\nwill discuss we always generate a cscope.out file.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n Makefile | 20 ++++++++++++--------\n 1 file changed, 12 insertions(+), 8 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 69410095949..18895d94ffa 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2739,20 +2739,24 @@ FIND_SOURCE_FILES = ( \\\n \t\t| sed -e 's|^\\./||' \\\n \t)\n \n-$(ETAGS_TARGET): FORCE\n+FOUND_SOURCE_FILES = $(shell $(FIND_SOURCE_FILES))\n+\n+$(ETAGS_TARGET): $(FOUND_SOURCE_FILES)\n \t$(QUIET_GEN)$(RM) \"$(ETAGS_TARGET)+\" && \\\n-\t$(FIND_SOURCE_FILES) | xargs etags -a -o \"$(ETAGS_TARGET)+\" && \\\n+\techo $(FOUND_SOURCE_FILES) | xargs etags -a -o \"$(ETAGS_TARGET)+\" && \\\n \tmv \"$(ETAGS_TARGET)+\" \"$(ETAGS_TARGET)\"\n \n-tags: FORCE\n+tags: $(FOUND_SOURCE_FILES)\n \t$(QUIET_GEN)$(RM) tags+ && \\\n-\t$(FIND_SOURCE_FILES) | xargs ctags -a -o tags+ && \\\n+\techo $(FOUND_SOURCE_FILES) | xargs ctags -a -o tags+ && \\\n \tmv tags+ tags\n \n-.PHONY: cscope\n-cscope:\n+cscope.out: $(FOUND_SOURCE_FILES)\n \t$(QUIET_GEN)$(RM) cscope* && \\\n-\t$(FIND_SOURCE_FILES) | xargs cscope -b\n+\techo $(FOUND_SOURCE_FILES) | xargs cscope -b\n+\n+.PHONY: cscope\n+cscope: cscope.out\n \n ### Detect prefix changes\n TRACK_PREFIX = $(bindir_SQ):$(gitexecdir_SQ):$(template_dir_SQ):$(prefix_SQ):\\\n@@ -2936,7 +2940,7 @@ check: config-list.h command-list.h\n \t\texit 1; \\\n \tfi\n \n-FOUND_C_SOURCES = $(filter %.c,$(shell $(FIND_SOURCE_FILES)))\n+FOUND_C_SOURCES = $(filter %.c,$(FOUND_SOURCE_FILES))\n COCCI_SOURCES = $(filter-out $(THIRD_PARTY_SOURCES),$(FOUND_C_SOURCES))\n \n %.cocci.patch: %.cocci $(COCCI_SOURCES)\n-- \n2.32.0.955.ge7c5360f7e7\n\n"},{"id":"430829","messageId":"patch-4.5-f8d151f1f6a-20210721T231900Z-avarab@gmail.com","threadId":"55987","inReplyTo":"cover-0.5-00000000000-20210721T231900Z-avarab@gmail.com","subject":"[PATCH v3 4/5] Makefile: the \"cscope\" target always creates a \"cscope.out\"","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-07-21T23:23:05Z","receivedAt":"2021-07-21T23:23:21Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"In the preceding commit the \"cscope\" target was changed to be a phony\nalias for the \"cscope.out\" target.\n\nThe cscope target was added in a2a9150bf06 (makefile: Add a cscope\ntarget, 2007-10-06), and has always referred to cscope* instead of to\ncscope.out.\n\nAs far as I can tell this ambiguity was never needed. The\n\"-fcscope.out\" (note, no whitespace) argument is enabled by default,\nbut let's provide it explicitly for good measure.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n .gitignore | 2 +-\n Makefile   | 6 +++---\n 2 files changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/.gitignore b/.gitignore\nindex 311841f9bed..d74029c1ca7 100644\n--- a/.gitignore\n+++ b/.gitignore\n@@ -217,7 +217,7 @@\n /.vscode/\n /tags\n /TAGS\n-/cscope*\n+/cscope.out\n /compile_commands.json\n *.hcc\n *.obj\ndiff --git a/Makefile b/Makefile\nindex 18895d94ffa..730ff23b923 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2752,8 +2752,8 @@ tags: $(FOUND_SOURCE_FILES)\n \tmv tags+ tags\n \n cscope.out: $(FOUND_SOURCE_FILES)\n-\t$(QUIET_GEN)$(RM) cscope* && \\\n-\techo $(FOUND_SOURCE_FILES) | xargs cscope -b\n+\t$(QUIET_GEN)$(RM) cscope.out && \\\n+\techo $(FOUND_SOURCE_FILES) | xargs cscope -f$@ -b\n \n .PHONY: cscope\n cscope: cscope.out\n@@ -3230,7 +3230,7 @@ clean: profile-clean coverage-clean cocciclean\n \t$(RM) $(HCC)\n \t$(RM) -r bin-wrappers $(dep_dirs) $(compdb_dir) compile_commands.json\n \t$(RM) -r po/build/\n-\t$(RM) *.pyc *.pyo */*.pyc */*.pyo $(GENERATED_H) $(ETAGS_TARGET) tags cscope*\n+\t$(RM) *.pyc *.pyo */*.pyc */*.pyo $(GENERATED_H) $(ETAGS_TARGET) tags cscope.out\n \t$(RM) -r .dist-tmp-dir .doc-tmp-dir\n \t$(RM) $(GIT_TARNAME).tar.gz\n \t$(RM) $(htmldocs).tar.gz $(manpages).tar.gz\n-- \n2.32.0.955.ge7c5360f7e7\n\n"},{"id":"430830","messageId":"patch-5.5-f3ff76d0e98-20210721T231900Z-avarab@gmail.com","threadId":"55987","inReplyTo":"cover-0.5-00000000000-20210721T231900Z-avarab@gmail.com","subject":"[PATCH v3 5/5] Makefile: normalize clobbering & xargs for tags targets","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-07-21T23:23:06Z","receivedAt":"2021-07-21T23:23:21Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Since the \"tags\", \"TAGS\" and \"cscope.out\" targets rely on piping into\nxargs with an \"echo <list> | xargs\" pattern, we need to make sure\nwe're in an append mode.\n\nUnlike my recent change to make use of \".DELETE_ON_ERROR\" in\n7b76d6bf221 (Makefile: add and use the \".DELETE_ON_ERROR\" flag,\n2021-06-29), we really do need the \"rm $@+\" at the beginning (note,\nnot \"rm $@\").\n\nThis is because the xargs command may decide to invoke the program\nmultiple times. We need to make sure we've got a union of its results\nat the end.\n\nFor \"ctags\" and \"etags\" we used the \"-a\" flag for this, for cscope\nthat behavior is the default. Its \"-u\" flag disables its equivalent of\nan implicit \"-a\" flag.\n\nLet's also consistently use the $@ and $@+ names instead of needlessly\nhardcoding or referring to more verbose names in the \"tags\" and \"TAGS\"\nrules.\n\nThese targets could perhaps be improved in the future by factoring\nthis \"echo <list> | xargs\" pattern so that we make intermediate tags\nfiles for each source file, and then assemble them into one \"tags\"\nfile at the end.\n\nThe etags manual page suggests that doing that (or perhaps just\n--update) might be counter-productive, in any case, the tag building\nis fast enough for me, so I'm leaving that for now.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n Makefile | 17 +++++++++--------\n 1 file changed, 9 insertions(+), 8 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 730ff23b923..295ac359cea 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2742,18 +2742,19 @@ FIND_SOURCE_FILES = ( \\\n FOUND_SOURCE_FILES = $(shell $(FIND_SOURCE_FILES))\n \n $(ETAGS_TARGET): $(FOUND_SOURCE_FILES)\n-\t$(QUIET_GEN)$(RM) \"$(ETAGS_TARGET)+\" && \\\n-\techo $(FOUND_SOURCE_FILES) | xargs etags -a -o \"$(ETAGS_TARGET)+\" && \\\n-\tmv \"$(ETAGS_TARGET)+\" \"$(ETAGS_TARGET)\"\n+\t$(QUIET_GEN)$(RM) $@+ && \\\n+\techo $(FOUND_SOURCE_FILES) | xargs etags -a -o $@+ && \\\n+\tmv $@+ $@\n \n tags: $(FOUND_SOURCE_FILES)\n-\t$(QUIET_GEN)$(RM) tags+ && \\\n-\techo $(FOUND_SOURCE_FILES) | xargs ctags -a -o tags+ && \\\n-\tmv tags+ tags\n+\t$(QUIET_GEN)$(RM) $@+ && \\\n+\techo $(FOUND_SOURCE_FILES) | xargs ctags -a -o $@+ && \\\n+\tmv $@+ $@\n \n cscope.out: $(FOUND_SOURCE_FILES)\n-\t$(QUIET_GEN)$(RM) cscope.out && \\\n-\techo $(FOUND_SOURCE_FILES) | xargs cscope -f$@ -b\n+\t$(QUIET_GEN)$(RM) $@+ && \\\n+\techo $(FOUND_SOURCE_FILES) | xargs cscope -f$@+ -b && \\\n+\tmv $@+ $@\n \n .PHONY: cscope\n cscope: cscope.out\n-- \n2.32.0.955.ge7c5360f7e7\n\n"},{"id":"430937","messageId":"xmqqk0li9tks.fsf@gitster.g","threadId":"55987","inReplyTo":"patch-4.5-f8d151f1f6a-20210721T231900Z-avarab@gmail.com","subject":"Re: [PATCH v3 4/5] Makefile: the \"cscope\" target always creates a \"cscope.out\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-07-22T16:55:31Z","receivedAt":"2021-07-22T16:57:42Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:\n\n> In the preceding commit the \"cscope\" target was changed to be a phony\n> alias for the \"cscope.out\" target.\n>\n> The cscope target was added in a2a9150bf06 (makefile: Add a cscope\n> target, 2007-10-06), and has always referred to cscope* instead of to\n> cscope.out.\n>\n> As far as I can tell this ambiguity was never needed. The\n> \"-fcscope.out\" (note, no whitespace) argument is enabled by default,\n> but let's provide it explicitly for good measure.\n\nIsn't it because we anticipated possible use of options like '-q' in\nthe future that we clean and ignore cscope* instead of the single\ncscope.out and nothing else?\n\n   $ echo *.c | xargs cscope -b -q; git clean -n -x\n   Would remove cscope.in.out\n   Would remove cscope.out\n   Would remove cscope.po.out\n\nI know we currently care only about cscope.out and it is perfectly\nfine to make the phony cscope depend on cscope.out only, but I'd\nfeel safer to keep the exclude patterns and $(RM) clean rule to\ncatch them.\n\n> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n> ---\n>  .gitignore | 2 +-\n>  Makefile   | 6 +++---\n>  2 files changed, 4 insertions(+), 4 deletions(-)\n>\n> diff --git a/.gitignore b/.gitignore\n> index 311841f9bed..d74029c1ca7 100644\n> --- a/.gitignore\n> +++ b/.gitignore\n> @@ -217,7 +217,7 @@\n>  /.vscode/\n>  /tags\n>  /TAGS\n> -/cscope*\n> +/cscope.out\n>  /compile_commands.json\n>  *.hcc\n>  *.obj\n> diff --git a/Makefile b/Makefile\n> index 18895d94ffa..730ff23b923 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -2752,8 +2752,8 @@ tags: $(FOUND_SOURCE_FILES)\n>  \tmv tags+ tags\n>  \n>  cscope.out: $(FOUND_SOURCE_FILES)\n> -\t$(QUIET_GEN)$(RM) cscope* && \\\n> -\techo $(FOUND_SOURCE_FILES) | xargs cscope -b\n> +\t$(QUIET_GEN)$(RM) cscope.out && \\\n> +\techo $(FOUND_SOURCE_FILES) | xargs cscope -f$@ -b\n>  \n>  .PHONY: cscope\n>  cscope: cscope.out\n> @@ -3230,7 +3230,7 @@ clean: profile-clean coverage-clean cocciclean\n>  \t$(RM) $(HCC)\n>  \t$(RM) -r bin-wrappers $(dep_dirs) $(compdb_dir) compile_commands.json\n>  \t$(RM) -r po/build/\n> -\t$(RM) *.pyc *.pyo */*.pyc */*.pyo $(GENERATED_H) $(ETAGS_TARGET) tags cscope*\n> +\t$(RM) *.pyc *.pyo */*.pyc */*.pyo $(GENERATED_H) $(ETAGS_TARGET) tags cscope.out\n>  \t$(RM) -r .dist-tmp-dir .doc-tmp-dir\n>  \t$(RM) $(GIT_TARNAME).tar.gz\n>  \t$(RM) $(htmldocs).tar.gz $(manpages).tar.gz\n"},{"id":"430939","messageId":"YPmxsCatUIByQnig@nand.local","threadId":"55987","inReplyTo":"xmqqk0li9tks.fsf@gitster.g","subject":"Re: [PATCH v3 4/5] Makefile: the \"cscope\" target always creates a \"cscope.out\"","fromName":"Taylor Blau","fromEmail":"me@ttaylorr.com","sentAt":"2021-07-22T17:58:08Z","receivedAt":"2021-07-22T17:58:11Z","isPatch":true,"sender":{"key":"me@ttaylorr.com","avatar":"https://avatars.githubusercontent.com/u/301000140?v=4"},"body":"On Thu, Jul 22, 2021 at 09:55:31AM -0700, Junio C Hamano wrote:\n> I know we currently care only about cscope.out and it is perfectly\n> fine to make the phony cscope depend on cscope.out only, but I'd\n> feel safer to keep the exclude patterns and $(RM) clean rule to\n> catch them.\n\nI agree. I wondered about whether this patch could just get dropped\nentirely, since after removing the changes in .gitignore and the \"clean\"\nrule, the only change left is:\n\n> >  cscope.out: $(FOUND_SOURCE_FILES)\n> > -\t$(QUIET_GEN)$(RM) cscope* && \\\n> > -\techo $(FOUND_SOURCE_FILES) | xargs cscope -b\n> > +\t$(QUIET_GEN)$(RM) cscope.out && \\\n> > +\techo $(FOUND_SOURCE_FILES) | xargs cscope -f$@ -b\n\nBut that alone is a good change in my mind at least. Then it's clear\nthat that target is responsible for generating cscope.out and nothing\nelse.\n\nSo I'd be in favor of rewording the patch message and only retaining\nthis hunk (and dropping the other two).\n\nThanks,\nTaylor\n"},{"id":"430944","messageId":"xmqqfsw69o8m.fsf@gitster.g","threadId":"55987","inReplyTo":"YPmxsCatUIByQnig@nand.local","subject":"Re: [PATCH v3 4/5] Makefile: the \"cscope\" target always creates a \"cscope.out\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-07-22T18:50:49Z","receivedAt":"2021-07-22T18:50:52Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Taylor Blau <me@ttaylorr.com> writes:\n\n>> >  cscope.out: $(FOUND_SOURCE_FILES)\n>> > -\t$(QUIET_GEN)$(RM) cscope* && \\\n>> > -\techo $(FOUND_SOURCE_FILES) | xargs cscope -b\n>> > +\t$(QUIET_GEN)$(RM) cscope.out && \\\n>> > +\techo $(FOUND_SOURCE_FILES) | xargs cscope -f$@ -b\n>\n> But that alone is a good change in my mind at least. Then it's clear\n> that that target is responsible for generating cscope.out and nothing\n> else.\n\nProbably.  The preparatory $(RM) is close enough to the invocation\nof cscope that anybody adding other options like '-q' should be\ncareful enough to notice that the line needs to be touched, too, so\nI can be talked into thinking that $(RM) change here is a good one.\nI do not know about \"-f$@\", which is \"Meh\" to me.  Is there a good\nreason to suspect that they might want to change the default output\nfilename?\n\n> So I'd be in favor of rewording the patch message and only retaining\n> this hunk (and dropping the other two).\n\nYup.  I do not mind dropping one half of this hunk, too, but again,\nI do not mind keeping -f$@, either [*1*].\n\n\n[Footnote]\n\n*1* if the patch to add cscope support anew were done with -f$@, I\n   wouldn't have insisted removing it, out of the principle \"any Meh\n   change is not worth applying once the code was written and\n   working\".\n"},{"id":"430952","messageId":"87k0lit57x.fsf@evledraar.gmail.com","threadId":"55987","inReplyTo":"xmqqfsw69o8m.fsf@gitster.g","subject":"Re: [PATCH v3 4/5] Makefile: the \"cscope\" target always creates a \"cscope.out\"","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-07-22T21:20:25Z","receivedAt":"2021-07-22T21:21:07Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Thu, Jul 22 2021, Junio C Hamano wrote:\n\n> Taylor Blau <me@ttaylorr.com> writes:\n>\n>>> >  cscope.out: $(FOUND_SOURCE_FILES)\n>>> > -\t$(QUIET_GEN)$(RM) cscope* && \\\n>>> > -\techo $(FOUND_SOURCE_FILES) | xargs cscope -b\n>>> > +\t$(QUIET_GEN)$(RM) cscope.out && \\\n>>> > +\techo $(FOUND_SOURCE_FILES) | xargs cscope -f$@ -b\n>>\n>> But that alone is a good change in my mind at least. Then it's clear\n>> that that target is responsible for generating cscope.out and nothing\n>> else.\n>\n> Probably.  The preparatory $(RM) is close enough to the invocation\n> of cscope that anybody adding other options like '-q' should be\n> careful enough to notice that the line needs to be touched, too, so\n> I can be talked into thinking that $(RM) change here is a good one.\n> I do not know about \"-f$@\", which is \"Meh\" to me.  Is there a good\n> reason to suspect that they might want to change the default output\n> filename?\n>\n>> So I'd be in favor of rewording the patch message and only retaining\n>> this hunk (and dropping the other two).\n>\n> Yup.  I do not mind dropping one half of this hunk, too, but again,\n> I do not mind keeping -f$@, either [*1*].\n>\n>\n> [Footnote]\n>\n> *1* if the patch to add cscope support anew were done with -f$@, I\n>    wouldn't have insisted removing it, out of the principle \"any Meh\n>    change is not worth applying once the code was written and\n>    working\".\n\nAs long as we have no user of a -q flag ever, what's the point of\nforever carrying the \"rm foo*\" when we know it's foo.out, just because a\nfuture Makefile change might add foo.blah?\n\nDoesn't seem like something we'd trip over, and the .gitignore/rm rule\nis just misleading now...\n"},{"id":"431019","messageId":"YPqdQZdfR1kh0vGT@coredump.intra.peff.net","threadId":"55987","inReplyTo":"patch-5.5-f3ff76d0e98-20210721T231900Z-avarab@gmail.com","subject":"Re: [PATCH v3 5/5] Makefile: normalize clobbering & xargs for tags targets","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2021-07-23T10:43:13Z","receivedAt":"2021-07-23T10:43:16Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Jul 22, 2021 at 01:23:06AM +0200, Ævar Arnfjörð Bjarmason wrote:\n\n> This is because the xargs command may decide to invoke the program\n> multiple times. We need to make sure we've got a union of its results\n> at the end.\n> \n> For \"ctags\" and \"etags\" we used the \"-a\" flag for this, for cscope\n> that behavior is the default. Its \"-u\" flag disables its equivalent of\n> an implicit \"-a\" flag.\n\nHrm, that's not the experience I get with cscope. E.g.:\n\n  $ cscope -b wt-status.c\n  $ grep -m1 wt-status.c cscope.out\n\t@wt-status.c\n  $ cscope -b git.c\n  $ grep -m1 wt-status.c cscope.out\n  [no output]\n\nI wondered if I was being too hacky with my grep there. But if I\nsimulate more extreme cmdline-splitting like so:\n\ndiff --git a/Makefile b/Makefile\nindex c7c46c017d..8a1ec00938 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2751,7 +2751,7 @@ tags: FORCE\n \n cscope:\n \t$(RM) cscope*\n-\t$(FIND_SOURCE_FILES) | xargs cscope -b\n+\t$(FIND_SOURCE_FILES) | xargs -n1 cscope -b\n \n ### Detect prefix changes\n TRACK_PREFIX = $(bindir_SQ):$(gitexecdir_SQ):$(template_dir_SQ):$(prefix_SQ):\\\n\nthen I get a file that is much smaller (1MB versus 9MB), and fails to\nfind lots of things:\n\n  $ cscope -d -L1cmd_pack_objects\n  [no output]\n\n(by the way, I confused myself several times while testing this because\nwithout \"-d\", it will actually rebuild the index using files in the\ncurrent directory. So something like \" cscope -L1main\" gives the same\nresult in both cases, or even if you don't have a cscope.out file at\nall!)\n\nBut it really seems like cscope is not appending as we'd want. From\nskimming the manpage, I think replacing xargs with \"cscope -b -i -\"\nshould work (and seems to for me).\n\n-Peff\n"},{"id":"431020","messageId":"YPqeVnoC3mL1t8/a@coredump.intra.peff.net","threadId":"55987","inReplyTo":"YPqdQZdfR1kh0vGT@coredump.intra.peff.net","subject":"Re: [PATCH v3 5/5] Makefile: normalize clobbering & xargs for tags targets","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2021-07-23T10:47:50Z","receivedAt":"2021-07-23T10:47:57Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Jul 23, 2021 at 06:43:13AM -0400, Jeff King wrote:\n\n> On Thu, Jul 22, 2021 at 01:23:06AM +0200, Ævar Arnfjörð Bjarmason wrote:\n> \n> > This is because the xargs command may decide to invoke the program\n> > multiple times. We need to make sure we've got a union of its results\n> > at the end.\n> > \n> > For \"ctags\" and \"etags\" we used the \"-a\" flag for this, for cscope\n> > that behavior is the default. Its \"-u\" flag disables its equivalent of\n> > an implicit \"-a\" flag.\n> \n> Hrm, that's not the experience I get with cscope. E.g.:\n\nJust to make it extra clear: this is not a problem introduced by your\nseries, since we were already using xargs with cscope. But this seems\nlike a good time to fix it.\n\n-Peff\n"},{"id":"431021","messageId":"YPqeX/edrMfYbURa@coredump.intra.peff.net","threadId":"55987","inReplyTo":"cover-0.5-00000000000-20210721T231900Z-avarab@gmail.com","subject":"Re: [PATCH v3 0/5] Makefile: \"make tags\" fixes & cleanup","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2021-07-23T10:47:59Z","receivedAt":"2021-07-23T10:48:02Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Jul 22, 2021 at 01:23:01AM +0200, Ævar Arnfjörð Bjarmason wrote:\n\n> The big win here is that none of the tags targets depend on \"FORCE\"\n> anymore, so we'll only re-generate them if our sources change.\n> \n> For v2, see\n> https://lore.kernel.org/git/cover-0.5-0000000000-20210629T110837Z-avarab@gmail.com/\n> \n> This fixes the series per feedback from Jeff King and Ramsay Jones,\n> i.e:\n> \n>  * In v2 the 3/5 broke things in a way that 4/5 fixed, that's now\n>    re-arranged and fixed.\n\nThanks. Aside from some cscope appending arcana I found, these look good\nto me. I have no opinion on \"cscope*\" versus \"cscope.out\", except that\nit is not worth anybody's time to argue about. :)\n\n-Peff\n"},{"id":"431040","messageId":"xmqq4kclqchb.fsf@gitster.g","threadId":"55987","inReplyTo":"YPqeX/edrMfYbURa@coredump.intra.peff.net","subject":"Re: [PATCH v3 0/5] Makefile: \"make tags\" fixes & cleanup","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-07-23T15:25:04Z","receivedAt":"2021-07-23T15:25:08Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> Thanks. Aside from some cscope appending arcana I found, these look good\n> to me. I have no opinion on \"cscope*\" versus \"cscope.out\", except that\n> it is not worth anybody's time to argue about. :)\n\nThanks, sorry and I agree with both counts.\n"},{"id":"431087","messageId":"60fb1958b141b_1073e2089e@natae.notmuch","threadId":"55987","inReplyTo":"YPqeX/edrMfYbURa@coredump.intra.peff.net","subject":"Re: [PATCH v3 0/5] Makefile: \"make tags\" fixes & cleanup","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2021-07-23T19:32:40Z","receivedAt":"2021-07-23T19:32:45Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Jeff King wrote:\n> On Thu, Jul 22, 2021 at 01:23:01AM +0200, Ævar Arnfjörð Bjarmason wrote:\n> \n> > The big win here is that none of the tags targets depend on \"FORCE\"\n> > anymore, so we'll only re-generate them if our sources change.\n> > \n> > For v2, see\n> > https://lore.kernel.org/git/cover-0.5-0000000000-20210629T110837Z-avarab@gmail.com/\n> > \n> > This fixes the series per feedback from Jeff King and Ramsay Jones,\n> > i.e:\n> > \n> >  * In v2 the 3/5 broke things in a way that 4/5 fixed, that's now\n> >    re-arranged and fixed.\n> \n> Thanks. Aside from some cscope appending arcana I found, these look good\n> to me. I have no opinion on \"cscope*\" versus \"cscope.out\", except that\n> it is not worth anybody's time to argue about. :)\n\nI agree with that as well.\n\n-- \nFelipe Contreras"},{"id":"431089","messageId":"60fb1b7caaf7d_1073e20833@natae.notmuch","threadId":"55987","inReplyTo":"cover-0.5-00000000000-20210721T231900Z-avarab@gmail.com","subject":"RE: [PATCH v3 0/5] Makefile: \"make tags\" fixes & cleanup","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2021-07-23T19:41:48Z","receivedAt":"2021-07-23T19:41:52Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Ævar Arnfjörð Bjarmason wrote:\n> The big win here is that none of the tags targets depend on \"FORCE\"\n> anymore, so we'll only re-generate them if our sources change.\n\nVery nice.\n\nI think most of the nitpicking in the comments is not really worth the\ntrouble (either for or against), there is one comment from Jeff King\nregarding multiple runs of the xargs command that I think is valid, but\ntoo hypothetical for me to care about (ARG_MAX is 2097152 on my system),\nso it would be nice to fix, but not necessary.\n\nReviewed-by: Felipe Contreras <felipe.contreras@gmail.com>\n\n-- \nFelipe Contreras"},{"id":"432002","messageId":"cover-v4-0.5-00000000000-20210804T225222Z-avarab@gmail.com","threadId":"55987","inReplyTo":"cover-0.5-00000000000-20210721T231900Z-avarab@gmail.com","subject":"[PATCH v4 0/5] Makefile: \"make tags\" fixes & cleanup","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-08-04T22:54:35Z","receivedAt":"2021-08-04T22:54:48Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"The big win here is that none of the tags targets depend on \"FORCE\"\nanymore, so we'll only re-generate them if our sources change.\n\nFor v3, see:\nhttps://lore.kernel.org/git/cover-0.5-00000000000-20210721T231900Z-avarab@gmail.com/\n\nThis addresses the feedback about the cscope* v.s. cscope.out rule in\n.gitignore and \"make clean\", i.e. those rules are not being changed\nanymore. I also changed a stray cscope.out to $@ in 4/5, which was\nmissed in v3.\n\nÆvar Arnfjörð Bjarmason (5):\n  Makefile: move \".PHONY: cscope\" near its target\n  Makefile: add QUIET_GEN to \"cscope\" target\n  Makefile: don't use \"FORCE\" for tags targets\n  Makefile: remove \"cscope.out\", not \"cscope*\" in cscope.out target\n  Makefile: normalize clobbering & xargs for tags targets\n\n Makefile | 32 +++++++++++++++++++-------------\n 1 file changed, 19 insertions(+), 13 deletions(-)\n\nRange-diff against v3:\n1:  6b4ddc126d9 = 1:  2ee725e2fba Makefile: move \".PHONY: cscope\" near its target\n2:  d3d5d332e92 = 2:  2122cb25633 Makefile: add QUIET_GEN to \"cscope\" target\n3:  9dd69d68178 = 3:  8649716772b Makefile: don't use \"FORCE\" for tags targets\n4:  f8d151f1f6a ! 4:  643c514e12a Makefile: the \"cscope\" target always creates a \"cscope.out\"\n    @@ Metadata\n     Author: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n     \n      ## Commit message ##\n    -    Makefile: the \"cscope\" target always creates a \"cscope.out\"\n    +    Makefile: remove \"cscope.out\", not \"cscope*\" in cscope.out target\n     \n    -    In the preceding commit the \"cscope\" target was changed to be a phony\n    -    alias for the \"cscope.out\" target.\n    +    Before we generate a \"cscope.out\" file, remove that file explicitly,\n    +    and not everything matching \"cscope*\". This doesn't change any\n    +    behavior of the Makefile in practice, but makes this rule less\n    +    confusing, and consistent with other similar rules.\n     \n         The cscope target was added in a2a9150bf06 (makefile: Add a cscope\n    -    target, 2007-10-06), and has always referred to cscope* instead of to\n    -    cscope.out.\n    +    target, 2007-10-06). It has always referred to cscope* instead of to\n    +    cscope.out in .gitignore and the \"clean\" target, even though we only\n    +    ever generated a cscope.out file.\n     \n    -    As far as I can tell this ambiguity was never needed. The\n    -    \"-fcscope.out\" (note, no whitespace) argument is enabled by default,\n    -    but let's provide it explicitly for good measure.\n    +    This was seemingly done to aid use-cases where someone invoked cscope\n    +    with the \"-q\" flag, which would make it create a \"cscope.in.out\" and\n    +    \"cscope.po.out\" files in addition to \"cscope.out\".\n     \n    -    Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n    +    But us removing those files we never generated is confusing, so let's\n    +    only remove the file we need to, furthermore let's use the \"-f\" flag\n    +    to explicitly name the cscope.out file, even though it's the default\n    +    if not \"-f\" argument is supplied.\n    +\n    +    It is somewhat inconsistent to change from the glob here but not in\n    +    the \"clean\" rule and .gitignore, an earlier version of this change\n    +    updated those as well, but see [1][2] for why they were kept.\n     \n    - ## .gitignore ##\n    -@@\n    - /.vscode/\n    - /tags\n    - /TAGS\n    --/cscope*\n    -+/cscope.out\n    - /compile_commands.json\n    - *.hcc\n    - *.obj\n    +    1. https://lore.kernel.org/git/87k0lit57x.fsf@evledraar.gmail.com/\n    +    2. https://lore.kernel.org/git/87im0kn983.fsf@evledraar.gmail.com/\n    +\n    +    Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n     \n      ## Makefile ##\n     @@ Makefile: tags: $(FOUND_SOURCE_FILES)\n    @@ Makefile: tags: $(FOUND_SOURCE_FILES)\n      cscope.out: $(FOUND_SOURCE_FILES)\n     -\t$(QUIET_GEN)$(RM) cscope* && \\\n     -\techo $(FOUND_SOURCE_FILES) | xargs cscope -b\n    -+\t$(QUIET_GEN)$(RM) cscope.out && \\\n    ++\t$(QUIET_GEN)$(RM) $@ && \\\n     +\techo $(FOUND_SOURCE_FILES) | xargs cscope -f$@ -b\n      \n      .PHONY: cscope\n      cscope: cscope.out\n    -@@ Makefile: clean: profile-clean coverage-clean cocciclean\n    - \t$(RM) $(HCC)\n    - \t$(RM) -r bin-wrappers $(dep_dirs) $(compdb_dir) compile_commands.json\n    - \t$(RM) -r po/build/\n    --\t$(RM) *.pyc *.pyo */*.pyc */*.pyo $(GENERATED_H) $(ETAGS_TARGET) tags cscope*\n    -+\t$(RM) *.pyc *.pyo */*.pyc */*.pyo $(GENERATED_H) $(ETAGS_TARGET) tags cscope.out\n    - \t$(RM) -r .dist-tmp-dir .doc-tmp-dir\n    - \t$(RM) $(GIT_TARNAME).tar.gz\n    - \t$(RM) $(htmldocs).tar.gz $(manpages).tar.gz\n5:  f3ff76d0e98 ! 5:  1eaf3416329 Makefile: normalize clobbering & xargs for tags targets\n    @@ Makefile: FIND_SOURCE_FILES = ( \\\n     +\tmv $@+ $@\n      \n      cscope.out: $(FOUND_SOURCE_FILES)\n    --\t$(QUIET_GEN)$(RM) cscope.out && \\\n    +-\t$(QUIET_GEN)$(RM) $@ && \\\n     -\techo $(FOUND_SOURCE_FILES) | xargs cscope -f$@ -b\n     +\t$(QUIET_GEN)$(RM) $@+ && \\\n     +\techo $(FOUND_SOURCE_FILES) | xargs cscope -f$@+ -b && \\\n-- \n2.33.0.rc0.597.gc569a812f0a\n\n"},{"id":"432003","messageId":"patch-v4-1.5-2ee725e2fba-20210804T225222Z-avarab@gmail.com","threadId":"55987","inReplyTo":"cover-v4-0.5-00000000000-20210804T225222Z-avarab@gmail.com","subject":"[PATCH v4 1/5] Makefile: move \".PHONY: cscope\" near its target","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-08-04T22:54:36Z","receivedAt":"2021-08-04T22:54:49Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Move the \".PHONY: cscope\" rule to live alongside the \"cscope\" target\nitself, not to be all the way near the bottom where we define the\n\"FORCE\" rule.\n\nThat line was last modified in 2f76919517e (MinGW: avoid collisions\nbetween \"tags\" and \"TAGS\", 2010-09-28).\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n Makefile | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/Makefile b/Makefile\nindex 9573190f1d7..671dde5c7a1 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2756,6 +2756,7 @@ tags: FORCE\n \t$(FIND_SOURCE_FILES) | xargs ctags -a -o tags+ && \\\n \tmv tags+ tags\n \n+.PHONY: cscope\n cscope:\n \t$(RM) cscope*\n \t$(FIND_SOURCE_FILES) | xargs cscope -b\n@@ -3267,7 +3268,7 @@ endif\n \n .PHONY: all install profile-clean cocciclean clean strip\n .PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell\n-.PHONY: FORCE cscope\n+.PHONY: FORCE\n \n ### Check documentation\n #\n-- \n2.33.0.rc0.597.gc569a812f0a\n\n"},{"id":"432004","messageId":"patch-v4-2.5-2122cb25633-20210804T225222Z-avarab@gmail.com","threadId":"55987","inReplyTo":"cover-v4-0.5-00000000000-20210804T225222Z-avarab@gmail.com","subject":"[PATCH v4 2/5] Makefile: add QUIET_GEN to \"cscope\" target","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-08-04T22:54:37Z","receivedAt":"2021-08-04T22:54:50Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Don't show the very verbose $(FIND_SOURCE_FILES) command on every\n\"make cscope\" invocation.\n\nSee my recent 3c80fcb591 (Makefile: add QUIET_GEN to \"tags\" and \"TAGS\"\ntargets, 2021-03-28) for the same fix for the other adjacent targets.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n Makefile | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/Makefile b/Makefile\nindex 671dde5c7a1..59c2e98795b 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2758,7 +2758,7 @@ tags: FORCE\n \n .PHONY: cscope\n cscope:\n-\t$(RM) cscope*\n+\t$(QUIET_GEN)$(RM) cscope* && \\\n \t$(FIND_SOURCE_FILES) | xargs cscope -b\n \n ### Detect prefix changes\n-- \n2.33.0.rc0.597.gc569a812f0a\n\n"},{"id":"432005","messageId":"patch-v4-3.5-8649716772b-20210804T225222Z-avarab@gmail.com","threadId":"55987","inReplyTo":"cover-v4-0.5-00000000000-20210804T225222Z-avarab@gmail.com","subject":"[PATCH v4 3/5] Makefile: don't use \"FORCE\" for tags targets","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-08-04T22:54:38Z","receivedAt":"2021-08-04T22:54:51Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Remove the \"FORCE\" dependency from the \"tags\", \"TAGS\" and \"cscope\"\ntargets, instead make them depend on whether or not the relevant\nsource files have changed.\n\nFor the cscope target we need to change it to depend on the actual\ngenerated file while we generate while we're at it, as the next commit\nwill discuss we always generate a cscope.out file.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n Makefile | 20 ++++++++++++--------\n 1 file changed, 12 insertions(+), 8 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 59c2e98795b..d1012cf71d2 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2746,20 +2746,24 @@ FIND_SOURCE_FILES = ( \\\n \t\t| sed -e 's|^\\./||' \\\n \t)\n \n-$(ETAGS_TARGET): FORCE\n+FOUND_SOURCE_FILES = $(shell $(FIND_SOURCE_FILES))\n+\n+$(ETAGS_TARGET): $(FOUND_SOURCE_FILES)\n \t$(QUIET_GEN)$(RM) \"$(ETAGS_TARGET)+\" && \\\n-\t$(FIND_SOURCE_FILES) | xargs etags -a -o \"$(ETAGS_TARGET)+\" && \\\n+\techo $(FOUND_SOURCE_FILES) | xargs etags -a -o \"$(ETAGS_TARGET)+\" && \\\n \tmv \"$(ETAGS_TARGET)+\" \"$(ETAGS_TARGET)\"\n \n-tags: FORCE\n+tags: $(FOUND_SOURCE_FILES)\n \t$(QUIET_GEN)$(RM) tags+ && \\\n-\t$(FIND_SOURCE_FILES) | xargs ctags -a -o tags+ && \\\n+\techo $(FOUND_SOURCE_FILES) | xargs ctags -a -o tags+ && \\\n \tmv tags+ tags\n \n-.PHONY: cscope\n-cscope:\n+cscope.out: $(FOUND_SOURCE_FILES)\n \t$(QUIET_GEN)$(RM) cscope* && \\\n-\t$(FIND_SOURCE_FILES) | xargs cscope -b\n+\techo $(FOUND_SOURCE_FILES) | xargs cscope -b\n+\n+.PHONY: cscope\n+cscope: cscope.out\n \n ### Detect prefix changes\n TRACK_PREFIX = $(bindir_SQ):$(gitexecdir_SQ):$(template_dir_SQ):$(prefix_SQ):\\\n@@ -2943,7 +2947,7 @@ check: config-list.h command-list.h\n \t\texit 1; \\\n \tfi\n \n-FOUND_C_SOURCES = $(filter %.c,$(shell $(FIND_SOURCE_FILES)))\n+FOUND_C_SOURCES = $(filter %.c,$(FOUND_SOURCE_FILES))\n COCCI_SOURCES = $(filter-out $(THIRD_PARTY_SOURCES),$(FOUND_C_SOURCES))\n \n %.cocci.patch: %.cocci $(COCCI_SOURCES)\n-- \n2.33.0.rc0.597.gc569a812f0a\n\n"},{"id":"432006","messageId":"patch-v4-4.5-643c514e12a-20210804T225222Z-avarab@gmail.com","threadId":"55987","inReplyTo":"cover-v4-0.5-00000000000-20210804T225222Z-avarab@gmail.com","subject":"[PATCH v4 4/5] Makefile: remove \"cscope.out\", not \"cscope*\" in cscope.out target","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-08-04T22:54:39Z","receivedAt":"2021-08-04T22:54:51Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Before we generate a \"cscope.out\" file, remove that file explicitly,\nand not everything matching \"cscope*\". This doesn't change any\nbehavior of the Makefile in practice, but makes this rule less\nconfusing, and consistent with other similar rules.\n\nThe cscope target was added in a2a9150bf06 (makefile: Add a cscope\ntarget, 2007-10-06). It has always referred to cscope* instead of to\ncscope.out in .gitignore and the \"clean\" target, even though we only\never generated a cscope.out file.\n\nThis was seemingly done to aid use-cases where someone invoked cscope\nwith the \"-q\" flag, which would make it create a \"cscope.in.out\" and\n\"cscope.po.out\" files in addition to \"cscope.out\".\n\nBut us removing those files we never generated is confusing, so let's\nonly remove the file we need to, furthermore let's use the \"-f\" flag\nto explicitly name the cscope.out file, even though it's the default\nif not \"-f\" argument is supplied.\n\nIt is somewhat inconsistent to change from the glob here but not in\nthe \"clean\" rule and .gitignore, an earlier version of this change\nupdated those as well, but see [1][2] for why they were kept.\n\n1. https://lore.kernel.org/git/87k0lit57x.fsf@evledraar.gmail.com/\n2. https://lore.kernel.org/git/87im0kn983.fsf@evledraar.gmail.com/\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n Makefile | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex d1012cf71d2..2a176ba5742 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2759,8 +2759,8 @@ tags: $(FOUND_SOURCE_FILES)\n \tmv tags+ tags\n \n cscope.out: $(FOUND_SOURCE_FILES)\n-\t$(QUIET_GEN)$(RM) cscope* && \\\n-\techo $(FOUND_SOURCE_FILES) | xargs cscope -b\n+\t$(QUIET_GEN)$(RM) $@ && \\\n+\techo $(FOUND_SOURCE_FILES) | xargs cscope -f$@ -b\n \n .PHONY: cscope\n cscope: cscope.out\n-- \n2.33.0.rc0.597.gc569a812f0a\n\n"},{"id":"432007","messageId":"patch-v4-5.5-1eaf3416329-20210804T225222Z-avarab@gmail.com","threadId":"55987","inReplyTo":"cover-v4-0.5-00000000000-20210804T225222Z-avarab@gmail.com","subject":"[PATCH v4 5/5] Makefile: normalize clobbering & xargs for tags targets","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-08-04T22:54:40Z","receivedAt":"2021-08-04T22:54:53Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Since the \"tags\", \"TAGS\" and \"cscope.out\" targets rely on piping into\nxargs with an \"echo <list> | xargs\" pattern, we need to make sure\nwe're in an append mode.\n\nUnlike my recent change to make use of \".DELETE_ON_ERROR\" in\n7b76d6bf221 (Makefile: add and use the \".DELETE_ON_ERROR\" flag,\n2021-06-29), we really do need the \"rm $@+\" at the beginning (note,\nnot \"rm $@\").\n\nThis is because the xargs command may decide to invoke the program\nmultiple times. We need to make sure we've got a union of its results\nat the end.\n\nFor \"ctags\" and \"etags\" we used the \"-a\" flag for this, for cscope\nthat behavior is the default. Its \"-u\" flag disables its equivalent of\nan implicit \"-a\" flag.\n\nLet's also consistently use the $@ and $@+ names instead of needlessly\nhardcoding or referring to more verbose names in the \"tags\" and \"TAGS\"\nrules.\n\nThese targets could perhaps be improved in the future by factoring\nthis \"echo <list> | xargs\" pattern so that we make intermediate tags\nfiles for each source file, and then assemble them into one \"tags\"\nfile at the end.\n\nThe etags manual page suggests that doing that (or perhaps just\n--update) might be counter-productive, in any case, the tag building\nis fast enough for me, so I'm leaving that for now.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n Makefile | 17 +++++++++--------\n 1 file changed, 9 insertions(+), 8 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 2a176ba5742..1ad7a685d10 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2749,18 +2749,19 @@ FIND_SOURCE_FILES = ( \\\n FOUND_SOURCE_FILES = $(shell $(FIND_SOURCE_FILES))\n \n $(ETAGS_TARGET): $(FOUND_SOURCE_FILES)\n-\t$(QUIET_GEN)$(RM) \"$(ETAGS_TARGET)+\" && \\\n-\techo $(FOUND_SOURCE_FILES) | xargs etags -a -o \"$(ETAGS_TARGET)+\" && \\\n-\tmv \"$(ETAGS_TARGET)+\" \"$(ETAGS_TARGET)\"\n+\t$(QUIET_GEN)$(RM) $@+ && \\\n+\techo $(FOUND_SOURCE_FILES) | xargs etags -a -o $@+ && \\\n+\tmv $@+ $@\n \n tags: $(FOUND_SOURCE_FILES)\n-\t$(QUIET_GEN)$(RM) tags+ && \\\n-\techo $(FOUND_SOURCE_FILES) | xargs ctags -a -o tags+ && \\\n-\tmv tags+ tags\n+\t$(QUIET_GEN)$(RM) $@+ && \\\n+\techo $(FOUND_SOURCE_FILES) | xargs ctags -a -o $@+ && \\\n+\tmv $@+ $@\n \n cscope.out: $(FOUND_SOURCE_FILES)\n-\t$(QUIET_GEN)$(RM) $@ && \\\n-\techo $(FOUND_SOURCE_FILES) | xargs cscope -f$@ -b\n+\t$(QUIET_GEN)$(RM) $@+ && \\\n+\techo $(FOUND_SOURCE_FILES) | xargs cscope -f$@+ -b && \\\n+\tmv $@+ $@\n \n .PHONY: cscope\n cscope: cscope.out\n-- \n2.33.0.rc0.597.gc569a812f0a\n\n"}]}