[packages] mtd-utils: add missing dependencies
[packages.git] / utils / mtd-utils / Makefile
1 #
2 # Copyright (C) 2009-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
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=mtd-utils
11 PKG_REV:=5319b84974fcb71504aed2d1b8285e9c0a4a4bb8
12 PKG_VERSION:=1.4.5
13 PKG_RELEASE:=1
14 PKG_INSTALL:=1
15
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
17 PKG_SOURCE_URL:=git://git.infradead.org/mtd-utils.git
18 PKG_SOURCE_PROTO:=git
19 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
20 PKG_SOURCE_VERSION:=$(PKG_REV)
21
22 PKG_BUILD_DEPENDS:=util-linux
23
24 include $(INCLUDE_DIR)/package.mk
25
26 FILES:= \
27         doc_loadbios \
28         docfdisk \
29         flash_erase \
30         flash_eraseall \
31         flash_info \
32         flash_lock \
33         flash_otp_dump \
34         flash_otp_info \
35         flash_unlock \
36         flashcp \
37         ftl_check \
38         ftl_format \
39         jffs2dump \
40         mkfs.jffs2:+zlib \
41         mkfs.ubifs:+libuuid:+zlib \
42         mtd_debug \
43         mtdinfo \
44         nanddump \
45         nandtest \
46         nandwrite \
47         nftldump \
48         nftl_format \
49         recv_image \
50         rfddump \
51         rfdformat \
52         serve_image \
53         sumtool \
54         ubiattach \
55         ubicrc32 \
56         ubidetach \
57         ubiformat \
58         ubimkvol \
59         ubinfo \
60         ubinize \
61         ubirename \
62         ubirmvol \
63         ubirsvol \
64         ubiupdatevol
65
66 define PartGen
67 define Package/mtd-utils-$(subst _,-,$(firstword $(subst :, ,$(1))))
68   TITLE:=$(firstword $(subst :, ,$(1))) package from mtd-utils
69   URL:=http://www.linux-mtd.infradead.org/
70   SECTION:=utils
71   CATEGORY:=Utilities
72   DEPENDS:=mtd-utils $(wordlist 2,$(words $(subst :, ,$(1))),$(subst :, ,$(1)))
73 endef
74 endef
75
76 define Package/mtd-utils
77   TITLE:=Utilities for flash info/debug
78   SECTION:=utils
79   CATEGORY:=Utilities
80   URL:=http://www.linux-mtd.infradead.org/
81   MENU:=1
82 endef
83
84 define Package/mtd-utils/description
85   Utilities for manipulating memory technology devices.
86 endef
87
88 define Package/mtd-utils/install
89         true
90 endef
91
92 $(foreach file,$(FILES),$(eval $(call PartGen,$(file))))
93
94 MAKE_FLAGS += \
95         DESTDIR="$(PKG_INSTALL_DIR)" \
96         BUILDDIR="$(PKG_BUILD_DIR)" \
97         LDLIBS+="$(LIBGCC_S)" \
98         WITHOUT_XATTR=1 \
99         WITHOUT_LZO=1
100
101 define PartInstall
102 define Package/mtd-utils-$(subst _,-,$(firstword $(subst :, ,$(1))))/install
103         $(INSTALL_DIR) \
104                 $$(1)/usr/sbin
105
106         $(INSTALL_BIN) \
107                 $(PKG_INSTALL_DIR)/usr/sbin/$(firstword $(subst :, ,$(1))) \
108                 $$(1)/usr/sbin/
109 endef
110 endef
111
112 $(foreach file,$(FILES),$(eval $(call PartInstall,$(file))))
113
114 $(eval $(call BuildPackage,mtd-utils))
115 $(foreach file,$(FILES),$(eval $(call BuildPackage,mtd-utils-$(subst _,-,$(firstword $(subst :, ,$(file)))))))