# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
+include $(INCLUDE_DIR)/host.mk
-include $(INCLUDE_DIR)/modules-$(KERNEL).mk
LINUX_SOURCE:=linux-$(LINUX_VERSION).tar.bz2
TARGETS += $(KERNEL_IPKG)
INSTALL_TARGETS += $(KERNEL_IPKG)
+LINUX_KARCH:=$(shell echo $(ARCH) | sed -e 's/i[3-9]86/i386/' \
+ -e 's/mipsel/mips/' \
+ -e 's/mipseb/mips/' \
+ -e 's/powerpc/ppc/' \
+ -e 's/sh[234]/sh/' \
+ -e 's/armeb/arm/' \
+)
+
+
$(TARGETS): $(PACKAGE_DIR)
$(PACKAGE_DIR):
$(LINUX_DIR)/.unpacked: $(DL_DIR)/$(LINUX_SOURCE)
-mkdir -p $(KERNEL_BUILD_DIR)
- bzcat $(DL_DIR)/$(LINUX_SOURCE) | tar -C $(KERNEL_BUILD_DIR) $(TAR_OPTIONS) -
+ bzcat $(DL_DIR)/$(LINUX_SOURCE) | tar -C $(KERNEL_BUILD_DIR) $(TAR_OPTIONS)
touch $@
ifeq ($(KERNEL),2.4)
@rm -f $(BUILD_DIR)/linux
ln -sf $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION) $(BUILD_DIR)/linux
@$(MAKE) modules
- @$(MAKE) packages
touch $@
$(KERNEL_IPKG):
echo "CONFIG_KERNEL:=$(KERNEL)" >> $@
echo "CONFIG_LINUX_VERSION:=$(LINUX_VERSION)" >> $@
echo "CONFIG_LINUX_RELEASE:=$(LINUX_RELEASE)" >> $@
+ echo "CONFIG_LINUX_KARCH:=$(LINUX_KARCH)" >> $@
pkg-install: FORCE
@for pkg in $(INSTALL_TARGETS); do \
@mkdir -p $(LINUX_DIR) $(PACKAGE_DIR)
compile: prepare $(LINUX_DIR)/.linux-compile
+ @$(MAKE) packages
install: compile $(LINUX_KERNEL)