Makefile 2.1 KB

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