{"thread":{"id":"39454","subject":"[PATCH 0/3] fix minor Makefile annoyances","startedAt":"2015-05-29T07:21:19Z","lastAt":"2015-05-29T07:26:48Z","messageCount":4,"participants":["Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"262390","messageId":"20150529072119.GA5415@peff.net","threadId":"39454","inReplyTo":null,"subject":"[PATCH 0/3] fix minor Makefile annoyances","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2015-05-29T07:21:19Z","receivedAt":"2015-05-29T07:21:19Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"I've noticed that running \"make\" on a fully-built git tree still builds\na lot of things:\n\n  $ make >/dev/null 2>&1 && make\n      GEN perl/PM.stamp\n      SUBDIR gitweb\n      GEN git-add--interactive\n      GEN git-difftool\n      GEN git-archimport\n      GEN git-cvsexportcommit\n      GEN git-cvsimport\n      GEN git-cvsserver\n      GEN git-relink\n      GEN git-send-email\n      GEN git-svn\n      GEN git-p4\n      SUBDIR ../\n  make[2]: 'GIT-VERSION-FILE' is up to date.\n      GEN git-instaweb\n      SUBDIR perl\n      SUBDIR templates\n\nHere it is after this series:\n\n  $ make >/dev/null 2>&1 && make\n      SUBDIR perl\n      SUBDIR templates\n\nThe patches are:\n\n  [1/3]: Makefile: drop dependency between git-instaweb and gitweb\n  [2/3]: Makefile: avoid timestamp updates to GIT-BUILD-OPTIONS\n  [3/3]: Makefile: silence perl/PM.stamp recipe\n\n-Peff\n"},{"id":"262392","messageId":"20150529072545.GA9670@peff.net","threadId":"39454","inReplyTo":"20150529072119.GA5415@peff.net","subject":"[PATCH 1/3] Makefile: drop dependency between git-instaweb and gitweb","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2015-05-29T07:25:45Z","receivedAt":"2015-05-29T07:25:45Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"The rule for \"git-instaweb\" depends on \"gitweb\". This makes\nno sense, because:\n\n  1. git-instaweb has no build-time dependency on gitweb; it\n     is a run-time dependency\n\n  2. gitweb is a directory that we want to recursively make\n     in. As a result, its recipe is marked .PHONY, which\n     causes \"make\" to rebuild git-instaweb every time it is\n     run.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\nNote that this actually means we won't build \"gitweb\" at all with just\n\"make\". It's possible that might break somebody's packaging script that\ndoes:\n\n  make &&\n  cp gitweb/gitweb /some/place\n\nI'm not incredibly concerned with that, as it was only being built as a\nbizarre side effect here, and they should probably be doing \"make\ngitweb\" (or \"cd gitweb && make\") if that's what they want to build.\n\nBut if we do want to build it by default, we can add it into the \"all::\"\nrule, as we do for \"templates\".\n\n Makefile | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/Makefile b/Makefile\nindex 323c401..6283353 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1784,7 +1784,7 @@ GIT-PERL-DEFINES: FORCE\n gitweb:\n \t$(QUIET_SUBDIR0)gitweb $(QUIET_SUBDIR1) all\n \n-git-instaweb: git-instaweb.sh gitweb GIT-SCRIPT-DEFINES\n+git-instaweb: git-instaweb.sh GIT-SCRIPT-DEFINES\n \t$(QUIET_GEN)$(cmd_munge_script) && \\\n \tchmod +x $@+ && \\\n \tmv $@+ $@\n-- \n2.4.2.668.gc3b1ade.dirty\n"},{"id":"262393","messageId":"20150529072630.GB9670@peff.net","threadId":"39454","inReplyTo":"20150529072119.GA5415@peff.net","subject":"[PATCH 2/3] Makefile: avoid timestamp updates to GIT-BUILD-OPTIONS","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2015-05-29T07:26:30Z","receivedAt":"2015-05-29T07:26:30Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"We force the GIT-BUILD-OPTIONS recipe to run every time\n\"make\" is invoked. We must do this to catch new options\nwhich may have come from the command-line or environment.\n\nHowever, we actually update the file's timestamp each time\nthe recipe is run, whether anything changed or not. As a\nresult, any files which depend on it (for example, all of\nthe perl scripts, which need to know whether NO_PERL was\nset) will be re-built every time.\n\nLet's do our usual trick of writing to a tempfile, then\ndoing a \"cmp || mv\" to update the file only when something\nchanged.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n Makefile | 45 +++++++++++++++++++++++----------------------\n 1 file changed, 23 insertions(+), 22 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 6283353..6b4fbeb 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2103,46 +2103,47 @@ GIT-LDFLAGS: FORCE\n # that runs GIT-BUILD-OPTIONS, and then again to protect it\n # and the first level quoting from the shell that runs \"echo\".\n GIT-BUILD-OPTIONS: FORCE\n-\t@echo SHELL_PATH=\\''$(subst ','\\'',$(SHELL_PATH_SQ))'\\' >$@\n-\t@echo PERL_PATH=\\''$(subst ','\\'',$(PERL_PATH_SQ))'\\' >>$@\n-\t@echo DIFF=\\''$(subst ','\\'',$(subst ','\\'',$(DIFF)))'\\' >>$@\n-\t@echo PYTHON_PATH=\\''$(subst ','\\'',$(PYTHON_PATH_SQ))'\\' >>$@\n-\t@echo TAR=\\''$(subst ','\\'',$(subst ','\\'',$(TAR)))'\\' >>$@\n-\t@echo NO_CURL=\\''$(subst ','\\'',$(subst ','\\'',$(NO_CURL)))'\\' >>$@\n-\t@echo NO_EXPAT=\\''$(subst ','\\'',$(subst ','\\'',$(NO_EXPAT)))'\\' >>$@\n-\t@echo USE_LIBPCRE=\\''$(subst ','\\'',$(subst ','\\'',$(USE_LIBPCRE)))'\\' >>$@\n-\t@echo NO_PERL=\\''$(subst ','\\'',$(subst ','\\'',$(NO_PERL)))'\\' >>$@\n-\t@echo NO_PYTHON=\\''$(subst ','\\'',$(subst ','\\'',$(NO_PYTHON)))'\\' >>$@\n-\t@echo NO_UNIX_SOCKETS=\\''$(subst ','\\'',$(subst ','\\'',$(NO_UNIX_SOCKETS)))'\\' >>$@\n+\t@echo SHELL_PATH=\\''$(subst ','\\'',$(SHELL_PATH_SQ))'\\' >$@+\n+\t@echo PERL_PATH=\\''$(subst ','\\'',$(PERL_PATH_SQ))'\\' >>$@+\n+\t@echo DIFF=\\''$(subst ','\\'',$(subst ','\\'',$(DIFF)))'\\' >>$@+\n+\t@echo PYTHON_PATH=\\''$(subst ','\\'',$(PYTHON_PATH_SQ))'\\' >>$@+\n+\t@echo TAR=\\''$(subst ','\\'',$(subst ','\\'',$(TAR)))'\\' >>$@+\n+\t@echo NO_CURL=\\''$(subst ','\\'',$(subst ','\\'',$(NO_CURL)))'\\' >>$@+\n+\t@echo NO_EXPAT=\\''$(subst ','\\'',$(subst ','\\'',$(NO_EXPAT)))'\\' >>$@+\n+\t@echo USE_LIBPCRE=\\''$(subst ','\\'',$(subst ','\\'',$(USE_LIBPCRE)))'\\' >>$@+\n+\t@echo NO_PERL=\\''$(subst ','\\'',$(subst ','\\'',$(NO_PERL)))'\\' >>$@+\n+\t@echo NO_PYTHON=\\''$(subst ','\\'',$(subst ','\\'',$(NO_PYTHON)))'\\' >>$@+\n+\t@echo NO_UNIX_SOCKETS=\\''$(subst ','\\'',$(subst ','\\'',$(NO_UNIX_SOCKETS)))'\\' >>$@+\n ifdef TEST_OUTPUT_DIRECTORY\n-\t@echo TEST_OUTPUT_DIRECTORY=\\''$(subst ','\\'',$(subst ','\\'',$(TEST_OUTPUT_DIRECTORY)))'\\' >>$@\n+\t@echo TEST_OUTPUT_DIRECTORY=\\''$(subst ','\\'',$(subst ','\\'',$(TEST_OUTPUT_DIRECTORY)))'\\' >>$@+\n endif\n ifdef GIT_TEST_OPTS\n-\t@echo GIT_TEST_OPTS=\\''$(subst ','\\'',$(subst ','\\'',$(GIT_TEST_OPTS)))'\\' >>$@\n+\t@echo GIT_TEST_OPTS=\\''$(subst ','\\'',$(subst ','\\'',$(GIT_TEST_OPTS)))'\\' >>$@+\n endif\n ifdef GIT_TEST_CMP\n-\t@echo GIT_TEST_CMP=\\''$(subst ','\\'',$(subst ','\\'',$(GIT_TEST_CMP)))'\\' >>$@\n+\t@echo GIT_TEST_CMP=\\''$(subst ','\\'',$(subst ','\\'',$(GIT_TEST_CMP)))'\\' >>$@+\n endif\n ifdef GIT_TEST_CMP_USE_COPIED_CONTEXT\n-\t@echo GIT_TEST_CMP_USE_COPIED_CONTEXT=YesPlease >>$@\n+\t@echo GIT_TEST_CMP_USE_COPIED_CONTEXT=YesPlease >>$@+\n endif\n-\t@echo NO_GETTEXT=\\''$(subst ','\\'',$(subst ','\\'',$(NO_GETTEXT)))'\\' >>$@\n-\t@echo GETTEXT_POISON=\\''$(subst ','\\'',$(subst ','\\'',$(GETTEXT_POISON)))'\\' >>$@\n+\t@echo NO_GETTEXT=\\''$(subst ','\\'',$(subst ','\\'',$(NO_GETTEXT)))'\\' >>$@+\n+\t@echo GETTEXT_POISON=\\''$(subst ','\\'',$(subst ','\\'',$(GETTEXT_POISON)))'\\' >>$@+\n ifdef GIT_PERF_REPEAT_COUNT\n-\t@echo GIT_PERF_REPEAT_COUNT=\\''$(subst ','\\'',$(subst ','\\'',$(GIT_PERF_REPEAT_COUNT)))'\\' >>$@\n+\t@echo GIT_PERF_REPEAT_COUNT=\\''$(subst ','\\'',$(subst ','\\'',$(GIT_PERF_REPEAT_COUNT)))'\\' >>$@+\n endif\n ifdef GIT_PERF_REPO\n-\t@echo GIT_PERF_REPO=\\''$(subst ','\\'',$(subst ','\\'',$(GIT_PERF_REPO)))'\\' >>$@\n+\t@echo GIT_PERF_REPO=\\''$(subst ','\\'',$(subst ','\\'',$(GIT_PERF_REPO)))'\\' >>$@+\n endif\n ifdef GIT_PERF_LARGE_REPO\n-\t@echo GIT_PERF_LARGE_REPO=\\''$(subst ','\\'',$(subst ','\\'',$(GIT_PERF_LARGE_REPO)))'\\' >>$@\n+\t@echo GIT_PERF_LARGE_REPO=\\''$(subst ','\\'',$(subst ','\\'',$(GIT_PERF_LARGE_REPO)))'\\' >>$@+\n endif\n ifdef GIT_PERF_MAKE_OPTS\n-\t@echo GIT_PERF_MAKE_OPTS=\\''$(subst ','\\'',$(subst ','\\'',$(GIT_PERF_MAKE_OPTS)))'\\' >>$@\n+\t@echo GIT_PERF_MAKE_OPTS=\\''$(subst ','\\'',$(subst ','\\'',$(GIT_PERF_MAKE_OPTS)))'\\' >>$@+\n endif\n ifdef TEST_GIT_INDEX_VERSION\n-\t@echo TEST_GIT_INDEX_VERSION=\\''$(subst ','\\'',$(subst ','\\'',$(TEST_GIT_INDEX_VERSION)))'\\' >>$@\n+\t@echo TEST_GIT_INDEX_VERSION=\\''$(subst ','\\'',$(subst ','\\'',$(TEST_GIT_INDEX_VERSION)))'\\' >>$@+\n endif\n+\t@if cmp $@+ $@ >/dev/null 2>&1; then $(RM) $@+; else mv $@+ $@; fi\n \n ### Detect Python interpreter path changes\n ifndef NO_PYTHON\n-- \n2.4.2.668.gc3b1ade.dirty\n"},{"id":"262394","messageId":"20150529072648.GC9670@peff.net","threadId":"39454","inReplyTo":"20150529072119.GA5415@peff.net","subject":"[PATCH 3/3] Makefile: silence perl/PM.stamp recipe","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2015-05-29T07:26:48Z","receivedAt":"2015-05-29T07:26:48Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"Every time we run \"make\", we update perl/PM.stamp, which\ncontains a list of all of the perl module files (if it's\nupdated, we need to rebuild perl/perl.mak, since the\nMakefile will not otherwise know about the new files).\n\nThis means that every time \"make\" is run, we see:\n\n      GEN perl/PM.stamp\n\nin the output, even though it is not likely to have changed.\nLet's make this recipe completely silent, as we do for other\nauto-generated dependency files (e.g., GIT-CFLAGS).\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n Makefile | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/Makefile b/Makefile\nindex 6b4fbeb..6b0dd47 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1747,7 +1747,7 @@ $(SCRIPT_PERL_GEN): perl/perl.mak\n perl/perl.mak: perl/PM.stamp\n \n perl/PM.stamp: FORCE\n-\t$(QUIET_GEN)$(FIND) perl -type f -name '*.pm' | sort >$@+ && \\\n+\t@$(FIND) perl -type f -name '*.pm' | sort >$@+ && \\\n \t{ cmp $@+ $@ >/dev/null 2>/dev/null || mv $@+ $@; } && \\\n \t$(RM) $@+\n \n-- \n2.4.2.668.gc3b1ade.dirty\n"}]}