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:
parent
44a32fd009
commit
6bfaba6df0
1 changed files with 12 additions and 4 deletions
|
|
@ -268,6 +268,7 @@ version = 0.5.0
|
||||||
# <sourcefile>.lst: make asm/source output file in current working directory
|
# <sourcefile>.lst: make asm/source output file in current working directory
|
||||||
#
|
#
|
||||||
# install: install executables and data files
|
# install: install executables and data files
|
||||||
|
# install-strip: install executables (stripped) and data files
|
||||||
# clean: remove build products from source tree
|
# clean: remove build products from source tree
|
||||||
#
|
#
|
||||||
# help: print help text
|
# help: print help text
|
||||||
|
|
@ -538,7 +539,6 @@ ifeq ($(system), Linux)
|
||||||
cxx.ldlibs := -lc -lm -lstdc++
|
cxx.ldlibs := -lc -lm -lstdc++
|
||||||
shared.extension = so
|
shared.extension = so
|
||||||
shared.ldflags := -rdynamic -fPIC -shared -Wl,-soname,$(shared.lib)
|
shared.ldflags := -rdynamic -fPIC -shared -Wl,-soname,$(shared.lib)
|
||||||
stripflags = --strip-unneeded -R .note -R .comment
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -566,7 +566,6 @@ ifeq ($(system), Darwin)
|
||||||
shared.ldflags = -dynamiclib -undefined dynamic_lookup \
|
shared.ldflags = -dynamiclib -undefined dynamic_lookup \
|
||||||
-install_name @loader_path/$(shared.lib) \
|
-install_name @loader_path/$(shared.lib) \
|
||||||
-compatibility_version 1 -current_version 1.0
|
-compatibility_version 1 -current_version 1.0
|
||||||
stripflags = -x
|
|
||||||
version.flag := $(filter $(cflags), -mmacosx-version-min=%)
|
version.flag := $(filter $(cflags), -mmacosx-version-min=%)
|
||||||
ifeq ($(target.arch), i386)
|
ifeq ($(target.arch), i386)
|
||||||
cxx.flags := -fcheck-new
|
cxx.flags := -fcheck-new
|
||||||
|
|
@ -638,7 +637,6 @@ ifeq ($(system), Windows)
|
||||||
cxx.ldlibs :=
|
cxx.ldlibs :=
|
||||||
shared.extension = dll
|
shared.extension = dll
|
||||||
shared.ldflags := -static-libgcc -shared "$(PDBINDIR)/pd.dll"
|
shared.ldflags := -static-libgcc -shared "$(PDBINDIR)/pd.dll"
|
||||||
stripflags = --strip-unneeded -R .note -R .comment
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1055,8 +1053,11 @@ endef
|
||||||
# -p = preserve time stamps
|
# -p = preserve time stamps
|
||||||
# -m = set permission mode (as in chmod)
|
# -m = set permission mode (as in chmod)
|
||||||
# -d = create all components of specified directories
|
# -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 = install
|
||||||
INSTALL_PROGRAM := $(INSTALL) -p -m 644
|
INSTALL_PROGRAM = $(INSTALL) $(stripflags) -p -m 644
|
||||||
INSTALL_DATA := $(INSTALL) -p -m 644
|
INSTALL_DATA := $(INSTALL) -p -m 644
|
||||||
INSTALL_DIR := $(INSTALL) -m 755 -d
|
INSTALL_DIR := $(INSTALL) -m 755 -d
|
||||||
|
|
||||||
|
|
@ -1092,6 +1093,13 @@ install-datadirs: all
|
||||||
$(info ++++ info: data directories of lib $(lib.name) installed \
|
$(info ++++ info: data directories of lib $(lib.name) installed \
|
||||||
from $(CURDIR) to $(installpath))
|
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 ################################################
|
### rules: distribution targets ################################################
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue