Makefile 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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:=2015.10
  11. PKG_RELEASE:=1
  12. PKG_BUILD_DIR:=$(BUILD_DIR)/u-boot-$(PKG_VERSION)
  13. PKG_SOURCE:=$(PKG_DISTNAME)-$(PKG_VERSION).tar.bz2
  14. PKG_SOURCE_URL:=\
  15. http://mirror2.openwrt.org/sources \
  16. ftp://ftp.denx.de/pub/u-boot
  17. PKG_MD5SUM:=7c203b0fc3390a122d8e8b75f147eac5
  18. PKG_BUILD_DEPENDS:=+fstools
  19. PKG_LICENSE:=GPL-2.0 GPL-2.0+
  20. PKG_LICENSE_FILES:=Licenses/README
  21. PKG_BUILD_PARALLEL:=1
  22. include $(INCLUDE_DIR)/package.mk
  23. define Package/uboot-envtools
  24. SECTION:=utils
  25. CATEGORY:=Utilities
  26. TITLE:=read/modify U-Boot bootloader environment
  27. URL:=http://www.denx.de/wiki/U-Boot
  28. endef
  29. define Package/uboot-envtools/description
  30. This package includes tools to read and modify U-Boot bootloader environment.
  31. endef
  32. define Package/uboot-envtools/config
  33. source "$(SOURCE)/Config.in"
  34. endef
  35. define Build/Configure
  36. touch $(PKG_BUILD_DIR)/include/config.mk
  37. touch $(PKG_BUILD_DIR)/include/config.h
  38. mkdir -p $(PKG_BUILD_DIR)/include/generated
  39. touch $(PKG_BUILD_DIR)/include/generated/autoconf.h
  40. endef
  41. TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include
  42. define Build/Compile
  43. $(MAKE) -C $(PKG_BUILD_DIR) \
  44. CROSS_COMPILE="$(TARGET_CROSS)" \
  45. TARGET_CFLAGS="$(TARGET_CFLAGS)" \
  46. UBI="$(CONFIG_UBOOT_ENVTOOLS_UBI)" \
  47. dot-config=0 \
  48. HOSTLDFLAGS= \
  49. env
  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. ifneq ($(CONFIG_TARGET_ar71xx),)
  62. $(INSTALL_DIR) $(1)/etc/uci-defaults
  63. $(INSTALL_DATA) ./files/ar71xx $(1)/etc/uci-defaults/30_uboot-envtools
  64. endif
  65. ifneq ($(CONFIG_TARGET_cns3xxx),)
  66. $(INSTALL_DIR) $(1)/etc/uci-defaults
  67. $(INSTALL_DATA) ./files/cns3xxx $(1)/etc/uci-defaults/30_uboot-envtools
  68. endif
  69. ifneq ($(CONFIG_TARGET_imx6),)
  70. $(INSTALL_DIR) $(1)/etc/uci-defaults
  71. $(INSTALL_DATA) ./files/imx6 $(1)/etc/uci-defaults/30_uboot-envtools
  72. endif
  73. ifneq ($(CONFIG_TARGET_ipq806x),)
  74. $(INSTALL_DIR) $(1)/etc/uci-defaults
  75. $(INSTALL_DATA) ./files/ipq $(1)/etc/uci-defaults/30_uboot-envtools
  76. endif
  77. ifneq ($(CONFIG_TARGET_kirkwood),)
  78. $(INSTALL_DIR) $(1)/etc/uci-defaults
  79. $(INSTALL_DATA) ./files/kirkwood $(1)/etc/uci-defaults/30_uboot-envtools
  80. endif
  81. ifneq ($(CONFIG_TARGET_lantiq),)
  82. $(INSTALL_DIR) $(1)/etc/uci-defaults
  83. $(INSTALL_DATA) ./files/lantiq $(1)/etc/uci-defaults/30_uboot-envtools
  84. endif
  85. ifneq ($(CONFIG_TARGET_mvebu),)
  86. $(INSTALL_DIR) $(1)/etc/uci-defaults
  87. $(INSTALL_BIN) ./files/mvebu $(1)/etc/uci-defaults/30_uboot-envtools
  88. endif
  89. ifneq ($(CONFIG_TARGET_mxs),)
  90. $(INSTALL_DIR) $(1)/etc/uci-defaults
  91. $(INSTALL_BIN) ./files/mxs $(1)/etc/uci-defaults/30_uboot-envtools
  92. endif
  93. ifneq ($(CONFIG_TARGET_oxnas),)
  94. $(INSTALL_DIR) $(1)/etc/uci-defaults
  95. $(INSTALL_BIN) ./files/oxnas $(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. $(eval $(call BuildPackage,uboot-envtools))