Skip to content

Commit 5639a8d

Browse files
committed
Merge branch 'bs/install-strip'
"make INSTALL_STRIP=-s install" allows the installation step to use "install -s" to strip the binaries as they get installed. * bs/install-strip: make: add INSTALL_STRIP option variable
2 parents 2b2af95 + 3231f41 commit 5639a8d

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

Makefile

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,9 @@ all::
465465
# the global variable _wpgmptr containing the absolute path of the current
466466
# executable (this is the case on Windows).
467467
#
468+
# INSTALL_STRIP can be set to "-s" to strip binaries during installation,
469+
# if your $(INSTALL) command supports the option.
470+
#
468471
# Define GENERATE_COMPILATION_DATABASE to "yes" to generate JSON compilation
469472
# database entries during compilation if your compiler supports it, using the
470473
# `-MJ` flag. The JSON entries will be placed in the `compile_commands/`
@@ -3004,7 +3007,8 @@ mergetools_instdir = $(prefix)/$(mergetoolsdir)
30043007
endif
30053008
mergetools_instdir_SQ = $(subst ','\'',$(mergetools_instdir))
30063009

3007-
install_bindir_programs := $(patsubst %,%$X,$(BINDIR_PROGRAMS_NEED_X)) $(BINDIR_PROGRAMS_NO_X)
3010+
install_bindir_xprograms := $(patsubst %,%$X,$(BINDIR_PROGRAMS_NEED_X))
3011+
install_bindir_programs := $(install_bindir_xprograms) $(BINDIR_PROGRAMS_NO_X)
30083012

30093013
.PHONY: profile-install profile-fast-install
30103014
profile-install: profile
@@ -3013,12 +3017,17 @@ profile-install: profile
30133017
profile-fast-install: profile-fast
30143018
$(MAKE) install
30153019

3020+
INSTALL_STRIP =
3021+
30163022
install: all
30173023
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'
30183024
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
3019-
$(INSTALL) $(ALL_PROGRAMS) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
3025+
$(INSTALL) $(INSTALL_STRIP) $(PROGRAMS) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
3026+
$(INSTALL) $(SCRIPTS) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
30203027
$(INSTALL) -m 644 $(SCRIPT_LIB) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
3021-
$(INSTALL) $(install_bindir_programs) '$(DESTDIR_SQ)$(bindir_SQ)'
3028+
$(INSTALL) $(INSTALL_STRIP) $(install_bindir_xprograms) '$(DESTDIR_SQ)$(bindir_SQ)'
3029+
$(INSTALL) $(BINDIR_PROGRAMS_NO_X) '$(DESTDIR_SQ)$(bindir_SQ)'
3030+
30223031
ifdef MSVC
30233032
# We DO NOT install the individual foo.o.pdb files because they
30243033
# have already been rolled up into the exe's pdb file.

0 commit comments

Comments
 (0)