Makefile 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. define Build/sysupgrade-emmc
  11. rm -f [email protected]
  12. mkfs.fat -C [email protected] 3070
  13. ./gen_$(SUBTARGET)_emmc_img.sh $@ \
  14. $(IMAGE_KERNEL) \
  15. [email protected] \
  16. $(IMAGE_ROOTFS)
  17. endef
  18. # default all platform image(fit) build
  19. define Device/Default
  20. PROFILES = Default $$(DEVICE_NAME)
  21. KERNEL_NAME := zImage
  22. FILESYSTEMS := squashfs
  23. DEVICE_DTS_DIR := $(DTS_DIR)
  24. IMAGES := sysupgrade.bin
  25. IMAGE/sysupgrade.bin := append-kernel | pad-to 128k | append-rootfs | pad-rootfs | append-metadata
  26. SUPPORTED_DEVICES := $(subst _,$(comma),$(1))
  27. ifeq ($(SUBTARGET),mt7623)
  28. KERNEL_NAME := zImage
  29. KERNEL := kernel-bin | append-dtb | uImage none
  30. KERNEL_INITRAMFS := kernel-bin | append-dtb | uImage none
  31. else
  32. KERNEL_NAME := Image
  33. KERNEL = kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
  34. KERNEL_INITRAMFS = kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
  35. endif
  36. endef
  37. include $(SUBTARGET).mk
  38. define Image/Build
  39. $(call Image/Build/$(1),$(1))
  40. endef
  41. $(eval $(call BuildImage))