1
0

Makefile 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. # This file is part of the OpenADK project. OpenADK is copyrighted
  2. # material, please see the LICENCE file in the top-level directory.
  3. include $(ADK_TOPDIR)/rules.mk
  4. PKG_NAME:= mtd-utils
  5. PKG_VERSION:= 1.5.0
  6. PKG_RELEASE:= 2
  7. PKG_HASH:= e76c379fdd77818686a221b9642b12540e6060285aa58d6f7d016774c24d5503
  8. PKG_DESCR:= flash filesystem utilities
  9. PKG_SECTION:= sys/fs
  10. PKG_BUILDDEP:= zlib
  11. HOST_BUILDDEP:= liblzo-host
  12. PKG_URL:= http://www.linux-mtd.infradead.org
  13. PKG_SITES:= http://git.infradead.org/mtd-utils.git/snapshot/
  14. DISTFILES:= ca39eb1d98e736109c64ff9c1aa2a6ecca222d8f.tar.gz
  15. WRKDIST= ${WRKDIR}/mtd-utils-ca39eb1
  16. PKG_SUBPKGS:= MTD_UTILS NANDWRITE NANDDUMP NANDTEST FLASH_ERASE FLASH_OTP_INFO FLASH_OTP_DUMP FLASH_LOCK
  17. PKGSD_NANDWRITE:= mtd-utils nandwrite utility
  18. PKGSD_NANDDUMP:= mtd-utils nanddump utility
  19. PKGSD_NANDTEST:= mtd-utils nandtest utility
  20. PKGSD_FLASH_ERASE:= mtd-utils flash_erase utility
  21. PKGSD_FLASH_OTP_INFO:= mtd-utils flash_otp_info utility
  22. PKGSD_FLASH_OTP_DUMP:= mtd-utils flash_otp_dump utility
  23. PKGSD_FLASH_LOCK:= mtd-utils flash_lock/flash_unlock utilities
  24. PKG_FLAVOURS_MTD_UTILS:=WITH_LZO WITH_UBIFS
  25. PKGFD_WITH_LZO:= enable lzo support
  26. PKGFS_WITH_LZO:= liblzo
  27. PKGFB_WITH_LZO:= liblzo
  28. PKGFD_WITH_UBIFS:= enable ubifs support
  29. PKGFS_WITH_UBIFS:= libuuid
  30. PKGFB_WITH_UBIFS:= util-linux
  31. include $(ADK_TOPDIR)/mk/host.mk
  32. include $(ADK_TOPDIR)/mk/package.mk
  33. $(eval $(call HOST_template,MTD_UTILS,mtd-utils,$(PKG_VERSION)-${PKG_RELEASE}))
  34. $(eval $(call PKG_template,MTD_UTILS,$(PKG_NAME),$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  35. $(eval $(call PKG_template,NANDWRITE,nandwrite,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_NANDWRITE},${PKG_SECTION}))
  36. $(eval $(call PKG_template,NANDDUMP,nanddump,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_NANDDUMP},${PKG_SECTION}))
  37. $(eval $(call PKG_template,NANDTEST,nandtest,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_NANDTEST},${PKG_SECTION}))
  38. $(eval $(call PKG_template,FLASH_ERASE,flash-erase,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_FLASH_ERASE},${PKG_SECTION}))
  39. $(eval $(call PKG_template,FLASH_OTP_INFO,flash-otp-info,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_FLASH_OTP_INFO},${PKG_SECTION}))
  40. $(eval $(call PKG_template,FLASH_OTP_DUMP,flash-otp-dump,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_FLASH_OTP_DUMP},${PKG_SECTION}))
  41. $(eval $(call PKG_template,FLASH_LOCK,flash-lock,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_FLASH_LOCK},${PKG_SECTION}))
  42. HOST_STYLE:= manual
  43. HOST_CPPFLAGS+= -DWITHOUT_XATTR=1 -I./include
  44. host-build:
  45. (cd ${WRKBUILD} && env ${HOST_MAKE_ENV} ${MAKE} -f ${MAKE_FILE} \
  46. ${HOST_MAKE_FLAGS} ${HOST_ALL_TARGET})
  47. mtd-utils-hostinstall:
  48. ${INSTALL_DIR} ${STAGING_HOST_DIR}/usr/bin
  49. ${INSTALL_BIN} ${WRKBUILD}/mkfs.jffs2 \
  50. ${STAGING_HOST_DIR}/usr/bin
  51. CONFIG_STYLE:= manual
  52. XAKE_FLAGS+= WITHOUT_XATTR=1
  53. ifneq (${ADK_PACKAGE_MTD_UTILS_WITH_LZO},y)
  54. XAKE_FLAGS+= WITHOUT_LZO=1
  55. endif
  56. ifneq (${ADK_PACKAGE_MTD_UTILS_WITH_UBIFS},y)
  57. XAKE_FLAGS+= WITHOUT_UBI=1
  58. endif
  59. XAKE_FLAGS+= BUILDDIR="${WRKDIST}"
  60. mtd-utils-install:
  61. $(INSTALL_DIR) $(IDIR_MTD_UTILS)/usr/bin
  62. $(INSTALL_BIN) $(WRKINST)/usr/sbin/{doc,flash_otp_,ftl_,nftl,rfd}* \
  63. ${WRKINST}/usr/sbin/{flashcp,jffs2dump,mkfs.jffs2,mtd_debug,recv_image,serve_image,sumtool} \
  64. $(IDIR_MTD_UTILS)/usr/bin
  65. nandwrite-install:
  66. $(INSTALL_DIR) $(IDIR_NANDWRITE)/usr/sbin
  67. ${INSTALL_BIN} ${WRKINST}/usr/sbin/nandwrite \
  68. ${IDIR_NANDWRITE}/usr/sbin
  69. nanddump-install:
  70. $(INSTALL_DIR) $(IDIR_NANDDUMP)/usr/sbin
  71. ${INSTALL_BIN} ${WRKINST}/usr/sbin/nanddump \
  72. ${IDIR_NANDDUMP}/usr/sbin
  73. nandtest-install:
  74. $(INSTALL_DIR) $(IDIR_NANDTEST)/usr/sbin
  75. ${INSTALL_BIN} ${WRKINST}/usr/sbin/nandtest \
  76. ${IDIR_NANDTEST}/usr/sbin
  77. flash-erase-install:
  78. $(INSTALL_DIR) $(IDIR_FLASH_ERASE)/usr/sbin
  79. ${INSTALL_BIN} ${WRKINST}/usr/sbin/flash_erase \
  80. ${IDIR_FLASH_ERASE}/usr/sbin
  81. flash-otp-info-install:
  82. $(INSTALL_DIR) $(IDIR_FLASH_OTP_INFO)/usr/sbin
  83. ${INSTALL_BIN} ${WRKINST}/usr/sbin/flash_otp_info \
  84. ${IDIR_FLASH_OTP_INFO}/usr/sbin
  85. flash-otp-dump-install:
  86. $(INSTALL_DIR) $(IDIR_FLASH_OTP_DUMP)/usr/sbin
  87. ${INSTALL_BIN} ${WRKINST}/usr/sbin/flash_otp_dump \
  88. ${IDIR_FLASH_OTP_DUMP}/usr/sbin
  89. flash-lock-install:
  90. $(INSTALL_DIR) $(IDIR_FLASH_LOCK)/usr/sbin
  91. ${INSTALL_BIN} ${WRKINST}/usr/sbin/flash_{lock,unlock} \
  92. ${IDIR_FLASH_LOCK}/usr/sbin
  93. include ${ADK_TOPDIR}/mk/host-bottom.mk
  94. include ${ADK_TOPDIR}/mk/pkg-bottom.mk