Makefile 3.7 KB

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