d53017018c71778d31aa3c72559d71c805c4ad2a
[openwrt/staging/stintel.git] / package / kernel / linux / Makefile
1 #
2 # Copyright (C) 2006-2010 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9 include $(INCLUDE_DIR)/kernel.mk
10
11 PKG_NAME:=kernel
12 PKG_FLAGS:=hold
13
14 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/packages
15 SUBTARGETS = $(sort $(filter-out feeds,$(notdir $(wildcard $(TOPDIR)/target/linux/* $(TOPDIR)/target/linux/feeds/*))))
16 SUBTARGET_MODULES = $(foreach t,$(SUBTARGETS),$(firstword $(wildcard $(TOPDIR)/target/linux/feeds/$(t)/modules.mk $(TOPDIR)/target/linux/$(t)/modules.mk)))
17 SCAN_DEPS=modules/*.mk $(SUBTARGET_MODULES) $(TOPDIR)/include/netfilter.mk
18
19 PKG_LICENSE:=GPL-2.0-only
20 PKG_LICENSE_FILES:=COPYING
21
22 export SHELL:=/bin/sh
23 .ONESHELL:
24 .SHELLFLAGS = -ec
25
26 include $(INCLUDE_DIR)/package.mk
27
28 ifeq ($(DUMP),)
29 STAMP_BUILT:=$(STAMP_BUILT)_$(shell $(SCRIPT_DIR)/kconfig.pl $(LINUX_DIR)/.config | $(MKHASH) md5)
30 -include $(LINUX_DIR)/.config
31 endif
32
33 define Build/Prepare
34 mkdir -p $(PKG_BUILD_DIR)
35 endef
36
37 define Build/Configure
38 endef
39
40 define Build/Quilt
41 endef
42
43 define Build/Compile
44 endef
45
46 define KernelPackage/depends
47 endef
48
49 CONFIG_PACKAGE_kernel=y
50 define Package/kernel
51 SECTION:=sys
52 CATEGORY:=Kernel
53 DEFAULT:=y
54 TITLE:=Virtual kernel package
55 VERSION:=$(LINUX_VERSION)-$(LINUX_RELEASE)-$(LINUX_VERMAGIC)
56 URL:=http://www.kernel.org/
57 PKG_FLAGS:=nonshared
58 endef
59
60 define Package/kernel/install
61 $(INSTALL_DIR) $(1)/$(MODULES_SUBDIR)
62 $(INSTALL_DATA) $(LINUX_DIR)/modules.builtin $(1)/$(MODULES_SUBDIR)
63 $(SED) 's,.*/,,' $(1)/$(MODULES_SUBDIR)/modules.builtin
64 strings $(LINUX_DIR)/modules.builtin.modinfo | \
65 grep -E -v "\.(file$(if CONFIG_MODULE_STRIPPED,|parmtype))=" | \
66 tr '\n' '\0' > $(1)/$(MODULES_SUBDIR)/modules.builtin.modinfo
67 endef
68
69 define Package/kernel/extra_provides
70 sed -e 's,.*/,,' $(LINUX_DIR)/modules.builtin;
71 endef
72
73 $(eval $(if $(DUMP),,$(call BuildPackage,kernel)))
74
75 include $(sort $(wildcard ./modules/*.mk))
76 -include $(SUBTARGET_MODULES)