{"thread":{"id":"54582","subject":"[PATCH 3/8] gitweb/Makefile: conditionally include ../GIT-VERSION-FILE","startedAt":"2020-11-05T21:05:17Z","lastAt":"2020-11-05T21:05:17Z","messageCount":1,"participants":["Ramsay Jones"],"isPatch":true,"patchVersion":1,"patchTotal":8},"messages":[{"id":"409224","messageId":"7f4f6db9-2573-6b7c-7858-7457fd2575de@ramsayjones.plus.com","threadId":"54582","inReplyTo":null,"subject":"[PATCH 3/8] gitweb/Makefile: conditionally include ../GIT-VERSION-FILE","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2020-11-05T21:05:10Z","receivedAt":"2020-11-05T21:05:17Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nThe 'clean' target is still noticeably slow on cygwin, despite the\nimprovements made by previous patches. For example, the second\ninvocation of 'make clean' below:\n\n  $ make clean >/dev/null 2>&1\n  $ make clean\n  ...\n  make[1]: Entering directory '/home/ramsay/git/gitweb'\n  make[2]: Entering directory '/home/ramsay/git'\n  make[2]: 'GIT-VERSION-FILE' is up to date.\n  make[2]: Leaving directory '/home/ramsay/git'\n  ...\n  $\n\nhas been timed at 10.361s on my laptop (on old core i5-4200M @ 2.50GHz,\n8GB RAM, 1TB HDD).\n\nNotice that the 'clean' target is making a nested call to the parent\nMakefile to ensure that the GIT-VERSION-FILE is up-to-date. This is to\nensure that the $(GIT_VERSION) make variable is set, once that file had\nbeen included. However, the 'clean' target does not use the $(GIT_VERSION)\nvariable, so this is wasted effort.\n\nIn order to eliminate such wasted effort, use the value of the internal\n$(MAKECMDGOALS) variable to only '-include ../GIT-VERSION-FILE' when the\ntarget is not 'clean'. (This drops the time down to 8.430s, on my laptop,\ngiving an improvement of 18.64%).\n\nSigned-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>\n---\n gitweb/Makefile | 2 ++\n 1 file changed, 2 insertions(+)\n\ndiff --git a/gitweb/Makefile b/gitweb/Makefile\nindex cd194d057f..f13e23c4de 100644\n--- a/gitweb/Makefile\n+++ b/gitweb/Makefile\n@@ -48,7 +48,9 @@ HIGHLIGHT_BIN = highlight\n ../GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE\n \t$(QUIET_SUBDIR0)../ $(QUIET_SUBDIR1) GIT-VERSION-FILE\n \n+ifneq ($(MAKECMDGOALS),clean)\n -include ../GIT-VERSION-FILE\n+endif\n \n ### Build rules\n \n-- \n2.29.0\n"}]}