[prev in list] [next in list] [prev in thread] [next in thread] 

List:       git
Subject:    [PATCH v2 7/7] Makefile: build 'gitweb' in the default target
From:       Ævar Arnfjörð Bjarmason  <avarab () gmail ! com>
Date:       2022-05-31 17:46:00
Message-ID: patch-v2-7.7-69428540886-20220531T173805Z-avarab () gmail ! com
[Download RAW message or body]

From: SZEDER Gábor <szeder.dev@gmail.com>

Our Makefile's default target used to build 'gitweb', though
indirectly: the 'all' target depended on 'git-instaweb', which in turn
depended on 'gitweb'.  Then e25c7cc146 (Makefile: drop dependency
between git-instaweb and gitweb, 2015-05-29) removed the latter
dependency, and for good reasons (quoting its commit message):

  "1. git-instaweb has no build-time dependency on gitweb; it
      is a run-time dependency

   2. gitweb is a directory that we want to recursively make
      in. As a result, its recipe is marked .PHONY, which
      causes "make" to rebuild git-instaweb every time it is
      run."

Since then a simple 'make' doesn't build 'gitweb'.

Luckily, installing 'gitweb' is not broken: although 'make install'
doesn't depend on the 'gitweb' target, it runs 'make -C gitweb
install' unconditionally, which does generate all the necessary files
for 'gitweb' and installs them.  However, if someone runs 'make &&
sudo make install', then those files in the 'gitweb' directory will be
generated and owned by root, which is not nice.

List 'gitweb' as a direct dependency of the default target, so a plain
'make' will build it.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Makefile b/Makefile
index d251838c554..63057b10634 100644
--- a/Makefile
+++ b/Makefile
@@ -3042,6 +3042,7 @@ include gitweb/Makefile
 
 .PHONY: gitweb
 gitweb: $(MAK_DIR_GITWEB_ALL)
+all:: gitweb
 
 ### Installation rules
 
-- 
2.36.1.1103.g036c05811b0

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic