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