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