{"thread":{"id":"40966","subject":"[PATCH] Makefile: add missing phony target","startedAt":"2015-12-10T15:24:54Z","lastAt":"2015-12-10T18:37:09Z","messageCount":2,"participants":["Elia Pinto","Matthieu Moy"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"274232","messageId":"1449761094-37915-1-git-send-email-gitter.spiros@gmail.com","threadId":"40966","inReplyTo":null,"subject":"[PATCH] Makefile: add missing phony target","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2015-12-10T15:24:54Z","receivedAt":"2015-12-10T15:24:54Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"Add some missing phony target to Makefile. Also put the .PHONY\ndeclaration immediately before the target declaration, where necessary,\nfor a better readability and a uniform style.\n\nSigned-off-by: Elia Pinto <gitter.spiros@gmail.com>\n---\n Makefile | 31 +++++++++++++++++++------------\n 1 file changed, 19 insertions(+), 12 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 43ceeb9..a5fab53 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -522,11 +522,11 @@ SCRIPT_PYTHON_INS = $(filter-out $(NO_INSTALL),$(SCRIPT_PYTHON_GEN))\n # \"make -C ../.. SCRIPT_PERL=contrib/foo/bar.perl build-perl-script\"\n # from subdirectories like contrib/*/\n .PHONY: build-perl-script build-sh-script build-python-script\n+.PHONY: install-perl-script install-sh-script install-python-script\n build-perl-script: $(SCRIPT_PERL_GEN)\n build-sh-script: $(SCRIPT_SH_GEN)\n build-python-script: $(SCRIPT_PYTHON_GEN)\n \n-.PHONY: install-perl-script install-sh-script install-python-script\n install-sh-script: $(SCRIPT_SH_INS)\n \t$(INSTALL) $^ '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'\n install-perl-script: $(SCRIPT_PERL_INS)\n@@ -534,7 +534,7 @@ install-perl-script: $(SCRIPT_PERL_INS)\n install-python-script: $(SCRIPT_PYTHON_INS)\n \t$(INSTALL) $^ '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'\n \n-.PHONY: clean-perl-script clean-sh-script clean-python-script\n+.PHONY: clean-sh-script clean-perl-script  clean-python-script\n clean-sh-script:\n \t$(RM) $(SCRIPT_SH_GEN)\n clean-perl-script:\n@@ -546,7 +546,6 @@ SCRIPTS = $(SCRIPT_SH_INS) \\\n \t  $(SCRIPT_PERL_INS) \\\n \t  $(SCRIPT_PYTHON_INS) \\\n \t  git-instaweb\n-\n ETAGS_TARGET = TAGS\n \n # Empty...\n@@ -1644,6 +1643,9 @@ shell_compatibility_test: please_set_SHELL_PATH_to_a_more_modern_shell\n strip: $(PROGRAMS) git$X\n \t$(STRIP) $(STRIP_OPTS) $^\n \n+.PHONY: all profile profile-fast\n+.PHONY: please_set_SHELL_PATH_to_a_more_modern_shell shell_compatibility_test strip\n+\n ### Target-specific flags and dependencies\n \n # The generic compilation pattern rule and automatically\n@@ -1792,7 +1794,7 @@ GIT-PERL-DEFINES: FORCE\n \t    fi\n \n \n-.PHONY: gitweb\n+.PHONY: gitweb git-instaweb\n gitweb:\n \t$(QUIET_SUBDIR0)gitweb $(QUIET_SUBDIR1) all\n \n@@ -2011,6 +2013,7 @@ $(VCSSVN_LIB): $(VCSSVN_OBJS)\n \n export DEFAULT_EDITOR DEFAULT_PAGER\n \n+.PHONY: doc man html info pdf\n doc:\n \t$(MAKE) -C Documentation all\n \n@@ -2054,6 +2057,7 @@ po/git.pot: $(GENERATED_H) FORCE\n \t\t$(LOCALIZED_PERL)\n \tmv $@+ $@\n \n+.PHONY: pot\n pot: po/git.pot\n \n POFILES := $(wildcard po/*.po)\n@@ -2074,6 +2078,7 @@ $(ETAGS_TARGET): FORCE\n \t$(RM) $(ETAGS_TARGET)\n \t$(FIND_SOURCE_FILES) | xargs etags -a -o $(ETAGS_TARGET)\n \n+.PHONY: tags cscope FORCE\n tags: FORCE\n \t$(RM) tags\n \t$(FIND_SOURCE_FILES) | xargs ctags -a\n@@ -2189,6 +2194,7 @@ export NO_SVN_TESTS\n export TEST_NO_MALLOC_CHECK\n \n ### Testing rules\n+.PHONY: test perf\n \n test: all\n \t$(MAKE) -C t/ all\n@@ -2196,7 +2202,6 @@ test: all\n perf: all\n \t$(MAKE) -C t/perf/ all\n \n-.PHONY: test perf\n \n test-ctype$X: ctype.o\n \n@@ -2215,6 +2220,7 @@ test-svn-fe$X: vcs-svn/lib.a\n test-%$X: test-%.o GIT-LDFLAGS $(GITLIBS)\n \t$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(filter %.a,$^) $(LIBS)\n \n+.PHONY: check_sha1 $(SP_OBJ) sparse check check-sha1\n check-sha1:: test-sha1$X\n \t./test-sha1.sh\n \n@@ -2224,7 +2230,6 @@ $(SP_OBJ): %.sp: %.c GIT-CFLAGS FORCE\n \t$(QUIET_SP)cgcc -no-compile $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) \\\n \t\t$(SPARSE_FLAGS) $<\n \n-.PHONY: sparse $(SP_OBJ)\n sparse: $(SP_OBJ)\n \n check: common-cmds.h\n@@ -2237,6 +2242,7 @@ check: common-cmds.h\n \t\texit 1; \\\n \tfi\n \n+\n ### Installation rules\n \n ifneq ($(filter /%,$(firstword $(template_dir))),)\n@@ -2263,6 +2269,7 @@ mergetools_instdir_SQ = $(subst ','\\'',$(mergetools_instdir))\n \n install_bindir_programs := $(patsubst %,%$X,$(BINDIR_PROGRAMS_NEED_X)) $(BINDIR_PROGRAMS_NO_X)\n \n+.PHONY: profile-install profile-fast-install install\n profile-install: profile\n \t$(MAKE) install\n \n@@ -2329,6 +2336,8 @@ endif\n \tdone && \\\n \t./check_bindir \"z$$bindir\" \"z$$execdir\" \"$$bindir/git-add$X\"\n \n+.PHONY: install-gitweb install-man install-html install-info install-pdf\n+.PHONY: quick-install-doc quick-install-man quick-install-html\n install-gitweb:\n \t$(MAKE) -C gitweb install\n \n@@ -2365,6 +2374,8 @@ git.spec: git.spec.in GIT-VERSION-FILE\n \tmv $@+ $@\n \n GIT_TARNAME = git-$(GIT_VERSION)\n+\n+.PHONY: dist rpm dist-doc  distclean profile-clean clean\n dist: git.spec git-archive$(X) configure\n \t./git-archive --format=tar \\\n \t\t--prefix=$(GIT_TARNAME)/ HEAD^{tree} > $(GIT_TARNAME).tar\n@@ -2445,9 +2456,6 @@ endif\n \t$(RM) GIT-USER-AGENT GIT-PREFIX\n \t$(RM) GIT-SCRIPT-DEFINES GIT-PERL-DEFINES GIT-PYTHON-VARS\n \n-.PHONY: all install profile-clean clean strip\n-.PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell\n-.PHONY: FORCE cscope\n \n ### Check documentation\n #\n@@ -2499,9 +2507,9 @@ check-builtins::\n \n ### Test suite coverage testing\n #\n-.PHONY: coverage coverage-clean coverage-compile coverage-test coverage-report\n-.PHONY: coverage-clean-results\n \n+.PHONY: coverage coverage-clean coverage-compile coverage-test coverage-report\n+.PHONY: coverage-clean-results coverage-untested-functions cover_db cover_db_html\n coverage:\n \t$(MAKE) coverage-test\n \t$(MAKE) coverage-untested-functions\n@@ -2543,4 +2551,3 @@ cover_db: coverage-report\n \n cover_db_html: cover_db\n \tcover -report html -outputdir cover_db_html cover_db\n-\n-- \n2.5.0\n"},{"id":"274236","messageId":"vpqio46b162.fsf@anie.imag.fr","threadId":"40966","inReplyTo":"1449761094-37915-1-git-send-email-gitter.spiros@gmail.com","subject":"Re: [PATCH] Makefile: add missing phony target","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2015-12-10T18:37:09Z","receivedAt":"2015-12-10T18:37:09Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Elia Pinto <gitter.spiros@gmail.com> writes:\n\n> Also put the .PHONY\n> declaration immediately before the target declaration, where necessary,\n> for a better readability and a uniform style.\n[...]\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -522,11 +522,11 @@ SCRIPT_PYTHON_INS = $(filter-out $(NO_INSTALL),$(SCRIPT_PYTHON_GEN))\n>  # \"make -C ../.. SCRIPT_PERL=contrib/foo/bar.perl build-perl-script\"\n>  # from subdirectories like contrib/*/\n>  .PHONY: build-perl-script build-sh-script build-python-script\n> +.PHONY: install-perl-script install-sh-script install-python-script\n>  build-perl-script: $(SCRIPT_PERL_GEN)\n>  build-sh-script: $(SCRIPT_SH_GEN)\n>  build-python-script: $(SCRIPT_PYTHON_GEN)\n>  \n> -.PHONY: install-perl-script install-sh-script install-python-script\n>  install-sh-script: $(SCRIPT_SH_INS)\n>  \t$(INSTALL) $^ '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'\n>  install-perl-script: $(SCRIPT_PERL_INS)\n\nIsn't this hunk doing exactly the opposite of what the commit message\nsays? install-sh-script's .PHONY used to be right before the target, and\nit's now in the paragraph above.\n\n> @@ -534,7 +534,7 @@ install-perl-script: $(SCRIPT_PERL_INS)\n>  install-python-script: $(SCRIPT_PYTHON_INS)\n>  \t$(INSTALL) $^ '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'\n>  \n> -.PHONY: clean-perl-script clean-sh-script clean-python-script\n> +.PHONY: clean-sh-script clean-perl-script  clean-python-script\n\ndouble-space befroe clean-python-script.\n\n> @@ -546,7 +546,6 @@ SCRIPTS = $(SCRIPT_SH_INS) \\\n>  \t  $(SCRIPT_PERL_INS) \\\n>  \t  $(SCRIPT_PYTHON_INS) \\\n>  \t  git-instaweb\n> -\n>  ETAGS_TARGET = TAGS\n\nIs this needed/good?\n\n> @@ -1792,7 +1794,7 @@ GIT-PERL-DEFINES: FORCE\n>  \t    fi\n>  \n>  \n> -.PHONY: gitweb\n> +.PHONY: gitweb git-instaweb\n\nNo: git-instaweb is not a .PHONY target, it's a real file generated from\ngit-instaweb.sh.\n\nThis bug in your patch is hard to spot in its current form where you mix\ncode movement and subtle changes. The patch cannot be reviewed in good\ncondition as-is.\n\n> +.PHONY: tags cscope FORCE\n>  tags: FORCE\n>  \t$(RM) tags\n>  \t$(FIND_SOURCE_FILES) | xargs ctags -a\n\nIf tags depends on FORCE, it doesn't need to be .PHONY. I strongly\nprefer the old style, since tags is actually a file, and I prefer using\n.PHONY for targets that are not meant to generate files, and depend on\nFORCE where the rule actually generate a file named after its target,\nbut needs to be re-ran every time it's called.\n\nIf you disagree with this, then you need to justify the change in the\ncommit message.\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"}]}