Introduce target 'install-strip' in the battle against Mingw-w64 bloat

It seems that externals built with Mingw-w64 are ~10 times larger than
equivalent builds on other platforms (including original Mingw). Stripping
is therefore desirable. As suggested by IOhannes Zmoelnig stripping is not
done by default, instead this alternative installation target is provided
(like in autotools).
This commit is contained in:
katjav 2018-02-18 14:33:11 +01:00
parent 44a32fd009
commit 6bfaba6df0

View file

@ -268,6 +268,7 @@ version = 0.5.0
# <sourcefile>.lst: make asm/source output file in current working directory
#
# install: install executables and data files
# install-strip: install executables (stripped) and data files
# clean: remove build products from source tree
#
# help: print help text
@ -538,7 +539,6 @@ ifeq ($(system), Linux)
cxx.ldlibs := -lc -lm -lstdc++
shared.extension = so
shared.ldflags := -rdynamic -fPIC -shared -Wl,-soname,$(shared.lib)
stripflags = --strip-unneeded -R .note -R .comment
endif
@ -566,7 +566,6 @@ ifeq ($(system), Darwin)
shared.ldflags = -dynamiclib -undefined dynamic_lookup \
-install_name @loader_path/$(shared.lib) \
-compatibility_version 1 -current_version 1.0
stripflags = -x
version.flag := $(filter $(cflags), -mmacosx-version-min=%)
ifeq ($(target.arch), i386)
cxx.flags := -fcheck-new
@ -638,7 +637,6 @@ ifeq ($(system), Windows)
cxx.ldlibs :=
shared.extension = dll
shared.ldflags := -static-libgcc -shared "$(PDBINDIR)/pd.dll"
stripflags = --strip-unneeded -R .note -R .comment
endif
@ -1055,8 +1053,11 @@ endef
# -p = preserve time stamps
# -m = set permission mode (as in chmod)
# -d = create all components of specified directories
# Use recursive expansion for INSTALL_PROGRAM because variable 'stripflags' is
# not defined yet, it is target-specific for 'install-strip'.
INSTALL = install
INSTALL_PROGRAM := $(INSTALL) -p -m 644
INSTALL_PROGRAM = $(INSTALL) $(stripflags) -p -m 644
INSTALL_DATA := $(INSTALL) -p -m 644
INSTALL_DIR := $(INSTALL) -m 755 -d
@ -1092,6 +1093,13 @@ install-datadirs: all
$(info ++++ info: data directories of lib $(lib.name) installed \
from $(CURDIR) to $(installpath))
# definition of strip command must be overridable from environment
STRIP ?= strip
# install everything while stripping symbols of executables
install-strip: stripflags := --strip-program=$(STRIP) -s
install-strip: install
################################################################################
### rules: distribution targets ################################################