Makefile 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #
  2. # Copyright (C) 2012-2015 OpenWrt.org
  3. # Copyright (C) 2016-2017 LEDE project
  4. #
  5. # This is free software, licensed under the GNU General Public License v2.
  6. # See /LICENSE for more information.
  7. #
  8. include $(TOPDIR)/rules.mk
  9. include $(INCLUDE_DIR)/image.mk
  10. # for arm
  11. KERNEL_LOADADDR := 0x80008000
  12. # for arm64
  13. ifeq ($(SUBTARGET),mt7622)
  14. KERNEL_LOADADDR = 0x41080000
  15. endif
  16. ifeq ($(SUBTARGET),mt7629)
  17. KERNEL_LOADADDR = 0x40008000
  18. endif
  19. define Build/sysupgrade-emmc
  20. rm -f [email protected]
  21. mkfs.fat -C [email protected] 3070
  22. ./gen_mt7623_emmc_img.sh $@ \
  23. $(IMAGE_KERNEL) \
  24. [email protected] \
  25. $(IMAGE_ROOTFS)
  26. endef
  27. # default all platform image(fit) build
  28. define Device/Default
  29. PROFILES = Default $$(DEVICE_NAME)
  30. KERNEL_NAME := zImage
  31. FILESYSTEMS := squashfs
  32. DEVICE_DTS_DIR := $(DTS_DIR)
  33. IMAGES := sysupgrade.bin
  34. IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
  35. SUPPORTED_DEVICES := $(subst _,$(comma),$(1))
  36. ifeq ($(SUBTARGET),mt7623)
  37. KERNEL_NAME := zImage
  38. KERNEL := kernel-bin | append-dtb | uImage none
  39. KERNEL_INITRAMFS := kernel-bin | append-dtb | uImage none
  40. else
  41. KERNEL_NAME := Image
  42. KERNEL = kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
  43. KERNEL_INITRAMFS = kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
  44. endif
  45. endef
  46. ifeq ($(SUBTARGET),mt7622)
  47. include mt7622.mk
  48. endif
  49. ifeq ($(SUBTARGET),mt7623)
  50. include mt7623.mk
  51. endif
  52. ifeq ($(SUBTARGET),mt7629)
  53. include mt7629.mk
  54. endif
  55. define Image/Build
  56. $(call Image/Build/$(1),$(1))
  57. endef
  58. $(eval $(call BuildImage))