From 7decdb9b4ac322158069645685b7527cba65a7e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Tue, 28 Jun 2022 12:15:55 +0200 Subject: gitweb/Makefile: define all .PHONY prerequisites inline MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move the '.PHONY' definition so that it's split up and accompanies the relevant as they're defined. This will make a subsequent diff smaller as we'll remove some of these, and won't need to re-edit the now-removed '.PHONY' line. Signed-off-by: Ævar Arnfjörð Bjarmason Signed-off-by: Junio C Hamano --- gitweb/Makefile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'gitweb') diff --git a/gitweb/Makefile b/gitweb/Makefile index f13e23c4de..abb5c9f9ab 100644 --- a/gitweb/Makefile +++ b/gitweb/Makefile @@ -1,5 +1,6 @@ # The default target of this Makefile is... all:: +.PHONY: all # Define V=1 to have a more verbose compile. # @@ -45,6 +46,7 @@ HIGHLIGHT_BIN = highlight -include config.mak # determine version +.PHONY: .FORCE-GIT-VERSION-FILE ../GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE $(QUIET_SUBDIR0)../ $(QUIET_SUBDIR1) GIT-VERSION-FILE @@ -152,6 +154,7 @@ GITWEB_REPLACE = \ -e 's|++GITWEB_SITE_FOOTER++|$(GITWEB_SITE_FOOTER)|g' \ -e 's|++HIGHLIGHT_BIN++|$(HIGHLIGHT_BIN)|g' +.PHONY: FORCE GITWEB-BUILD-OPTIONS: FORCE @rm -f $@+ @echo "x" '$(PERL_PATH_SQ)' $(GITWEB_REPLACE) "$(JSMIN)|$(CSSMIN)" >$@+ @@ -171,15 +174,18 @@ static/gitweb.js: $(GITWEB_JSLIB_FILES) ### Testing rules +.PHONY: test test: $(MAKE) -C ../t gitweb-test +.PHONY: test-installed test-installed: GITWEB_TEST_INSTALLED='$(DESTDIR_SQ)$(gitwebdir_SQ)' \ $(MAKE) -C ../t gitweb-test ### Installation rules +.PHONY: install install: all $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitwebdir_SQ)' $(INSTALL) -m 755 $(GITWEB_PROGRAMS) '$(DESTDIR_SQ)$(gitwebdir_SQ)' @@ -188,10 +194,8 @@ install: all ### Cleaning rules +.PHONY: clean clean: $(RM) gitweb.cgi static/gitweb.js \ static/gitweb.min.js static/gitweb.min.css \ GITWEB-BUILD-OPTIONS - -.PHONY: all clean install test test-installed .FORCE-GIT-VERSION-FILE FORCE - -- cgit v1.2.3 From 1e08fa5e2bf9cd254a742a0ac3e950a12fc45915 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Tue, 28 Jun 2022 12:15:56 +0200 Subject: gitweb/Makefile: add a $(GITWEB_ALL) variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Declare the targets that the "all" target depends on with a new $(GITWEB_ALL) variable. This will help to reduce churn in subsequent commits. Signed-off-by: Ævar Arnfjörð Bjarmason Signed-off-by: Junio C Hamano --- gitweb/Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'gitweb') diff --git a/gitweb/Makefile b/gitweb/Makefile index abb5c9f9ab..733b60f925 100644 --- a/gitweb/Makefile +++ b/gitweb/Makefile @@ -54,6 +54,11 @@ ifneq ($(MAKECMDGOALS),clean) -include ../GIT-VERSION-FILE endif +# What targets we'll add to 'all' for "make gitweb" +GITWEB_ALL = +GITWEB_ALL += gitweb.cgi +GITWEB_ALL += static/gitweb.js + ### Build rules SHELL_PATH ?= $(SHELL) @@ -92,7 +97,7 @@ ifndef V endif endif -all:: gitweb.cgi static/gitweb.js +all:: $(GITWEB_ALL) GITWEB_PROGRAMS = gitweb.cgi -- cgit v1.2.3 From 564ebde3d323fc3b22534dcbb32723807771b955 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Tue, 28 Jun 2022 12:15:57 +0200 Subject: gitweb/Makefile: clear up and de-duplicate the gitweb.{css,js} vars MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change the variable definitions for the $(GITWEB_CSS) and $(GITWEB_JS) so that we have a clear separation between what we use as "in" files, v.s. our "min" files. We can now make the appending to $(GITWEB_FILES) unconditional, since $(GITWEB_{JS,CSS}) is either the "min" or non-"min" version. This reduces the duplication within the file. While we're at it let's initialize "GITWEB_JSLIB_FILES" as we normally do with such variables. Signed-off-by: Ævar Arnfjörð Bjarmason Signed-off-by: Junio C Hamano --- gitweb/Makefile | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) (limited to 'gitweb') diff --git a/gitweb/Makefile b/gitweb/Makefile index 733b60f925..a8752c1f11 100644 --- a/gitweb/Makefile +++ b/gitweb/Makefile @@ -31,10 +31,12 @@ GITWEB_STRICT_EXPORT = GITWEB_BASE_URL = GITWEB_LIST = GITWEB_HOMETEXT = indextext.html -GITWEB_CSS = static/gitweb.css +GITWEB_CSS_IN = static/gitweb.css +GITWEB_CSS = $(GITWEB_CSS_IN) GITWEB_LOGO = static/git-logo.png GITWEB_FAVICON = static/git-favicon.png -GITWEB_JS = static/gitweb.js +GITWEB_JS_IN = static/gitweb.js +GITWEB_JS = $(GITWEB_JS_IN) GITWEB_SITE_HTML_HEAD_STRING = GITWEB_SITE_HEADER = GITWEB_SITE_FOOTER = @@ -57,7 +59,7 @@ endif # What targets we'll add to 'all' for "make gitweb" GITWEB_ALL = GITWEB_ALL += gitweb.cgi -GITWEB_ALL += static/gitweb.js +GITWEB_ALL += $(GITWEB_JS) ### Build rules @@ -101,25 +103,23 @@ all:: $(GITWEB_ALL) GITWEB_PROGRAMS = gitweb.cgi +GITWEB_JS_MIN = static/gitweb.min.js ifdef JSMIN -GITWEB_FILES += static/gitweb.min.js -GITWEB_JS = static/gitweb.min.js -all:: static/gitweb.min.js -static/gitweb.min.js: static/gitweb.js GITWEB-BUILD-OPTIONS +GITWEB_JS = $(GITWEB_JS_MIN) +all:: $(GITWEB_JS_MIN) +$(GITWEB_JS_MIN): $(GITWEB_JS_IN) GITWEB-BUILD-OPTIONS $(QUIET_GEN)$(JSMIN) <$< >$@ -else -GITWEB_FILES += static/gitweb.js endif +GITWEB_FILES += $(GITWEB_JS) +GITWEB_CSS_MIN = static/gitweb.min.css ifdef CSSMIN -GITWEB_FILES += static/gitweb.min.css -GITWEB_CSS = static/gitweb.min.css -all:: static/gitweb.min.css -static/gitweb.min.css: static/gitweb.css GITWEB-BUILD-OPTIONS +GITWEB_CSS = $(GITWEB_CSS_MIN) +all:: $(GITWEB_CSS_MIN) +$(GITWEB_CSS_MIN): $(GITWEB_CSS_IN) GITWEB-BUILD-OPTIONS $(QUIET_GEN)$(CSSMIN) <$< >$@ -else -GITWEB_FILES += static/gitweb.css endif +GITWEB_FILES += $(GITWEB_CSS) GITWEB_FILES += static/git-logo.png static/git-favicon.png @@ -127,6 +127,7 @@ GITWEB_FILES += static/git-logo.png static/git-favicon.png # # js/lib/common-lib.js should be always first, then js/lib/*.js, # then the rest of files; js/gitweb.js should be last (if it exists) +GITWEB_JSLIB_FILES = GITWEB_JSLIB_FILES += static/js/lib/common-lib.js GITWEB_JSLIB_FILES += static/js/lib/datetime.js GITWEB_JSLIB_FILES += static/js/lib/cookies.js @@ -201,6 +202,6 @@ install: all .PHONY: clean clean: - $(RM) gitweb.cgi static/gitweb.js \ - static/gitweb.min.js static/gitweb.min.css \ + $(RM) gitweb.cgi $(GITWEB_JS_IN) \ + $(GITWEB_JS_MIN) $(GITWEB_CSS_MIN) \ GITWEB-BUILD-OPTIONS -- cgit v1.2.3 From b82d66eb0cf840a991ff906ab4679785eae4605a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Tue, 28 Jun 2022 12:15:58 +0200 Subject: gitweb/Makefile: prepare to merge into top-level Makefile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since the "gitweb/Makefile" was split out from the top-level Makefile in 62331ef1637 (gitweb: Makefile improvements, 2010-01-30) we've kept the inter-dependencies between the two, and worse have dealt with a lot of duplication as a result. In preparation for merging the two again add a MAK_DIR_GITWEB variable to various rules in it. This will allow us to set this variable to "gitweb/" as we include it in the top-level Makefile, which will minimize the size of the subsequent diff. Signed-off-by: Ævar Arnfjörð Bjarmason Signed-off-by: Junio C Hamano --- gitweb/Makefile | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'gitweb') diff --git a/gitweb/Makefile b/gitweb/Makefile index a8752c1f11..74e896767e 100644 --- a/gitweb/Makefile +++ b/gitweb/Makefile @@ -2,6 +2,8 @@ all:: .PHONY: all +MAK_DIR_GITWEB = + # Define V=1 to have a more verbose compile. # # Define JSMIN to point to JavaScript minifier that functions as @@ -106,8 +108,9 @@ GITWEB_PROGRAMS = gitweb.cgi GITWEB_JS_MIN = static/gitweb.min.js ifdef JSMIN GITWEB_JS = $(GITWEB_JS_MIN) -all:: $(GITWEB_JS_MIN) -$(GITWEB_JS_MIN): $(GITWEB_JS_IN) GITWEB-BUILD-OPTIONS +all:: $(MAK_DIR_GITWEB)$(GITWEB_JS_MIN) +$(MAK_DIR_GITWEB)$(GITWEB_JS_MIN): $(MAK_DIR_GITWEB)GITWEB-BUILD-OPTIONS +$(MAK_DIR_GITWEB)$(GITWEB_JS_MIN): $(MAK_DIR_GITWEB)$(GITWEB_JS_IN) $(QUIET_GEN)$(JSMIN) <$< >$@ endif GITWEB_FILES += $(GITWEB_JS) @@ -115,8 +118,9 @@ GITWEB_FILES += $(GITWEB_JS) GITWEB_CSS_MIN = static/gitweb.min.css ifdef CSSMIN GITWEB_CSS = $(GITWEB_CSS_MIN) -all:: $(GITWEB_CSS_MIN) -$(GITWEB_CSS_MIN): $(GITWEB_CSS_IN) GITWEB-BUILD-OPTIONS +all:: $(MAK_DIR_GITWEB)$(GITWEB_CSS_MIN) +$(MAK_DIR_GITWEB)$(GITWEB_CSS_MIN): $(MAK_DIR_GITWEB)GITWEB-BUILD-OPTIONS +$(MAK_DIR_GITWEB)$(GITWEB_CSS_MIN): $(MAK_DIR_GITWEB)$(GITWEB_CSS_IN) $(QUIET_GEN)$(CSSMIN) <$< >$@ endif GITWEB_FILES += $(GITWEB_CSS) @@ -161,19 +165,20 @@ GITWEB_REPLACE = \ -e 's|++HIGHLIGHT_BIN++|$(HIGHLIGHT_BIN)|g' .PHONY: FORCE -GITWEB-BUILD-OPTIONS: FORCE +$(MAK_DIR_GITWEB)GITWEB-BUILD-OPTIONS: FORCE @rm -f $@+ @echo "x" '$(PERL_PATH_SQ)' $(GITWEB_REPLACE) "$(JSMIN)|$(CSSMIN)" >$@+ @cmp -s $@+ $@ && rm -f $@+ || mv -f $@+ $@ -gitweb.cgi: gitweb.perl GITWEB-BUILD-OPTIONS +$(MAK_DIR_GITWEB)gitweb.cgi: $(MAK_DIR_GITWEB)GITWEB-BUILD-OPTIONS +$(MAK_DIR_GITWEB)gitweb.cgi: $(MAK_DIR_GITWEB)gitweb.perl $(QUIET_GEN)$(RM) $@ $@+ && \ sed -e '1s|#!.*perl|#!$(PERL_PATH_SQ)|' \ $(GITWEB_REPLACE) $< >$@+ && \ chmod +x $@+ && \ mv $@+ $@ -static/gitweb.js: $(GITWEB_JSLIB_FILES) +$(MAK_DIR_GITWEB)static/gitweb.js: $(addprefix $(MAK_DIR_GITWEB),$(GITWEB_JSLIB_FILES)) $(QUIET_GEN)$(RM) $@ $@+ && \ cat $^ >$@+ && \ mv $@+ $@ @@ -194,14 +199,16 @@ test-installed: .PHONY: install install: all $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitwebdir_SQ)' - $(INSTALL) -m 755 $(GITWEB_PROGRAMS) '$(DESTDIR_SQ)$(gitwebdir_SQ)' + $(INSTALL) -m 755 $(addprefix $(MAK_DIR_GITWEB),$(GITWEB_PROGRAMS)) \ + '$(DESTDIR_SQ)$(gitwebdir_SQ)' $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitwebstaticdir_SQ)' - $(INSTALL) -m 644 $(GITWEB_FILES) '$(DESTDIR_SQ)$(gitwebstaticdir_SQ)' + $(INSTALL) -m 644 $(addprefix $(MAK_DIR_GITWEB),$(GITWEB_FILES)) \ + '$(DESTDIR_SQ)$(gitwebstaticdir_SQ)' ### Cleaning rules .PHONY: clean clean: - $(RM) gitweb.cgi $(GITWEB_JS_IN) \ + $(RM) $(addprefix $(MAK_DIR_GITWEB),gitweb.cgi $(GITWEB_JS_IN) \ $(GITWEB_JS_MIN) $(GITWEB_CSS_MIN) \ - GITWEB-BUILD-OPTIONS + GITWEB-BUILD-OPTIONS) -- cgit v1.2.3 From 27438ef5e043ebca6336274c5b4e79287749eca6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Tue, 28 Jun 2022 12:15:59 +0200 Subject: gitweb: remove "test" and "test-installed" targets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove the special "test" targets for gitweb added in 958a8467216 (gitweb/Makefile: Add 'test' and 'test-installed' targets, 2010-09-26). Unlike e.g. "contrib/scalar" and "contrib/subtree" the "gitweb" tests themselves live in our top-level t/ directory. It therefore doesn't make sense to maintain this indirection, no more than it would to have a "git-send-email-test". By dropping it we'll also free other tests to use the t95*.sh prefix. These removed targets are unlikely to be used by anyone, and to the extent that they are we can easily use an invocation like this instead: make test T='t[0-9]*gitweb*.sh' Signed-off-by: Ævar Arnfjörð Bjarmason Signed-off-by: Junio C Hamano --- gitweb/Makefile | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'gitweb') diff --git a/gitweb/Makefile b/gitweb/Makefile index 74e896767e..eaf0cfcf80 100644 --- a/gitweb/Makefile +++ b/gitweb/Makefile @@ -183,17 +183,6 @@ $(MAK_DIR_GITWEB)static/gitweb.js: $(addprefix $(MAK_DIR_GITWEB),$(GITWEB_JSLIB_ cat $^ >$@+ && \ mv $@+ $@ -### Testing rules - -.PHONY: test -test: - $(MAKE) -C ../t gitweb-test - -.PHONY: test-installed -test-installed: - GITWEB_TEST_INSTALLED='$(DESTDIR_SQ)$(gitwebdir_SQ)' \ - $(MAKE) -C ../t gitweb-test - ### Installation rules .PHONY: install -- cgit v1.2.3 From affc3b755cb4d1ac87096bbb93f5f2e57b703894 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Tue, 28 Jun 2022 12:16:00 +0200 Subject: gitweb/Makefile: include in top-level Makefile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Include the gitweb/Makefile in the top-level Makefile rather than calling it as a sub-Makefile. As noted in the thread starting at at [1] (in particular [2]) we'll pay a high cost on NOOP runs of "make" just to figure out that we have nothing to do for "make gitweb". The "gitweb" script also isn't maintained out-of-tree, unlike "gitk-git" or "git-gui", which both have their own "Makefile". Other parts of it are already integrated into our main Makefiles, e.g. the documentation is built by Documentation/Makefile since 07ea4df2780 (gitweb: Add gitweb(1) manpage for gitweb itself, 2011-10-16). 1. https://lore.kernel.org/git/20220525205651.825669-1-szeder.dev@gmail.com/ 2. https://lore.kernel.org/git/220526.86k0a96sv2.gmgdl@evledraar.gmail.com/ Signed-off-by: Ævar Arnfjörð Bjarmason Signed-off-by: Junio C Hamano --- gitweb/Makefile | 91 ++++++++++----------------------------------------------- 1 file changed, 16 insertions(+), 75 deletions(-) (limited to 'gitweb') diff --git a/gitweb/Makefile b/gitweb/Makefile index eaf0cfcf80..66fceb9e94 100644 --- a/gitweb/Makefile +++ b/gitweb/Makefile @@ -1,11 +1,8 @@ -# The default target of this Makefile is... -all:: -.PHONY: all - -MAK_DIR_GITWEB = +ifndef MAK_DIR_GITWEB +$(error do not run gitweb/Makefile stand-alone anymore. The "gitweb" and \ +"install-gitweb" targets now live in the top-level Makefile) +endif -# Define V=1 to have a more verbose compile. -# # Define JSMIN to point to JavaScript minifier that functions as # a filter to have static/gitweb.js minified. # @@ -13,13 +10,6 @@ MAK_DIR_GITWEB = # version of static/gitweb.css # -prefix ?= $(HOME) -bindir ?= $(prefix)/bin -gitwebdir ?= /var/www/cgi-bin - -RM ?= rm -f -INSTALL ?= install - # default configuration for gitweb GITWEB_CONFIG = gitweb_config.perl GITWEB_CONFIG_SYSTEM = /etc/gitweb.conf @@ -44,71 +34,19 @@ GITWEB_SITE_HEADER = GITWEB_SITE_FOOTER = HIGHLIGHT_BIN = highlight -# include user config --include ../config.mak.autogen --include ../config.mak --include config.mak - -# determine version -.PHONY: .FORCE-GIT-VERSION-FILE -../GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE - $(QUIET_SUBDIR0)../ $(QUIET_SUBDIR1) GIT-VERSION-FILE - -ifneq ($(MAKECMDGOALS),clean) --include ../GIT-VERSION-FILE -endif - # What targets we'll add to 'all' for "make gitweb" GITWEB_ALL = GITWEB_ALL += gitweb.cgi GITWEB_ALL += $(GITWEB_JS) -### Build rules - -SHELL_PATH ?= $(SHELL) -PERL_PATH ?= /usr/bin/perl - -# Shell quote; -bindir_SQ = $(subst ','\'',$(bindir))#' -gitwebdir_SQ = $(subst ','\'',$(gitwebdir))#' -gitwebstaticdir_SQ = $(subst ','\'',$(gitwebdir)/static)#' -SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))#' -PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH))#' -DESTDIR_SQ = $(subst ','\'',$(DESTDIR))#' - -# Quiet generation (unless V=1) -QUIET_SUBDIR0 = +$(MAKE) -C # space to separate -C and subdir -QUIET_SUBDIR1 = - -ifneq ($(findstring $(MAKEFLAGS),w),w) -PRINT_DIR = --no-print-directory -else # "make -w" -NO_SUBDIR = : -endif - -ifneq ($(findstring $(MAKEFLAGS),s),s) -ifndef V - QUIET = @ - QUIET_GEN = $(QUIET)echo ' ' GEN $@; - QUIET_SUBDIR0 = +@subdir= - QUIET_SUBDIR1 = ;$(NO_SUBDIR) echo ' ' SUBDIR $$subdir; \ - $(MAKE) $(PRINT_DIR) -C $$subdir - export V - export QUIET - export QUIET_GEN - export QUIET_SUBDIR0 - export QUIET_SUBDIR1 -endif -endif - -all:: $(GITWEB_ALL) +MAK_DIR_GITWEB_ALL = $(addprefix $(MAK_DIR_GITWEB),$(GITWEB_ALL)) GITWEB_PROGRAMS = gitweb.cgi GITWEB_JS_MIN = static/gitweb.min.js ifdef JSMIN GITWEB_JS = $(GITWEB_JS_MIN) -all:: $(MAK_DIR_GITWEB)$(GITWEB_JS_MIN) +GITWEB_ALL += $(MAK_DIR_GITWEB)$(GITWEB_JS_MIN) $(MAK_DIR_GITWEB)$(GITWEB_JS_MIN): $(MAK_DIR_GITWEB)GITWEB-BUILD-OPTIONS $(MAK_DIR_GITWEB)$(GITWEB_JS_MIN): $(MAK_DIR_GITWEB)$(GITWEB_JS_IN) $(QUIET_GEN)$(JSMIN) <$< >$@ @@ -118,7 +56,7 @@ GITWEB_FILES += $(GITWEB_JS) GITWEB_CSS_MIN = static/gitweb.min.css ifdef CSSMIN GITWEB_CSS = $(GITWEB_CSS_MIN) -all:: $(MAK_DIR_GITWEB)$(GITWEB_CSS_MIN) +GITWEB_ALL += $(MAK_DIR_GITWEB)$(GITWEB_CSS_MIN) $(MAK_DIR_GITWEB)$(GITWEB_CSS_MIN): $(MAK_DIR_GITWEB)GITWEB-BUILD-OPTIONS $(MAK_DIR_GITWEB)$(GITWEB_CSS_MIN): $(MAK_DIR_GITWEB)$(GITWEB_CSS_IN) $(QUIET_GEN)$(CSSMIN) <$< >$@ @@ -185,19 +123,22 @@ $(MAK_DIR_GITWEB)static/gitweb.js: $(addprefix $(MAK_DIR_GITWEB),$(GITWEB_JSLIB_ ### Installation rules -.PHONY: install -install: all +.PHONY: install-gitweb +install-gitweb: $(MAK_DIR_GITWEB_ALL) $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitwebdir_SQ)' - $(INSTALL) -m 755 $(addprefix $(MAK_DIR_GITWEB),$(GITWEB_PROGRAMS)) \ - '$(DESTDIR_SQ)$(gitwebdir_SQ)' + $(INSTALL) -m 755 $(addprefix $(MAK_DIR_GITWEB),$(GITWEB_PROGRAMS)) '$(DESTDIR_SQ)$(gitwebdir_SQ)' $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitwebstaticdir_SQ)' $(INSTALL) -m 644 $(addprefix $(MAK_DIR_GITWEB),$(GITWEB_FILES)) \ '$(DESTDIR_SQ)$(gitwebstaticdir_SQ)' +ifndef NO_PERL +install: install-gitweb +endif ### Cleaning rules -.PHONY: clean -clean: +.PHONY: gitweb-clean +gitweb-clean: $(RM) $(addprefix $(MAK_DIR_GITWEB),gitweb.cgi $(GITWEB_JS_IN) \ $(GITWEB_JS_MIN) $(GITWEB_CSS_MIN) \ GITWEB-BUILD-OPTIONS) +clean: gitweb-clean -- cgit v1.2.3 From a35258c62adf5c0e591f2335f3427434ff0b63f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Tue, 28 Jun 2022 12:16:02 +0200 Subject: gitweb/Makefile: add a "NO_GITWEB" parameter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From looking at the {Free,Net,Dragonfly}BSD packages for git[1] they've been monkeypatching "gitweb" out of the Makefile, let's be nicer and provide a NO_GITWEB=Y for their use. For the "all" target this allows for optionally restoring what's been the status quo before the preceding commit, but now we'll also behave correctly on the subsequent "make install". As before our installation of gitweb can be suppressed with NO_PERL. For backwards compatibility the NO_PERL=Y flag by itself still doesn't change whether or not we build gitweb, unlike the new NO_GITWEB=Y flag. Signed-off-by: Ævar Arnfjörð Bjarmason Signed-off-by: Junio C Hamano --- gitweb/Makefile | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gitweb') diff --git a/gitweb/Makefile b/gitweb/Makefile index 66fceb9e94..3b68ab2d67 100644 --- a/gitweb/Makefile +++ b/gitweb/Makefile @@ -130,9 +130,11 @@ install-gitweb: $(MAK_DIR_GITWEB_ALL) $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitwebstaticdir_SQ)' $(INSTALL) -m 644 $(addprefix $(MAK_DIR_GITWEB),$(GITWEB_FILES)) \ '$(DESTDIR_SQ)$(gitwebstaticdir_SQ)' +ifndef NO_GITWEB ifndef NO_PERL install: install-gitweb endif +endif ### Cleaning rules -- cgit v1.2.3