Makefile 4.3 KB

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