1c6b7897161404d299011946a643e4e9762e6f1b
[openwrt/openwrt.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:=2019.07
13 PKG_RELEASE:=2
14
15 PKG_SOURCE_PROTO:=git
16 PKG_SOURCE:=$(PKG_DISTNAME)-$(PKG_VERSION).tar.xz
17 PKG_SOURCE_SUBDIR:=$(PKG_DISTNAME)-$(PKG_VERSION)
18 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_DISTNAME)-$(PKG_VERSION)
19 PKG_SOURCE_URL:=https://git.denx.de/u-boot.git
20 PKG_SOURCE_VERSION:=e5aee22e4be75e75a854ab64503fc80598bc2004
21 PKG_MIRROR_HASH:=58c1ecaf901b6bf65c5e872b5449b642694ae5acebf61f91f0d4bc20b4c654b7
22
23 PKG_BUILD_DEPENDS:=fstools
24
25 PKG_LICENSE:=GPL-2.0 GPL-2.0+
26 PKG_LICENSE_FILES:=Licenses/README
27
28 PKG_FLAGS:=nonshared
29
30 PKG_BUILD_PARALLEL:=1
31
32 include $(INCLUDE_DIR)/package.mk
33
34 define Package/uboot-envtools
35 SECTION:=utils
36 CATEGORY:=Utilities
37 SUBMENU:=Boot Loaders
38 TITLE:=read/modify U-Boot bootloader environment
39 URL:=http://www.denx.de/wiki/U-Boot
40 endef
41
42 define Package/uboot-envtools/description
43 This package includes tools to read and modify U-Boot bootloader environment.
44 endef
45
46 define Build/Configure
47 touch $(PKG_BUILD_DIR)/include/config.h
48 mkdir -p $(PKG_BUILD_DIR)/include/config
49 touch $(PKG_BUILD_DIR)/include/config/auto.conf
50 mkdir -p $(PKG_BUILD_DIR)/include/generated
51 touch $(PKG_BUILD_DIR)/include/generated/autoconf.h
52 endef
53
54 MAKE_FLAGS += \
55 TARGET_CFLAGS="$(TARGET_CFLAGS)" \
56 TARGET_LDFLAGS="$(TARGET_LDFLAGS)" \
57 no-dot-config-targets=envtools \
58 envtools
59
60 define Package/uboot-envtools/conffiles
61 /etc/config/ubootenv
62 /etc/fw_env.config
63 endef
64
65 define Package/uboot-envtools/install
66 $(INSTALL_DIR) $(1)/usr/sbin
67 $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/env/fw_printenv $(1)/usr/sbin
68 $(LN) fw_printenv $(1)/usr/sbin/fw_setenv
69 $(INSTALL_DIR) $(1)/lib
70 $(INSTALL_DATA) ./files/uboot-envtools.sh $(1)/lib
71 $(INSTALL_DIR) $(1)/etc/uci-defaults
72 $(if $(wildcard ./files/$(BOARD)), \
73 $(INSTALL_DATA) ./files/$(BOARD) \
74 $(1)/etc/uci-defaults/30_uboot-envtools \
75 )
76 endef
77
78 $(eval $(call BuildPackage,uboot-envtools))