aboutsummaryrefslogtreecommitdiffstats
path: root/target/sdk
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2014-03-13 14:14:00 +0000
committerFelix Fietkau <nbd@openwrt.org>2014-03-13 14:14:00 +0000
commit6e860abc2668aa6cfe161db3c969434f89e352f4 (patch)
treefb3cc53a834935805e8586b82314e25c65d481d0 /target/sdk
parentb925adba7e3d533d292b3c8523a2d0897c9eaca5 (diff)
downloadupstream-6e860abc2668aa6cfe161db3c969434f89e352f4.tar.gz
upstream-6e860abc2668aa6cfe161db3c969434f89e352f4.tar.bz2
upstream-6e860abc2668aa6cfe161db3c969434f89e352f4.zip
target/sdk: strip host binaries before packing
Signed-off-by: Felix Fietkau <nbd@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@39915 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/sdk')
-rw-r--r--target/sdk/Makefile21
1 files changed, 19 insertions, 2 deletions
diff --git a/target/sdk/Makefile b/target/sdk/Makefile
index 14cb8d0644..828cff5880 100644
--- a/target/sdk/Makefile
+++ b/target/sdk/Makefile
@@ -17,7 +17,9 @@ PKG_CPU:=$(word 1,$(subst -, ,$(shell $(HOSTCC) -dumpmachine)))
SDK_NAME:=OpenWrt-SDK-$(BOARD)-for-$(PKG_OS)-$(PKG_CPU)-gcc-$(GCCV)_$(LIBC)-$(LIBCV)
SDK_BUILD_DIR:=$(BUILD_DIR)/$(SDK_NAME)
+STAGING_SUBDIR_HOST := staging_dir/host
STAGING_SUBDIR_TARGET := staging_dir/target-$(ARCH)$(ARCH_SUFFIX)_$(LIBC)-$(LIBCV)$(if $(CONFIG_arm),_eabi)
+STAGING_SUBDIR_TOOLCHAIN := staging_dir/toolchain-$(ARCH)$(ARCH_SUFFIX)_gcc-$(GCCV)_$(LIBC)-$(LIBCV)$(if $(CONFIG_arm),_eabi)
EXCLUDE_DIRS:=*/ccache \
*/stamp \
@@ -33,9 +35,9 @@ EXCLUDE_DIRS:=*/ccache \
$(STAGING_SUBDIR_TARGET)/usr/bin
SDK_DIRS = \
- staging_dir/host \
+ $(STAGING_SUBDIR_HOST) \
$(STAGING_SUBDIR_TARGET) \
- staging_dir/toolchain-$(ARCH)$(ARCH_SUFFIX)_gcc-$(GCCV)_$(LIBC)-$(LIBCV)$(if $(CONFIG_arm),_eabi) \
+ $(STAGING_SUBDIR_TOOLCHAIN)
SVN_PACKAGE_URL=$(shell svn info ../../package | awk '/^URL:/ { print $$2; }')
@@ -69,6 +71,21 @@ $(BIN_DIR)/$(SDK_NAME).tar.bz2: clean
$(foreach exclude,$(EXCLUDE_DIRS),--exclude="$(exclude)") \
$(SDK_DIRS) $(KERNEL_FILES) | \
$(TAR) -xf - -C $(SDK_BUILD_DIR)
+
+ @-( \
+ find \
+ $(SDK_BUILD_DIR)/$(STAGING_SUBDIR_HOST)/bin \
+ $(SDK_BUILD_DIR)/$(STAGING_SUBDIR_HOST)/usr/bin \
+ $(SDK_BUILD_DIR)/$(STAGING_SUBDIR_TOOLCHAIN)/bin \
+ $(SDK_BUILD_DIR)/$(STAGING_SUBDIR_TOOLCHAIN)/*/bin \
+ $(SDK_BUILD_DIR)/$(STAGING_SUBDIR_TOOLCHAIN)/libexec \
+ -type f; \
+ find \
+ $(SDK_BUILD_DIR)/$(STAGING_SUBDIR_HOST)/lib \
+ $(SDK_BUILD_DIR)/$(STAGING_SUBDIR_HOST)/usr/lib \
+ -type f -name \*.so\* -or -name \*.a; \
+ ) | xargs strip 2>/dev/null >/dev/null
+
mkdir -p $(SDK_BUILD_DIR)/target/linux
$(CP) $(GENERIC_PLATFORM_DIR) $(PLATFORM_DIR) $(SDK_BUILD_DIR)/target/linux/
rm -rf \