PageRenderTime 37ms CodeModel.GetById 10ms RepoModel.GetById 0ms app.codeStats 0ms

/target/linux/mpc85xx/image/Makefile

https://gitlab.com/gl-xinshouyong/1407-mifi-customer-tmp
Makefile | 77 lines | 56 code | 15 blank | 6 comment | 0 complexity | 8a338c46b03044aaf16505236c2e3602 MD5 | raw file
  1. #
  2. # Copyright (C) 2010 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. define imgname
  10. $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(patsubst jffs2-%,jffs2,$(patsubst squashfs-%,squashfs,$(1)))
  11. endef
  12. define sysupname
  13. $(call imgname,$(1),$(2))-sysupgrade.bin
  14. endef
  15. define factoryname
  16. $(call imgname,$(1),$(2))-factory.bin
  17. endef
  18. zImage:=$(BIN_DIR)/$(IMG_PREFIX)-zImage
  19. DTS_TARGETS = mpc8548cds_32b p1010rdb tl-wdr4900-v1 p1020rdb
  20. BOOT_IMAGES:=zImage cuImage.tl-wdr4900-v1
  21. define Image/Prepare
  22. $(foreach image,$(BOOT_IMAGES),
  23. cp $(LINUX_DIR)/arch/powerpc/boot/$(image) $(KDIR)/$(image)
  24. )
  25. endef
  26. define Image/BuildKernel
  27. cp $(KDIR)/zImage $(zImage)
  28. $(foreach dts,$(DTS_TARGETS),
  29. $(LINUX_DIR)/scripts/dtc/dtc -I dts -O dtb $(DTS_DIR)/$(dts).dts > $(BIN_DIR)/$(IMG_PREFIX)-$(dts).fdt
  30. )
  31. endef
  32. define Image/Build/TPLINK
  33. -$(STAGING_DIR_HOST)/bin/mktplinkfw \
  34. -H $(4) -W $(5) -F $(6) -N OpenWrt -V $(REVISION) $(7) \
  35. -k $(KDIR)/$(3) \
  36. -r $(KDIR)/root.$(1) \
  37. -o $(call factoryname,$(1),$(2))
  38. -$(STAGING_DIR_HOST)/bin/mktplinkfw \
  39. -H $(4) -W $(5) -F $(6) -N OpenWrt -V $(REVISION) $(7) -s \
  40. -k $(KDIR)/$(3) \
  41. -r $(KDIR)/root.$(1) \
  42. -o $(call sysupname,$(1),$(2))
  43. endef
  44. define Image/Build/Profile/TLWDR4900
  45. $(call Image/Build/TPLINK,$(1),tl-wdr4900-v1,cuImage.tl-wdr4900-v1,0x49000001,1,16Mppc)
  46. endef
  47. define Image/Build/Profile/Default
  48. $(call Image/Build/Profile/TLWDR4900,$(1))
  49. endef
  50. define Image/Build/ext2
  51. cp $(KDIR)/root.$(1) $(BIN_DIR)/$(IMG_PREFIX)-ext2.img
  52. endef
  53. define Image/Build/squashfs
  54. $(call prepare_generic_squashfs,$(KDIR)/root.squashfs)
  55. cp $(KDIR)/root.squashfs $(BIN_DIR)/$(IMG_PREFIX)-root.squashfs
  56. endef
  57. PROFILE ?= Default
  58. define Image/Build
  59. $(call Image/Build/$(1),$(1))
  60. $(call Image/Build/Profile/$(PROFILE),$(1))
  61. endef
  62. $(eval $(call BuildImage))