Makefile 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. define Build/sysupgrade-emmc
  17. rm -f [email protected]
  18. mkfs.fat -C [email protected] 3070
  19. ./gen_mt7623_emmc_img.sh $@ \
  20. $(IMAGE_KERNEL) \
  21. [email protected] \
  22. $(IMAGE_ROOTFS)
  23. endef
  24. # default all platform image(fit) build
  25. define Device/Default
  26. PROFILES = Default $$(DEVICE_NAME)
  27. KERNEL_NAME := zImage
  28. FILESYSTEMS := squashfs
  29. DEVICE_DTS_DIR := $(DTS_DIR)
  30. IMAGES := sysupgrade.bin
  31. IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
  32. ifeq ($(SUBTARGET),mt7623)
  33. KERNEL_NAME := zImage
  34. KERNEL := kernel-bin | append-dtb | uImage none
  35. KERNEL_INITRAMFS := kernel-bin | append-dtb | uImage none
  36. endif
  37. ifeq ($(SUBTARGET),mt7622)
  38. KERNEL_NAME := Image
  39. KERNEL = kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
  40. KERNEL_INITRAMFS = kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
  41. endif
  42. endef
  43. ifeq ($(SUBTARGET),mt7622)
  44. include mt7622.mk
  45. endif
  46. ifeq ($(SUBTARGET),mt7623)
  47. include mt7623.mk
  48. endif
  49. define Image/Build
  50. $(call Image/Build/$(1),$(1))
  51. endef
  52. $(eval $(call BuildImage))