[packages_10.03.1] fix mtd-utils compilation for brcm-2.4
[openwrt/svn-archive/archive.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:=a2d010f8fca904fffa3c6e5a5d148cc96a37a08a
12 PKG_VERSION:=20090227
13 PKG_RELEASE:=1.1
14 PKG_INSTALL:=1
15
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
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 include $(INCLUDE_DIR)/package.mk
23
24 FILES:= \
25 doc_loadbios \
26 docfdisk \
27 flash_erase \
28 flash_eraseall \
29 flash_info \
30 flash_lock \
31 flash_otp_dump \
32 flash_otp_info \
33 flash_unlock \
34 flashcp \
35 ftl_check \
36 ftl_format \
37 jffs2dump \
38 mkfs.jffs2 \
39 mtd_debug \
40 nanddump \
41 nandtest \
42 nandwrite \
43 nftl_format \
44 nftldump \
45 recv_image \
46 rfddump \
47 rfdformat \
48 serve_image \
49 sumtool
50
51 ifneq ($(CONFIG_LINUX_2_4),y)
52 FILES += \
53 bin2nand \
54 mkbootenv \
55 mkfs.ubifs \
56 mkpfi \
57 nand2bin \
58 pddcustomize \
59 pfi2bin \
60 pfiflash \
61 ubiattach \
62 ubicrc32 \
63 ubicrc32.pl \
64 ubidetach \
65 ubiformat \
66 ubigen \
67 ubimirror \
68 ubimkvol \
69 ubinfo \
70 ubinize \
71 ubirename \
72 ubirmvol \
73 ubiupdatevol \
74 unubi
75 endif
76
77 define PartGen
78 define Package/mtd-utils-$(subst _,-,$(1))
79 TITLE:=MTD $(1)
80 URL:=http://www.linux-mtd.infradead.org/
81 SECTION:=utils
82 CATEGORY:=Utilities
83 DEPENDS:=mtd-utils +zlib +liblzo +libuuid
84 endef
85 endef
86
87 define Package/mtd-utils
88 TITLE:=Utilities for flash info/debug
89 SECTION:=utils
90 CATEGORY:=Utilities
91 MENU:=1
92 endef
93
94 define Package/mtd-utils/description
95 Utilities for manipulating memory technology devices.
96 endef
97
98 define Package/mtd-utils/install
99 true
100 endef
101
102 $(foreach file,$(FILES),$(eval $(call PartGen,$(file))))
103
104 MAKE_FLAGS += \
105 DESTDIR="$(PKG_INSTALL_DIR)" \
106 BUILDDIR="$(PKG_BUILD_DIR)" \
107 LDLIBS+="$(LIBGCC_S)" \
108 WITHOUT_XATTR=1
109
110 ifeq ($(CONFIG_LINUX_2_4),y)
111 MAKE_FLAGS += \
112 SUBDIRS=""
113 endif
114
115 define PartInstall
116 define Package/mtd-utils-$(subst _,-,$(1))/install
117 $(INSTALL_DIR) \
118 $$(1)/usr/sbin
119
120 $(INSTALL_BIN) \
121 $(PKG_INSTALL_DIR)/usr/sbin/$(1) \
122 $$(1)/usr/sbin/
123 endef
124 endef
125
126 $(foreach file,$(FILES),$(eval $(call PartInstall,$(file))))
127
128 $(eval $(call BuildPackage,mtd-utils))
129 $(foreach file,$(FILES),$(eval $(call BuildPackage,mtd-utils-$(subst _,-,$(file)))))