Skip to content

Commit 5309c1e

Browse files
me-andgitster
authored andcommitted
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 a38edab (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 <[email protected]> Helped-by: Junio C Hamano <[email protected]> Acked-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 063bceb commit 5309c1e

File tree

15 files changed

+46
-11
lines changed

15 files changed

+46
-11
lines changed

Documentation/Makefile

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# The default target of this Makefile is...
2+
all::
3+
14
# Import tree-wide shared Makefile behavior and libraries
25
include ../shared.mak
36

@@ -236,7 +239,7 @@ DEFAULT_EDITOR_SQ = $(subst ','\'',$(DEFAULT_EDITOR))
236239
ASCIIDOC_EXTRA += -a 'git-default-editor=$(DEFAULT_EDITOR_SQ)'
237240
endif
238241

239-
all: html man
242+
all:: html man
240243

241244
html: $(DOC_HTML)
242245

contrib/credential/libsecret/Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# The default target of this Makefile is...
2+
all::
3+
14
MAIN:=git-credential-libsecret
25
all:: $(MAIN)
36

contrib/credential/osxkeychain/Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# The default target of this Makefile is...
12
all:: git-credential-osxkeychain
23

34
CC = gcc

contrib/credential/wincred/Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
all: git-credential-wincred.exe
1+
# The default target of this Makefile is...
2+
all:: git-credential-wincred.exe
23

34
-include ../../../config.mak.autogen
45
-include ../../../config.mak

contrib/diff-highlight/Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
all: diff-highlight
1+
# The default target of this Makefile is...
2+
all:: diff-highlight
23

34
PERL_PATH = /usr/bin/perl
45
-include ../../config.mak

contrib/diff-highlight/t/Makefile

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# The default target of this Makefile is...
2+
all::
3+
14
-include ../../../config.mak.autogen
25
-include ../../../config.mak
36

@@ -6,7 +9,7 @@ SHELL_PATH ?= $(SHELL)
69
SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
710
T = $(wildcard t[0-9][0-9][0-9][0-9]-*.sh)
811

9-
all: test
12+
all:: test
1013
test: $(T)
1114

1215
.PHONY: help clean all test $(T)

contrib/mw-to-git/Makefile

+4-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
#
1313
# make install
1414

15+
# The default target of this Makefile is...
16+
all::
17+
1518
GIT_MEDIAWIKI_PM=Git/Mediawiki.pm
1619
SCRIPT_PERL=git-remote-mediawiki.perl
1720
SCRIPT_PERL+=git-mw.perl
@@ -27,7 +30,7 @@ INSTLIBDIR=$(shell $(MAKE) -C $(GIT_ROOT_DIR)/ \
2730
DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
2831
INSTLIBDIR_SQ = $(subst ','\'',$(INSTLIBDIR))
2932

30-
all: build
33+
all:: build
3134

3235
test: all
3336
$(MAKE) -C t

contrib/mw-to-git/t/Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
#
99
## Test git-remote-mediawiki
1010

11-
all: test
11+
# The default target of this Makefile is...
12+
all:: test
1213

1314
-include ../../../config.mak.autogen
1415
-include ../../../config.mak

contrib/persistent-https/Makefile

+4-1
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,13 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
# The default target of this Makefile is...
16+
all::
17+
1518
BUILD_LABEL=$(shell cut -d" " -f3 ../../GIT-VERSION-FILE)
1619
TAR_OUT=$(shell go env GOOS)_$(shell go env GOARCH).tar.gz
1720

18-
all: git-remote-persistent-https git-remote-persistent-https--proxy \
21+
all:: git-remote-persistent-https git-remote-persistent-https--proxy \
1922
git-remote-persistent-http
2023

2124
git-remote-persistent-https--proxy: git-remote-persistent-https

contrib/subtree/t/Makefile

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
# Copyright (c) 2005 Junio C Hamano
44
#
55

6+
# The default target of this Makefile is...
7+
all::
8+
69
-include ../../../config.mak.autogen
710
-include ../../../config.mak
811

@@ -31,7 +34,7 @@ TSVN = $(sort $(wildcard t91[0-9][0-9]-*.sh))
3134
TGITWEB = $(sort $(wildcard t95[0-9][0-9]-*.sh))
3235
THELPERS = $(sort $(filter-out $(T),$(wildcard *.sh)))
3336

34-
all: $(DEFAULT_TEST_TARGET)
37+
all:: $(DEFAULT_TEST_TARGET)
3538

3639
test: pre-clean $(TEST_LINT)
3740
$(MAKE) aggregate-results-and-cleanup

git-gui/Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# The default target of this Makefile is...
12
all::
23

34
# Define V=1 to have a more verbose compile.

git-gui/po/glossary/Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# The default target of this Makefile is...
2+
update-po::
3+
14
PO_TEMPLATE = git-gui-glossary.pot
25

36
ALL_POFILES = $(wildcard *.po)

t/interop/Makefile

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# The default target of this Makefile is...
2+
all::
3+
14
# Import tree-wide shared Makefile behavior and libraries
25
include ../../shared.mak
36

@@ -8,7 +11,7 @@ SHELL_PATH ?= $(SHELL)
811
SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
912
T = $(sort $(wildcard i[0-9][0-9][0-9][0-9]-*.sh))
1013

11-
all: $(T)
14+
all:: $(T)
1215

1316
$(T):
1417
@echo "*** $@ ***"; '$(SHELL_PATH_SQ)' $@ $(GIT_TEST_OPTS)

t/perf/Makefile

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1+
# The default target of this Makefile is...
2+
all::
3+
14
# Import tree-wide shared Makefile behavior and libraries
25
include ../../shared.mak
36

47
-include ../../config.mak
58
export GIT_TEST_OPTIONS
69

7-
all: test-lint perf
10+
all:: test-lint perf
811

912
perf: pre-clean
1013
./run

templates/Makefile

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# The default target of this Makefile is...
2+
all::
3+
14
# Import tree-wide shared Makefile behavior and libraries
25
include ../shared.mak
36

@@ -23,7 +26,7 @@ PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH))
2326
DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
2427
template_instdir_SQ = $(subst ','\'',$(template_instdir))
2528

26-
all: boilerplates.made custom
29+
all:: boilerplates.made custom
2730

2831
# Put templates that can be copied straight from the source
2932
# in a file direc--tory--file in the source. They will be

0 commit comments

Comments
 (0)