summaryrefslogtreecommitdiff
path: root/package/mtd-utils/Makefile
blob: 6d2e2a1651d521a5da7eed316d71d16729ab129e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# This file is part of the OpenADK project. OpenADK is copyrighted
# material, please see the LICENCE file in the top-level directory.

include $(ADK_TOPDIR)/rules.mk

PKG_NAME:=		mtd-utils
PKG_VERSION:=		1.5.0
PKG_RELEASE:=		2
PKG_MD5SUM:=		fd929de593acadd658d45feb07f993aa
PKG_DESCR:=		flash filesystem utilities
PKG_SECTION:=		sys/fs
HOST_BUILDDEP:=		liblzo-host
PKG_URL:=		http://www.linux-mtd.infradead.org
PKG_SITES:=		http://git.infradead.org/mtd-utils.git/snapshot/

DISTFILES:=             ca39eb1d98e736109c64ff9c1aa2a6ecca222d8f.tar.gz
WRKDIST=		${WRKDIR}/mtd-utils-ca39eb1

PKG_SUBPKGS:=		MTD_UTILS NANDWRITE NANDDUMP NANDTEST FLASH_ERASE FLASH_OTP_INFO FLASH_OTP_DUMP FLASH_LOCK
PKGSD_NANDWRITE:=	mtd-utils nandwrite utility
PKGSD_NANDDUMP:=	mtd-utils nanddump utility
PKGSD_NANDTEST:=	mtd-utils nandtest utility
PKGSD_FLASH_ERASE:=	mtd-utils flash_erase utility
PKGSD_FLASH_OTP_INFO:=	mtd-utils flash_otp_info utility
PKGSD_FLASH_OTP_DUMP:=	mtd-utils flash_otp_dump utility
PKGSD_FLASH_LOCK:=	mtd-utils flash_lock/flash_unlock utilities

PKG_FLAVOURS_MTD_UTILS:=WITH_LZO WITH_UBIFS
PKGFD_WITH_LZO:=	enable lzo support
PKGFS_WITH_LZO:=	liblzo
PKGFB_WITH_LZO:=	liblzo
PKGFD_WITH_UBIFS:=	enable ubifs support
PKGFS_WITH_UBIFS:=	libuuid
PKGFB_WITH_UBIFS:=	util-linux

include $(ADK_TOPDIR)/mk/host.mk
include $(ADK_TOPDIR)/mk/package.mk

$(eval $(call HOST_template,MTD_UTILS,mtd-utils,$(PKG_VERSION)-${PKG_RELEASE}))
$(eval $(call PKG_template,MTD_UTILS,$(PKG_NAME),$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
$(eval $(call PKG_template,NANDWRITE,nandwrite,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_NANDWRITE},${PKG_SECTION}))
$(eval $(call PKG_template,NANDDUMP,nanddump,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_NANDDUMP},${PKG_SECTION}))
$(eval $(call PKG_template,NANDTEST,nandtest,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_NANDTEST},${PKG_SECTION}))
$(eval $(call PKG_template,FLASH_ERASE,flash-erase,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_FLASH_ERASE},${PKG_SECTION}))
$(eval $(call PKG_template,FLASH_OTP_INFO,flash-otp-info,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_FLASH_OTP_INFO},${PKG_SECTION}))
$(eval $(call PKG_template,FLASH_OTP_DUMP,flash-otp-dump,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_FLASH_OTP_DUMP},${PKG_SECTION}))
$(eval $(call PKG_template,FLASH_LOCK,flash-lock,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_FLASH_LOCK},${PKG_SECTION}))

HOST_STYLE:=		manual
HOST_CPPFLAGS+=		-DWITHOUT_XATTR=1 -I./include

host-build:
	(cd ${WRKBUILD} && env ${HOST_MAKE_ENV} ${MAKE} -f ${MAKE_FILE} \
		${HOST_MAKE_FLAGS} ${HOST_ALL_TARGET})

mtd-utils-hostinstall:
	${INSTALL_DIR} ${STAGING_HOST_DIR}/usr/bin
	${INSTALL_BIN} ${WRKBUILD}/mkfs.jffs2 \
		${STAGING_HOST_DIR}/usr/bin

CONFIG_STYLE:=		manual
XAKE_FLAGS+=		WITHOUT_XATTR=1
ifneq (${ADK_PACKAGE_MTD_UTILS_WITH_LZO},y)
XAKE_FLAGS+=		WITHOUT_LZO=1
endif
ifneq (${ADK_PACKAGE_MTD_UTILS_WITH_UBIFS},y)
XAKE_FLAGS+=		WITHOUT_UBI=1
endif
XAKE_FLAGS+=		BUILDDIR="${WRKDIST}"

mtd-utils-install:
	$(INSTALL_DIR) $(IDIR_MTD_UTILS)/usr/bin
	$(INSTALL_BIN) $(WRKINST)/usr/sbin/{doc,flash_otp_,ftl_,nftl,rfd}* \
		${WRKINST}/usr/sbin/{flashcp,jffs2dump,mkfs.jffs2,mtd_debug,recv_image,serve_image,sumtool} \
		$(IDIR_MTD_UTILS)/usr/bin

nandwrite-install:
	$(INSTALL_DIR) $(IDIR_NANDWRITE)/usr/sbin
	${INSTALL_BIN} ${WRKINST}/usr/sbin/nandwrite \
		${IDIR_NANDWRITE}/usr/sbin

nanddump-install:
	$(INSTALL_DIR) $(IDIR_NANDDUMP)/usr/sbin
	${INSTALL_BIN} ${WRKINST}/usr/sbin/nanddump \
		${IDIR_NANDDUMP}/usr/sbin

nandtest-install:
	$(INSTALL_DIR) $(IDIR_NANDTEST)/usr/sbin
	${INSTALL_BIN} ${WRKINST}/usr/sbin/nandtest \
		${IDIR_NANDTEST}/usr/sbin

flash-erase-install:
	$(INSTALL_DIR) $(IDIR_FLASH_ERASE)/usr/sbin
	${INSTALL_BIN} ${WRKINST}/usr/sbin/flash_erase \
		${IDIR_FLASH_ERASE}/usr/sbin

flash-otp-info-install:
	$(INSTALL_DIR) $(IDIR_FLASH_OTP_INFO)/usr/sbin
	${INSTALL_BIN} ${WRKINST}/usr/sbin/flash_otp_info \
		${IDIR_FLASH_OTP_INFO}/usr/sbin

flash-otp-dump-install:
	$(INSTALL_DIR) $(IDIR_FLASH_OTP_DUMP)/usr/sbin
	${INSTALL_BIN} ${WRKINST}/usr/sbin/flash_otp_dump \
		${IDIR_FLASH_OTP_DUMP}/usr/sbin

flash-lock-install:
	$(INSTALL_DIR) $(IDIR_FLASH_LOCK)/usr/sbin
	${INSTALL_BIN} ${WRKINST}/usr/sbin/flash_{lock,unlock} \
		${IDIR_FLASH_LOCK}/usr/sbin

include ${ADK_TOPDIR}/mk/host-bottom.mk
include ${ADK_TOPDIR}/mk/pkg-bottom.mk