ramips: add support for HooToo HT-TM05
[openwrt/openwrt.git] / package / boot / uboot-envtools / Makefile
index 3a3e95515cd82744ded5a99c2b20a1595e420ea8..7a27a295967cfb7d840b9cd72e448c8c02c4ea11 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2006-2013 OpenWrt.org
+# Copyright (C) 2006-2014 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -9,20 +9,33 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=uboot-envtools
 PKG_DISTNAME:=u-boot
-PKG_VERSION:=2013.07-rc1
-PKG_RELEASE:=1
+PKG_VERSION:=2020.04
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_DISTNAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=ftp://ftp.denx.de/pub/u-boot
-PKG_MD5SUM:=9b14d9a8981ce2e429956af7cc96996e
+PKG_SOURCE_URL:= \
+    https://ftp.denx.de/pub/u-boot \
+    https://mirror.cyberbits.eu/u-boot \
+    ftp://ftp.denx.de/pub/u-boot
+PKG_HASH:=fe732aaf037d9cc3c0909bad8362af366ae964bbdac6913a34081ff4ad565372
+PKG_SOURCE_SUBDIR:=$(PKG_DISTNAME)-$(PKG_VERSION)
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_DISTNAME)-$(PKG_VERSION)
 
-PKG_BUILD_DIR:=$(BUILD_DIR)/u-boot-$(PKG_VERSION)
+PKG_BUILD_DEPENDS:=fstools
+
+PKG_LICENSE:=GPL-2.0 GPL-2.0+
+PKG_LICENSE_FILES:=Licenses/README
+
+PKG_FLAGS:=nonshared
+
+PKG_BUILD_PARALLEL:=1
 
 include $(INCLUDE_DIR)/package.mk
 
 define Package/uboot-envtools
   SECTION:=utils
   CATEGORY:=Utilities
+  SUBMENU:=Boot Loaders
   TITLE:=read/modify U-Boot bootloader environment
   URL:=http://www.denx.de/wiki/U-Boot
 endef
@@ -32,16 +45,19 @@ define Package/uboot-envtools/description
 endef
 
 define Build/Configure
-endef
-
-define Build/Compile
        touch $(PKG_BUILD_DIR)/include/config.h
-       $(MAKE) -C $(PKG_BUILD_DIR) \
-               HOSTCC="$(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)gcc" \
-               HOSTSTRIP="$(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)strip" \
-               env
+       mkdir -p $(PKG_BUILD_DIR)/include/config
+       touch $(PKG_BUILD_DIR)/include/config/auto.conf
+       mkdir -p $(PKG_BUILD_DIR)/include/generated
+       touch $(PKG_BUILD_DIR)/include/generated/autoconf.h
 endef
 
+MAKE_FLAGS += \
+       TARGET_CFLAGS="$(TARGET_CFLAGS)" \
+       TARGET_LDFLAGS="$(TARGET_LDFLAGS)" \
+       no-dot-config-targets=envtools \
+       envtools
+
 define Package/uboot-envtools/conffiles
 /etc/config/ubootenv
 /etc/fw_env.config
@@ -50,33 +66,14 @@ endef
 define Package/uboot-envtools/install
        $(INSTALL_DIR) $(1)/usr/sbin
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/env/fw_printenv $(1)/usr/sbin
-       ln -s fw_printenv $(1)/usr/sbin/fw_setenv
+       $(LN) fw_printenv $(1)/usr/sbin/fw_setenv
        $(INSTALL_DIR) $(1)/lib
        $(INSTALL_DATA) ./files/uboot-envtools.sh $(1)/lib
-ifneq ($(CONFIG_TARGET_ar71xx),)
-       $(INSTALL_DIR) $(1)/etc/uci-defaults
-       $(INSTALL_BIN) ./files/ar71xx $(1)/etc/uci-defaults/30_uboot-envtools
-endif
-ifneq ($(CONFIG_TARGET_cns3xxx),)
-       $(INSTALL_DIR) $(1)/etc/uci-defaults
-       $(INSTALL_BIN) ./files/cns3xxx $(1)/etc/uci-defaults/30_uboot-envtools
-endif
-ifneq ($(CONFIG_TARGET_imx6),)
-       $(INSTALL_DIR) $(1)/etc/uci-defaults
-       $(INSTALL_BIN) ./files/imx6 $(1)/etc/uci-defaults/30_uboot-envtools
-endif
-ifneq ($(CONFIG_TARGET_kirkwood),)
-       $(INSTALL_DIR) $(1)/etc/uci-defaults
-       $(INSTALL_BIN) ./files/kirkwood $(1)/etc/uci-defaults/30_uboot-envtools
-endif
-ifneq ($(CONFIG_TARGET_lantiq),)
-       $(INSTALL_DIR) $(1)/etc/uci-defaults
-       $(INSTALL_BIN) ./files/lantiq $(1)/etc/uci-defaults/30_uboot-envtools
-endif
-ifneq ($(CONFIG_TARGET_ramips),)
        $(INSTALL_DIR) $(1)/etc/uci-defaults
-       $(INSTALL_BIN) ./files/ramips $(1)/etc/uci-defaults/30_uboot-envtools
-endif
+       $(if $(wildcard ./files/$(BOARD)), \
+               $(INSTALL_DATA) ./files/$(BOARD) \
+               $(1)/etc/uci-defaults/30_uboot-envtools \
+       )
 endef
 
 $(eval $(call BuildPackage,uboot-envtools))