{"thread":{"id":"52838","subject":"[PATCH] doc-diff: use single-colon rule in rendering Makefile","startedAt":"2020-02-18T21:40:13Z","lastAt":"2020-02-18T21:40:13Z","messageCount":1,"participants":["Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"392026","messageId":"20200218214009.GA53188@coredump.intra.peff.net","threadId":"52838","inReplyTo":null,"subject":"[PATCH] doc-diff: use single-colon rule in rendering Makefile","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2020-02-18T21:40:09Z","receivedAt":"2020-02-18T21:40:13Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"When rendering the troff manpages to text via \"man\", we create an ad-hoc\nMakefile and feed it to \"make\". The purpose here is two-fold:\n\n  - reuse results from a prior interrupted render of the same tree\n\n  - use make's -j option to build in parallel\n\nBut the second part doesn't seem to work (at least with my version of\nGNU make, 4.2.1). It just runs one render at a time.\n\nWe use a double-colon \"all\" rule for each file, like:\n\n  all:: foo\n  foo:\n    ...actual render recipe...\n  all:: bar\n  bar:\n    ...actual render recipe...\n  ...and so on...\n\nAnd it's this double-colon that seems to inhibit the parallelism. We can\njust switch to a regular single-colon rule. Even though we do have\nmultiple rules for \"all\" here, we don't have any recipe to execute for\n\"all\" (we only care about triggering its dependencies), so the\ndistinction is irrelevant.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\nThis has been bugging me for a while. I'm not sure if it never worked\nand I didn't notice, or if it changed in some version of make.\n\n Documentation/doc-diff | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/Documentation/doc-diff b/Documentation/doc-diff\nindex 88a9b20168..1694300e50 100755\n--- a/Documentation/doc-diff\n+++ b/Documentation/doc-diff\n@@ -127,7 +127,7 @@ generate_render_makefile () {\n \twhile read src\n \tdo\n \t\tdst=$2/${src#$1/}\n-\t\tprintf 'all:: %s\\n' \"$dst\"\n+\t\tprintf 'all: %s\\n' \"$dst\"\n \t\tprintf '%s: %s\\n' \"$dst\" \"$src\"\n \t\tprintf '\\t@echo >&2 \"  RENDER $(notdir $@)\" && \\\\\\n'\n \t\tprintf '\\tmkdir -p $(dir $@) && \\\\\\n'\n-- \n2.25.1.795.g3fd338b409\n"}]}