summaryrefslogtreecommitdiff
path: root/target/sdk
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2014-03-10 11:12:37 +0000
committerFelix Fietkau <nbd@openwrt.org>2014-03-10 11:12:37 +0000
commitba3b720fe615df5d6aa4850bf743ad0e028d186a (patch)
treed86a5fdb69f662a261a0ce7796d67809846edd08 /target/sdk
parent318052e03cae4de1f4b8dd0d170870834e0212d3 (diff)
downloadmtk-20170518-ba3b720fe615df5d6aa4850bf743ad0e028d186a.zip
mtk-20170518-ba3b720fe615df5d6aa4850bf743ad0e028d186a.tar.gz
mtk-20170518-ba3b720fe615df5d6aa4850bf743ad0e028d186a.tar.bz2
target/sdk: add support for building kernel module packages
Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 39858
Diffstat (limited to 'target/sdk')
-rw-r--r--target/sdk/Makefile31
1 files changed, 28 insertions, 3 deletions
diff --git a/target/sdk/Makefile b/target/sdk/Makefile
index d6c42b0..82b47cd 100644
--- a/target/sdk/Makefile
+++ b/target/sdk/Makefile
@@ -20,10 +20,36 @@ EXCLUDE_DIRS:=*/ccache \
*/stamp \
*/stampfiles \
*/man \
- */info
+ */info \
+
+SDK_DIRS = \
+ staging_dir/host \
+ staging_dir/target-$(ARCH)$(ARCH_SUFFIX)_$(LIBC)-$(LIBCV)$(if $(CONFIG_arm),_eabi) \
+ staging_dir/toolchain-$(ARCH)$(ARCH_SUFFIX)_gcc-$(GCCV)_$(LIBC)-$(LIBCV)$(if $(CONFIG_arm),_eabi) \
SVN_PACKAGE_URL=$(shell svn info ../../package | awk '/^URL:/ { print $$2; }')
+KDIR_BASE = $(patsubst $(TOPDIR)/%,%,$(LINUX_DIR))
+
+KERNEL_FILES_ARCH = \
+ Makefile* \
+ module.lds \
+ Kbuild.platforms \
+ */Platform \
+ include \
+ scripts \
+ kernel/asm-offsets.s
+
+KERNEL_FILES_BASE := \
+ .config \
+ Makefile \
+ scripts \
+ include \
+ Module.symvers \
+ $(addprefix arch/$(LINUX_KARCH)/,$(KERNEL_FILES_ARCH))
+
+KERNEL_FILES := $(patsubst $(TOPDIR)/%,%,$(wildcard $(addprefix $(LINUX_DIR)/,$(KERNEL_FILES_BASE))))
+
all: compile
$(BIN_DIR)/$(SDK_NAME).tar.bz2: clean
@@ -32,8 +58,7 @@ $(BIN_DIR)/$(SDK_NAME).tar.bz2: clean
$(TAR) -cf - -C $(TOPDIR) \
$(foreach exclude,$(EXCLUDE_DIRS),--exclude="$(exclude)") \
--exclude="staging_dir/$(ARCH)" \
- staging_dir/host staging_dir/target-$(ARCH)$(ARCH_SUFFIX)_$(LIBC)-$(LIBCV)$(if $(CONFIG_arm),_eabi) \
- staging_dir/toolchain-$(ARCH)$(ARCH_SUFFIX)_gcc-$(GCCV)_$(LIBC)-$(LIBCV)$(if $(CONFIG_arm),_eabi) | \
+ $(SDK_DIRS) $(KERNEL_FILES) | \
$(TAR) -xf - -C $(SDK_BUILD_DIR)
mkdir -p $(SDK_BUILD_DIR)/target/linux
$(CP) $(GENERIC_PLATFORM_DIR) $(PLATFORM_DIR) $(SDK_BUILD_DIR)/target/linux/