fa49c13f967dbfe8505641e99c37ea44b2ae6bd7
[openwrt/staging/yousong.git] / package / boot / uboot-envtools / Makefile
1 #
2 # Copyright (C) 2006-2014 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:=uboot-envtools
11 PKG_DISTNAME:=u-boot
12 PKG_VERSION:=2014.07
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_DISTNAME)-$(PKG_VERSION).tar.bz2
16 PKG_SOURCE_URL:= \
17 http://mirror2.openwrt.org/sources \
18 ftp://ftp.denx.de/pub/u-boot
19
20 PKG_MD5SUM:=36d4bad687edcafa396fee607e505d4e
21
22 PKG_BUILD_DIR:=$(BUILD_DIR)/u-boot-$(PKG_VERSION)
23
24 PKG_BUILD_DEPENDS:=+fstools
25
26 include $(INCLUDE_DIR)/package.mk
27
28 define Package/uboot-envtools
29 SECTION:=utils
30 CATEGORY:=Utilities
31 TITLE:=read/modify U-Boot bootloader environment
32 URL:=http://www.denx.de/wiki/U-Boot
33 endef
34
35 define Package/uboot-envtools/description
36 This package includes tools to read and modify U-Boot bootloader environment.
37 endef
38
39 define Package/uboot-envtools/config
40 source "$(SOURCE)/Config.in"
41 endef
42
43 define Build/Configure
44 touch $(PKG_BUILD_DIR)/include/config.mk
45 touch $(PKG_BUILD_DIR)/include/config.h
46 endef
47
48 TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include
49
50 define Build/Compile
51 $(MAKE) -C $(PKG_BUILD_DIR) \
52 CROSS_COMPILE="$(TARGET_CROSS)" \
53 TARGET_CFLAGS="$(TARGET_CFLAGS)" \
54 UBI="$(CONFIG_UBOOT_ENVTOOLS_UBI)" \
55 env
56 endef
57
58 define Package/uboot-envtools/conffiles
59 /etc/config/ubootenv
60 /etc/fw_env.config
61 endef
62
63 define Package/uboot-envtools/install
64 $(INSTALL_DIR) $(1)/usr/sbin
65 $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/env/fw_printenv $(1)/usr/sbin
66 ln -s fw_printenv $(1)/usr/sbin/fw_setenv
67 $(INSTALL_DIR) $(1)/lib
68 $(INSTALL_DATA) ./files/uboot-envtools.sh $(1)/lib
69 ifneq ($(CONFIG_TARGET_ar71xx),)
70 $(INSTALL_DIR) $(1)/etc/uci-defaults
71 $(INSTALL_DATA) ./files/ar71xx $(1)/etc/uci-defaults/30_uboot-envtools
72 endif
73 ifneq ($(CONFIG_TARGET_cns3xxx),)
74 $(INSTALL_DIR) $(1)/etc/uci-defaults
75 $(INSTALL_DATA) ./files/cns3xxx $(1)/etc/uci-defaults/30_uboot-envtools
76 endif
77 ifneq ($(CONFIG_TARGET_imx6),)
78 $(INSTALL_DIR) $(1)/etc/uci-defaults
79 $(INSTALL_DATA) ./files/imx6 $(1)/etc/uci-defaults/30_uboot-envtools
80 endif
81 ifneq ($(CONFIG_TARGET_kirkwood),)
82 $(INSTALL_DIR) $(1)/etc/uci-defaults
83 $(INSTALL_DATA) ./files/kirkwood $(1)/etc/uci-defaults/30_uboot-envtools
84 endif
85 ifneq ($(CONFIG_TARGET_lantiq),)
86 $(INSTALL_DIR) $(1)/etc/uci-defaults
87 $(INSTALL_DATA) ./files/lantiq $(1)/etc/uci-defaults/30_uboot-envtools
88 endif
89 ifneq ($(CONFIG_TARGET_mvebu),)
90 $(INSTALL_DIR) $(1)/etc/uci-defaults
91 $(INSTALL_BIN) ./files/mvebu $(1)/etc/uci-defaults/30_uboot-envtools
92 endif
93 ifneq ($(CONFIG_TARGET_mxs),)
94 $(INSTALL_DIR) $(1)/etc/uci-defaults
95 $(INSTALL_BIN) ./files/mxs $(1)/etc/uci-defaults/30_uboot-envtools
96 endif
97 ifneq ($(CONFIG_TARGET_ramips),)
98 $(INSTALL_DIR) $(1)/etc/uci-defaults
99 $(INSTALL_DATA) ./files/ramips $(1)/etc/uci-defaults/30_uboot-envtools
100 endif
101 endef
102
103 $(eval $(call BuildPackage,uboot-envtools))