Makefile 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. #
  2. # Copyright (C) 2006-2013 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. include $(INCLUDE_DIR)/image.mk
  9. UBIFS_OPTS = -F -m 2048 -e 126KiB -c 2048 -U
  10. UBI_OPTS = -m 2048 -p 128KiB -s 512
  11. AT91SAMA5D3XPLAINED_UBIFS_OPTS = -m 2048 -e 124KiB -c 2048
  12. AT91SAMA5D3XPLAINED_UBI_OPTS = -m 2048 -p 128KiB -s 2048
  13. define Image/Prepare
  14. cp $(LINUX_DIR)/arch/arm/boot/Image $(KDIR)/Image
  15. cp $(LINUX_DIR)/arch/arm/boot/zImage $(KDIR)/zImage
  16. endef
  17. define MkuImageDtb
  18. cat $(KDIR)/zImage $(DTS_DIR)/$(2).dtb > $(KDIR)/zImage-$(1)
  19. mkimage -A arm -T kernel -C none -a 0x20008000 -e 0x20008000 \
  20. -n "OpenWrt ARM $(LINUX_VERSION)" \
  21. -d $(KDIR)/zImage-$(1) $(BIN_DIR)/$(IMG_PREFIX)-$(1)-uImage
  22. endef
  23. define MkOftree
  24. cp -u $(KDIR)/zImage $(BIN_DIR)/$(IMG_PREFIX)-zImage
  25. cp $(DTS_DIR)/$(2).dtb $(BIN_DIR)/$(IMG_PREFIX)-$(1)-oftree.dtb
  26. endef
  27. # Atmel
  28. Image/Build/Kernel/AT91SAM9263EK=$(call MkuImageDtb,9263ek,at91sam9263ek)
  29. Image/Build/Kernel/AT91SAM9G15EK=$(call MkuImageDtb,9g15ek,at91sam9g15ek)
  30. Image/Build/Kernel/AT91SAM9G20EK=$(call MkOftree,9g20ek,at91sam9g20ek)
  31. Image/Build/Kernel/AT91SAM9G20EK-2MMC=$(call MkOftree,9g20ek_2mmc,at91sam9g20ek_2mmc)
  32. Image/Build/Kernel/AT91SAM9G25EK=$(call MkuImageDtb,9g25ek,at91sam9g25ek)
  33. Image/Build/Kernel/AT91SAM9G35EK=$(call MkuImageDtb,9g35ek,at91sam9g35ek)
  34. Image/Build/Kernel/AT91SAM9M10G45EK=$(call MkuImageDtb,9m10g45ek,at91sam9m10g45ek)
  35. Image/Build/Kernel/AT91SAM9X25EK=$(call MkuImageDtb,9x25ek,at91sam9x25ek)
  36. Image/Build/Kernel/AT91SAM9X35EK=$(call MkuImageDtb,9x35ek,at91sam9x35ek)
  37. Image/Build/Kernel/AT91SAMA5D3XPLAINED=$(call MkuImageDtb,sama5,at91-sama5d3_xplained)
  38. # CalAmp
  39. Image/Build/Kernel/LMU5000=$(call MkuImageDtb,lmu5000,lmu5000)
  40. # Calao
  41. Image/Build/Kernel/TNYA9260=$(call MkuImageDtb,tny_a9260,tny_a9260)
  42. Image/Build/Kernel/TNYA9263=$(call MkuImageDtb,tny_a9263,tny_a9263)
  43. Image/Build/Kernel/TNYA9G20=$(call MkuImageDtb,tny_a9g20,tny_a9g20)
  44. Image/Build/Kernel/USBA9260=$(call MkuImageDtb,usb_a9260,usb_a9260)
  45. Image/Build/Kernel/USBA9263=$(call MkuImageDtb,usb_a9263,usb_a9263)
  46. Image/Build/Kernel/USBA9G20=$(call MkuImageDtb,usb_a9g20,usb_a9g20)
  47. # Ethernut
  48. Image/Build/Kernel/ETHERNUT5=$(call MkuImageDtb,ethernut5,ethernut5)
  49. # Exegin
  50. Image/Build/Kernel/Q5XR5=$(call MkOftree,q5xr5,at91-q5xr5)
  51. define Image/Build/Kernel/Default
  52. $(call Image/Build/Kernel/AT91SAM9263EK)
  53. $(call Image/Build/Kernel/AT91SAM9G15EK)
  54. $(call Image/Build/Kernel/AT91SAM9G20EK)
  55. $(call Image/Build/Kernel/AT91SAM9G20EK-2MMC)
  56. $(call Image/Build/Kernel/AT91SAM9G25EK)
  57. $(call Image/Build/Kernel/AT91SAM9G35EK)
  58. $(call Image/Build/Kernel/AT91SAM9M10G45EK)
  59. $(call Image/Build/Kernel/AT91SAM9X25EK)
  60. $(call Image/Build/Kernel/AT91SAM9X35EK)
  61. $(call Image/Build/Kernel/LMU5000)
  62. $(call Image/Build/Kernel/TNYA9260)
  63. $(call Image/Build/Kernel/TNYA9263)
  64. $(call Image/Build/Kernel/TNYA9G20)
  65. $(call Image/Build/Kernel/USBA9260)
  66. $(call Image/Build/Kernel/USBA9263)
  67. $(call Image/Build/Kernel/USBA9G20)
  68. $(call Image/Build/Kernel/ETHERNUT5)
  69. $(call Image/Build/Kernel/Q5XR5)
  70. endef
  71. define Image/BuildKernel
  72. mkimage -A arm -T kernel -C none -a 0x20008000 -e 0x20008000 -n linux-2.6 \
  73. -d $(KDIR)/Image $(BIN_DIR)/$(IMG_PREFIX)-uImage
  74. if [ $(CONFIG_FLEXIBITY_ROOT) ]; then \
  75. $(INSTALL_BIN) $(BIN_DIR)/$(IMG_PREFIX)-uImage $(TARGET_DIR)/uImage ; \
  76. fi
  77. $(call Image/Build/Kernel/$(PROFILE))
  78. endef
  79. define Image/Build
  80. $(call Image/Build/$(1))
  81. cp $(KDIR)/root.$(1) $(BIN_DIR)/$(IMG_PREFIX)-root.$(1)
  82. endef
  83. $(eval $(call BuildImage))