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