$(LINUX_DIR)/.unpacked: $(DL_DIR)/$(LINUX_SOURCE)
-mkdir -p $(LINUX_BUILD_DIR)
bzcat $(DL_DIR)/$(LINUX_SOURCE) | tar -C $(LINUX_BUILD_DIR) $(TAR_OPTIONS) -
- rm -f $(BUILD_DIR)/linux
- ln -s $(LINUX_BUILD_DIR)/linux-$(LINUX_VERSION) $(BUILD_DIR)/linux
touch $@
ifeq ($(KERNEL),2.4)
touch $@
endif
-$(LINUX_DIR)/vmlinux: $(STAMP_DIR)/.linux-compile
+$(LINUX_DIR)/vmlinux: $(STAMP_DIR)/.linux-compile FORCE
$(MAKE) -C $(LINUX_DIR) CROSS_COMPILE="$(KERNEL_CROSS)" ARCH=$(LINUX_KARCH) PATH=$(TARGET_PATH)
$(LINUX_KERNEL): $(LINUX_DIR)/vmlinux
$(STAMP_DIR)/.linux-compile:
@$(MAKE) $(LINUX_DIR)/.modules_done $(TARGETS) $(KERNEL_IPKG)
ln -sf $(LINUX_BUILD_DIR)/linux-$(LINUX_VERSION) $(BUILD_DIR)/linux
- $(MAKE) -C $(TOPDIR)/target/linux/package \
- $(KPKG_MAKEOPTS) \
- compile
touch $@
-.PHONY: pkg-install
-pkg-install:
- @mkdir -p $(TARGET_MODULES_DIR)
- @rm -rf $(LINUX_BUILD_DIR)/root*
- @cp -fpR $(BUILD_DIR)/root $(LINUX_BUILD_DIR)/
- echo -e 'dest root /\noption offline_root $(LINUX_BUILD_DIR)/root' > $(LINUX_BUILD_DIR)/ipkg.conf
- $(MAKE) -C $(TOPDIR)/target/linux/package \
- $(KPKG_MAKEOPTS) \
- install
- [ "$(INSTALL_TARGETS)" != "" ] && $(IPKG_KERNEL) install $(INSTALL_TARGETS)
-
$(KERNEL_IPKG):
rm -rf $(KERNEL_IDIR)
mkdir -p $(KERNEL_IDIR)/etc
fi
$(IPKG_BUILD) $(KERNEL_IDIR) $(LINUX_BUILD_DIR)
+$(BUILD_DIR)/kernel.mk: FORCE
+ echo "BOARD:=$(BOARD)" > $@
+ echo "LINUX_VERSION:=$(LINUX_VERSION)" >> $@
+ echo "LINUX_RELEASE:=$(LINUX_RELEASE)" >> $@
+
source: $(DL_DIR)/$(LINUX_SOURCE)
-prepare:
+prepare: $(BUILD_DIR)/kernel.mk
@mkdir -p $(STAMP_DIR) $(PACKAGE_DIR)
@$(MAKE) $(LINUX_DIR)/.configured
compile: prepare $(STAMP_DIR)/.linux-compile
-install: compile
- $(MAKE) $(KPKG_MAKEOPTS) pkg-install
- $(MAKE) $(KPKG_MAKEOPTS) $(LINUX_KERNEL)
+install: compile $(LINUX_KERNEL)
mostlyclean:
rm -f $(STAMP_DIR)/.linux-compile
rebuild:
-$(MAKE) mostlyclean
- @[ -f $(LINUX_KERNEL) ] && $(MAKE) clean
- $(MAKE) compile
+ if [ -f $(LINUX_KERNEL) ]; then \
+ $(MAKE) clean; \
+ fi
+ $(MAKE) compile $(MAKE_TRACE)
clean:
rm -f $(STAMP_DIR)/.linux-compile
rm -rf $(LINUX_BUILD_DIR)
rm -f $(TARGETS)
-package/%:
- $(MAKE) -C $(TOPDIR)/target/linux/package \
- $(KPKG_MAKEOPTS) \
- $(patsubst package/%,%,$@)