Makefile 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #
  2. # Copyright (C) 2006 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. KERNEL_BUILD_DIR := $(BUILD_DIR_TOOLCHAIN)
  9. BUILD_DIR := $(KERNEL_BUILD_DIR)
  10. STAGING_DIR_HOST:=$(TOOLCHAIN_DIR)
  11. BUILD_DIR_HOST:=$(BUILD_DIR_TOOLCHAIN)
  12. override QUILT:=
  13. include $(INCLUDE_DIR)/kernel.mk
  14. PKG_NAME:=linux
  15. PKG_VERSION:=$(LINUX_VERSION)
  16. PKG_SOURCE:=$(LINUX_SOURCE)
  17. PKG_SOURCE_URL:=$(LINUX_SITE)
  18. PKG_BUILD_DIR := $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION)
  19. PKG_MD5SUM:=$(LINUX_KERNEL_MD5SUM)
  20. LINUX_DIR := $(PKG_BUILD_DIR)
  21. include $(INCLUDE_DIR)/host-build.mk
  22. include $(INCLUDE_DIR)/kernel-defaults.mk
  23. define Build/Configure/cris
  24. ln -sf $(PKG_BUILD_DIR)/include/asm-cris/arch-v10 $(PKG_BUILD_DIR)/include/asm-cris/arch
  25. ln -sf $(PKG_BUILD_DIR)/include/asm-cris/arch-v10 $(PKG_BUILD_DIR)/arch/cris/arch
  26. endef
  27. define Build/Configure/powerpc
  28. $(CP) $(PKG_BUILD_DIR)/include/asm-ppc/* $(PKG_BUILD_DIR)/include/asm-powerpc/
  29. rm -rf $(PKG_BUILD_DIR)/include/asm-ppc
  30. ln -s $(PKG_BUILD_DIR)/include/asm-powerpc $(PKG_BUILD_DIR)/include/asm-ppc
  31. endef
  32. ifneq (,$(findstring uml,$(BOARD)))
  33. LINUX_KARCH:=$(ARCH)
  34. endif
  35. KMAKE := $(MAKE) -C $(PKG_BUILD_DIR) \
  36. ARCH=$(LINUX_KARCH) \
  37. KBUILD_HAVE_NLS=no \
  38. CONFIG_SHELL=$(BASH)
  39. define Build/Prepare
  40. $(call Kernel/Prepare/Default)
  41. $(SED) 's/@expr length/@-expr length/' $(PKG_BUILD_DIR)/Makefile
  42. ln -sf linux-$(LINUX_VERSION) $(LINUX_HEADERS_DIR)
  43. yes '' | $(KMAKE) oldconfig
  44. $(KMAKE) include/linux/version.h include/asm
  45. $(call Build/Configure/$(ARCH))
  46. endef
  47. define Build/Configure
  48. endef
  49. define Build/Compile
  50. endef
  51. define Build/Install
  52. endef
  53. $(eval $(call HostBuild))