mtd: fix trx_fixup
[openwrt/staging/yousong.git] / package / mtd / Makefile
1 #
2 # Copyright (C) 2006-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 include $(INCLUDE_DIR)/kernel.mk
10
11 PKG_NAME:=mtd
12 PKG_RELEASE:=18
13
14 PKG_BUILD_DIR := $(KERNEL_BUILD_DIR)/$(PKG_NAME)
15 STAMP_PREPARED := $(STAMP_PREPARED)_$(call confvar,CONFIG_MTD_REDBOOT_PARTS)
16
17 include $(INCLUDE_DIR)/package.mk
18
19 define Package/mtd
20 SECTION:=utils
21 CATEGORY:=Base system
22 TITLE:=Update utility for trx firmware images
23 endef
24
25 define Package/mtd/description
26 This package contains an utility useful to upgrade from other firmware or
27 older OpenWrt releases.
28 endef
29
30 define Build/Prepare
31 mkdir -p $(PKG_BUILD_DIR)
32 $(CP) ./src/* $(PKG_BUILD_DIR)/
33 endef
34
35 target=$(firstword $(subst -, ,$(BOARD)))
36
37 MAKE_FLAGS += TARGET="$(target)"
38 TARGET_CFLAGS := -I$(LINUX_DIR)/include $(TARGET_CFLAGS) -Dtarget_$(target)=1 -Wall
39
40 ifdef CONFIG_MTD_REDBOOT_PARTS
41 MAKE_FLAGS += FIS_SUPPORT=1
42 TARGET_CFLAGS += -DFIS_SUPPORT=1
43 endif
44
45 define Package/mtd/install
46 $(INSTALL_DIR) $(1)/sbin
47 $(INSTALL_BIN) $(PKG_BUILD_DIR)/mtd $(1)/sbin/
48 endef
49
50 $(eval $(call BuildPackage,mtd))