summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorTony Theodore <tonyt@logyst.com>2016-08-17 06:34:53 (GMT)
committerBoris Nagaev <bnagaev@gmail.com>2016-10-23 14:59:21 (GMT)
commitc255ff8b5a4ab6b097cd3d9f76a28a93dcf510d4 (patch)
tree3ad73e9855299ea697f0f8d700b3461ba8b7d8dc /Makefile
parent0eeffd4d39b06aadc3a3b60a7fe16006f2791094 (diff)
downloadmxe-c255ff8b5a4ab6b097cd3d9f76a28a93dcf510d4.zip
mxe-c255ff8b5a4ab6b097cd3d9f76a28a93dcf510d4.tar.gz
mxe-c255ff8b5a4ab6b097cd3d9f76a28a93dcf510d4.tar.bz2
Add options to strip toolchain, executables, and libs
Minimal implementation to strip the [largest files][lf-gist] by default, mostly made up of gcc/binutils and test programs. gdal and geos both produce large libraries, but the libs themselves aren't worth stripping, it's the 20 odd programs produced by gdal with those libs statically linked that consume the most space. I'm leaving these undocumented as the defaults seems reasonable and the interface may well change when we enable debug/release variants. closes #985 closes #1249 [lf-gist]:https://github.com/mxe/mxe/issues/1249#issuecomment-193392038
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile8
1 files changed, 8 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index a46b32a..8184be0 100644
--- a/Makefile
+++ b/Makefile
@@ -54,6 +54,11 @@ PKGS := $(call set_create,\
BUILD := $(shell '$(EXT_DIR)/config.guess')
PATH := $(PREFIX)/$(BUILD)/bin:$(PREFIX)/bin:$(PATH)
+# set to empty or $(false) to disable stripping
+STRIP_TOOLCHAIN := $(true)
+STRIP_LIB := $(false)
+STRIP_EXE := $(true)
+
# All pkgs have (implied) order-only dependencies on MXE_CONF_PKGS.
# These aren't meaningful to the pkg list in docs/index.html so
# use a list in case we want to separate autotools, cmake etc.
@@ -549,6 +554,8 @@ build-only-$(1)_$(3): LIB_SUFFIX = $(if $(findstring shared,$(3)),dll,a)
build-only-$(1)_$(3): BITS = $(if $(findstring x86_64,$(3)),64,32)
build-only-$(1)_$(3): BUILD_TYPE = $(if $(findstring debug,$(3) $($(1)_CONFIGURE_OPTS)),debug,release)
build-only-$(1)_$(3): BUILD_TYPE_SUFFIX = $(if $(findstring debug,$(3) $($(1)_CONFIGURE_OPTS)),d)
+build-only-$(1)_$(3): INSTALL_STRIP_TOOLCHAIN = install$(if $(STRIP_TOOLCHAIN),-strip)
+build-only-$(1)_$(3): INSTALL_STRIP_LIB = install$(if $(STRIP_LIB),-strip)
build-only-$(1)_$(3): SOURCE_DIR = $(or $(realpath $($(1)_SOURCE_TREE)),$(2)/$($(1)_SUBDIR))
build-only-$(1)_$(3): BUILD_DIR = $(2)/$(if $($(1)_SOURCE_TREE),local,$($(1)_SUBDIR)).build_
build-only-$(1)_$(3): TEST_FILE = $($(1)_TEST_FILE)
@@ -586,6 +593,7 @@ build-only-$(1)_$(3):
@echo
@echo 'settings.mk'
@cat '$(TOP_DIR)/settings.mk'
+ $(if $(STRIP_EXE),-$(TARGET)-strip '$(PREFIX)/$(TARGET)/bin/test-$(PKG).exe')
(du -k -d 0 '$(2)' 2>/dev/null || du -k --max-depth 0 '$(2)') | $(SED) -n 's/^\(\S*\).*/du: \1 KiB/p'
rm -rfv '$(2)'
)