[PATCH 0/2] make: install stripped Git

STALE1831d

4 messages, 2 authors, 2021-08-26 · open the first message on its own page

[PATCH 0/2] make: install stripped Git

From: Bagas Sanjaya <hidden>
Date: 2021-08-26 11:38:44

This two-patch series adds convenient make target to install Git with
stripped executables (programs). The first patch adds such target
(called install-stripped), while the second one deletes the
now-redundant strip target.

Unlike previous attempts [1] and [2], stripping is done after installing
Git into installation prefix, without touching working directory where
Git is compiled. The advantage of it is unstripped programs can be
installed at the same prefix (thus overwriting already installed
stripped ones), particularly useful for debugging and development
purposes.

[1]:
https://lore.kernel.org/git/20210820105052.30631-1-bagasdotme@gmail.com/
[2]:
https://lore.kernel.org/git/20210817110728.55842-1-bagasdotme@gmail.com/

Bagas Sanjaya (2):
  make: add install-stripped target
  make: delete strip target

 Makefile | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)


base-commit: c4203212e360b25a1c69467b5a8437d45a373cac
-- 
2.25.1

[PATCH 1/2] make: add install-stripped target

From: Bagas Sanjaya <hidden>
Date: 2021-08-26 11:38:51

Add the target that install Git with stripped executables

The executables that are going to be stripped are all of $(PROGRAMS) and
git. Because they are installed over various directories (bin and
libexec/git-core) within installation prefix, the location of each
program needs to be found and pass it to $(STRIP) program.

Signed-off-by: Bagas Sanjaya <redacted>
---
 Makefile | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index d1feab008f..b8a3a64422 100644
--- a/Makefile
+++ b/Makefile
@@ -3102,7 +3102,12 @@ endif
 	done && \
 	./check_bindir "z$$bindir" "z$$execdir" "$$bindir/git-add$X"
 
-.PHONY: install-gitweb install-doc install-man install-man-perl install-html install-info install-pdf
+install-stripped: install
+	for f in $(PROGRAMS) git$X; do \
+		find $$prefix -type f -name $$f -exec $(STRIP) $(STRIP_OPTS) {} \; ; \
+	done
+
+.PHONY: install-gitweb install-doc install-man install-man-perl install-html install-info install-pdf install-stripped
 .PHONY: quick-install-doc quick-install-man quick-install-html
 install-gitweb:
 	$(MAKE) -C gitweb install
-- 
2.25.1

[PATCH 2/2] make: delete strip target

From: Bagas Sanjaya <hidden>
Date: 2021-08-26 11:38:53

The target isn't needed anymore since stripping is done in install-strip
target (in previous patch).

Signed-off-by: Bagas Sanjaya <redacted>
---
 Makefile | 2 --
 1 file changed, 2 deletions(-)
diff --git a/Makefile b/Makefile
index b8a3a64422..027b052a0c 100644
--- a/Makefile
+++ b/Makefile
@@ -2170,8 +2170,6 @@ please_set_SHELL_PATH_to_a_more_modern_shell:
 
 shell_compatibility_test: please_set_SHELL_PATH_to_a_more_modern_shell
 
-strip: $(PROGRAMS) git$X
-	$(STRIP) $(STRIP_OPTS) $^
 
 ### Flags affecting all rules
 
-- 
2.25.1

Re: [PATCH 2/2] make: delete strip target

From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2021-08-26 19:36:53

On Thu, Aug 26 2021, Bagas Sanjaya wrote:
quoted hunk
The target isn't needed anymore since stripping is done in install-strip
target (in previous patch).

Signed-off-by: Bagas Sanjaya <redacted>
---
 Makefile | 2 --
 1 file changed, 2 deletions(-)
diff --git a/Makefile b/Makefile
index b8a3a64422..027b052a0c 100644
--- a/Makefile
+++ b/Makefile
@@ -2170,8 +2170,6 @@ please_set_SHELL_PATH_to_a_more_modern_shell:
 
 shell_compatibility_test: please_set_SHELL_PATH_to_a_more_modern_shell
 
-strip: $(PROGRAMS) git$X
-	$(STRIP) $(STRIP_OPTS) $^
 
 ### Flags affecting all rules
This doesn't remove the phony "strip" target (nor does the first patch),
and in any case I think this would be more readable with the two patches
squashed together. Let's remove the old target & add the new one
atomically.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help