Makefile: set default goals in makefiles

Explicitly set the default goal at the very top of various makefiles. This is already present in some makefiles, but not all of them. In particular, this corrects a regression introduced in a38edab7c8 (Makefile: generate doc versions via GIT-VERSION-GEN, 2024-12-06). That commit added some config files as build targets for the Documentation directory, and put the target configuration in a sensible place. Unfortunately, that sensible place was above any other build target definitions, meaning the default goal changed to being those configuration files only, rather than the HTML and man page documentation. Signed-off-by: Adam Dinwoodie <adam@dinwoodie.org> Helped-by: Junio C Hamano <gitster@pobox.com> Acked-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Adam Dinwoodie committed Feb 15, 2025 at 21:19 UTC 5309c1e9fb399c390ed36ef476e91f76f6746fa9
15 files changed +46 -11
Documentation/Makefile
+4 -1
@@ -1,3 +1,6 @@
1 +# The default target of this Makefile is...
2 +all::
3 +
4 # Import tree-wide shared Makefile behavior and libraries
5 include ../shared.mak
6
@@ -236,7 +239,7 @@ DEFAULT_EDITOR_SQ = $(subst ','\'',$(DEFAULT_EDITOR))
239 ASCIIDOC_EXTRA += -a 'git-default-editor=$(DEFAULT_EDITOR_SQ)'
240 endif
241
239 -all: html man
242 +all:: html man
243
244 html: $(DOC_HTML)
245
contrib/credential/libsecret/Makefile
+3
@@ -1,3 +1,6 @@
1 +# The default target of this Makefile is...
2 +all::
3 +
4 MAIN:=git-credential-libsecret
5 all:: $(MAIN)
6
contrib/credential/osxkeychain/Makefile
+1
@@ -1,3 +1,4 @@
1 +# The default target of this Makefile is...
2 all:: git-credential-osxkeychain
3
4 CC = gcc
contrib/credential/wincred/Makefile
+2 -1
@@ -1,4 +1,5 @@
1 -all: git-credential-wincred.exe
1 +# The default target of this Makefile is...
2 +all:: git-credential-wincred.exe
3
4 -include ../../../config.mak.autogen
5 -include ../../../config.mak
contrib/diff-highlight/Makefile
+2 -1
@@ -1,4 +1,5 @@
1 -all: diff-highlight
1 +# The default target of this Makefile is...
2 +all:: diff-highlight
3
4 PERL_PATH = /usr/bin/perl
5 -include ../../config.mak
contrib/diff-highlight/t/Makefile
+4 -1
@@ -1,3 +1,6 @@
1 +# The default target of this Makefile is...
2 +all::
3 +
4 -include ../../../config.mak.autogen
5 -include ../../../config.mak
6
@@ -6,7 +9,7 @@ SHELL_PATH ?= $(SHELL)
9 SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
10 T = $(wildcard t[0-9][0-9][0-9][0-9]-*.sh)
11
9 -all: test
12 +all:: test
13 test: $(T)
14
15 .PHONY: help clean all test $(T)
contrib/mw-to-git/Makefile
+4 -1
@@ -12,6 +12,9 @@
12 #
13 # make install
14
15 +# The default target of this Makefile is...
16 +all::
17 +
18 GIT_MEDIAWIKI_PM=Git/Mediawiki.pm
19 SCRIPT_PERL=git-remote-mediawiki.perl
20 SCRIPT_PERL+=git-mw.perl
@@ -27,7 +30,7 @@ INSTLIBDIR=$(shell $(MAKE) -C $(GIT_ROOT_DIR)/ \
30 DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
31 INSTLIBDIR_SQ = $(subst ','\'',$(INSTLIBDIR))
32
30 -all: build
33 +all:: build
34
35 test: all
36 $(MAKE) -C t
contrib/mw-to-git/t/Makefile
+2 -1
@@ -8,7 +8,8 @@
8 #
9 ## Test git-remote-mediawiki
10
11 -all: test
11 +# The default target of this Makefile is...
12 +all:: test
13
14 -include ../../../config.mak.autogen
15 -include ../../../config.mak
contrib/persistent-https/Makefile
+4 -1
@@ -12,10 +12,13 @@
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 +# The default target of this Makefile is...
16 +all::
17 +
18 BUILD_LABEL=$(shell cut -d" " -f3 ../../GIT-VERSION-FILE)
19 TAR_OUT=$(shell go env GOOS)_$(shell go env GOARCH).tar.gz
20
18 -all: git-remote-persistent-https git-remote-persistent-https--proxy \
21 +all:: git-remote-persistent-https git-remote-persistent-https--proxy \
22 git-remote-persistent-http
23
24 git-remote-persistent-https--proxy: git-remote-persistent-https
contrib/subtree/t/Makefile
+4 -1
@@ -3,6 +3,9 @@
3 # Copyright (c) 2005 Junio C Hamano
4 #
5
6 +# The default target of this Makefile is...
7 +all::
8 +
9 -include ../../../config.mak.autogen
10 -include ../../../config.mak
11
@@ -31,7 +34,7 @@ TSVN = $(sort $(wildcard t91[0-9][0-9]-*.sh))
34 TGITWEB = $(sort $(wildcard t95[0-9][0-9]-*.sh))
35 THELPERS = $(sort $(filter-out $(T),$(wildcard *.sh)))
36
34 -all: $(DEFAULT_TEST_TARGET)
37 +all:: $(DEFAULT_TEST_TARGET)
38
39 test: pre-clean $(TEST_LINT)
40 $(MAKE) aggregate-results-and-cleanup
git-gui/Makefile
+1
@@ -1,3 +1,4 @@
1 +# The default target of this Makefile is...
2 all::
3
4 # Define V=1 to have a more verbose compile.
git-gui/po/glossary/Makefile
+3
@@ -1,3 +1,6 @@
1 +# The default target of this Makefile is...
2 +update-po::
3 +
4 PO_TEMPLATE = git-gui-glossary.pot
5
6 ALL_POFILES = $(wildcard *.po)
t/interop/Makefile
+4 -1
@@ -1,3 +1,6 @@
1 +# The default target of this Makefile is...
2 +all::
3 +
4 # Import tree-wide shared Makefile behavior and libraries
5 include ../../shared.mak
6
@@ -8,7 +11,7 @@ SHELL_PATH ?= $(SHELL)
11 SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
12 T = $(sort $(wildcard i[0-9][0-9][0-9][0-9]-*.sh))
13
11 -all: $(T)
14 +all:: $(T)
15
16 $(T):
17 @echo "*** $@ ***"; '$(SHELL_PATH_SQ)' $@ $(GIT_TEST_OPTS)
t/perf/Makefile
+4 -1
@@ -1,10 +1,13 @@
1 +# The default target of this Makefile is...
2 +all::
3 +
4 # Import tree-wide shared Makefile behavior and libraries
5 include ../../shared.mak
6
7 -include ../../config.mak
8 export GIT_TEST_OPTIONS
9
7 -all: test-lint perf
10 +all:: test-lint perf
11
12 perf: pre-clean
13 ./run
templates/Makefile
+4 -1
@@ -1,3 +1,6 @@
1 +# The default target of this Makefile is...
2 +all::
3 +
4 # Import tree-wide shared Makefile behavior and libraries
5 include ../shared.mak
6
@@ -23,7 +26,7 @@ PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH))
26 DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
27 template_instdir_SQ = $(subst ','\'',$(template_instdir))
28
26 -all: boilerplates.made custom
29 +all:: boilerplates.made custom
30
31 # Put templates that can be copied straight from the source
32 # in a file direc--tory--file in the source. They will be