Makefile 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. KERNEL_LOADADDR := 0x20008000
  10. define Build/at91-install-zImage
  11. $(CP) $(KDIR)/zImage $@
  12. endef
  13. ifeq ($(SUBTARGET),sam9x)
  14. include ./sam9x.mk
  15. endif
  16. ifeq ($(SUBTARGET),sama5)
  17. include ./sama5.mk
  18. endif
  19. AT91_SD_BOOT_PARTSIZE:=64
  20. FAT32_BLOCK_SIZE:=1024
  21. FAT32_BLOCKS:=$(shell echo \
  22. $$(($(AT91_SD_BOOT_PARTSIZE)*1024*1024/$(FAT32_BLOCK_SIZE))))
  23. define Device/Default
  24. $(Device/default-nand)
  25. PROFILES := Default
  26. FILESYSTEMS := squashfs ubifs ext4
  27. DEVICE_DTS := $(1)
  28. KERNEL_NAME := zImage
  29. KERNEL_SIZE := 4096k
  30. KERNEL := kernel-bin | append-dtb | lzma | uImage lzma
  31. DTB_SIZE := 128k
  32. endef
  33. define Device/dtb
  34. KERNEL := kernel-bin | lzma | uImage lzma
  35. endef
  36. define Device/evaluation-sdimage
  37. IMAGES += sdcard.img.gz
  38. IMAGE/sdcard.img.gz := at91-sdcard
  39. endef
  40. define Device/evaluation
  41. KERNEL_INSTALL := 1
  42. KERNEL_SUFFIX := -uImage
  43. IMAGES := root.ubi
  44. IMAGE/root.ubi := append-ubi
  45. endef
  46. define Device/evaluation-zImage
  47. IMAGES += zImage
  48. IMAGE/zImage := at91-install-zImage
  49. endef
  50. define Device/evaluation-dtb
  51. $(Device/evaluation)
  52. $(Device/dtb)
  53. $(Device/evaluation-zImage)
  54. IMAGES += dtb
  55. IMAGE/dtb := install-dtb
  56. KERNEL_SUFFIX := -fit-zImage.itb
  57. KERNEL := kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb
  58. endef
  59. define Device/evaluation-fit
  60. $(Device/evaluation)
  61. KERNEL_SUFFIX := -fit-uImage.itb
  62. KERNEL := kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb
  63. endef
  64. define Device/production
  65. UBINIZE_OPTS := -E 5
  66. IMAGES := factory.bin
  67. IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi
  68. endef
  69. define Device/production-dtb
  70. $(Device/production)
  71. $(Device/dtb)
  72. IMAGE/factory.bin := append-dtb | pad-to $$$$(DTB_SIZE) \
  73. | append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi
  74. endef
  75. $(eval $(call BuildImage))