Makefile 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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_HASH:=bdc68d5f9455ad933b059c735d983f2c8b6b552dafb062e5ff1444f623021955
  18. PKG_BUILD_DEPENDS:=+fstools
  19. PKG_LICENSE:=GPL-2.0 GPL-2.0+
  20. PKG_LICENSE_FILES:=Licenses/README
  21. PKG_FLAGS:=nonshared
  22. PKG_BUILD_PARALLEL:=1
  23. include $(INCLUDE_DIR)/package.mk
  24. define Package/uboot-envtools
  25. SECTION:=utils
  26. CATEGORY:=Utilities
  27. SUBMENU:=Boot Loaders
  28. TITLE:=read/modify U-Boot bootloader environment
  29. URL:=http://www.denx.de/wiki/U-Boot
  30. endef
  31. define Package/uboot-envtools/description
  32. This package includes tools to read and modify U-Boot bootloader environment.
  33. endef
  34. define Package/uboot-envtools/config
  35. source "$(SOURCE)/Config.in"
  36. endef
  37. define Build/Configure
  38. touch $(PKG_BUILD_DIR)/include/config.mk
  39. touch $(PKG_BUILD_DIR)/include/config.h
  40. mkdir -p $(PKG_BUILD_DIR)/include/generated
  41. touch $(PKG_BUILD_DIR)/include/generated/autoconf.h
  42. endef
  43. TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include
  44. define Build/Compile
  45. $(MAKE) -C $(PKG_BUILD_DIR) \
  46. CROSS_COMPILE="$(TARGET_CROSS)" \
  47. TARGET_CFLAGS="$(TARGET_CFLAGS)" \
  48. UBI="$(CONFIG_UBOOT_ENVTOOLS_UBI)" \
  49. dot-config=0 \
  50. HOSTLDFLAGS= \
  51. env
  52. endef
  53. define Package/uboot-envtools/conffiles
  54. /etc/config/ubootenv
  55. /etc/fw_env.config
  56. endef
  57. define Package/uboot-envtools/install
  58. $(INSTALL_DIR) $(1)/usr/sbin
  59. $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/env/fw_printenv $(1)/usr/sbin
  60. $(LN) fw_printenv $(1)/usr/sbin/fw_setenv
  61. $(INSTALL_DIR) $(1)/lib
  62. $(INSTALL_DATA) ./files/uboot-envtools.sh $(1)/lib
  63. ifneq ($(CONFIG_TARGET_ar71xx),)
  64. $(INSTALL_DIR) $(1)/etc/uci-defaults
  65. $(INSTALL_DATA) ./files/ar71xx $(1)/etc/uci-defaults/30_uboot-envtools
  66. endif
  67. ifneq ($(CONFIG_TARGET_cns3xxx),)
  68. $(INSTALL_DIR) $(1)/etc/uci-defaults
  69. $(INSTALL_DATA) ./files/cns3xxx $(1)/etc/uci-defaults/30_uboot-envtools
  70. endif
  71. ifneq ($(CONFIG_TARGET_imx6),)
  72. $(INSTALL_DIR) $(1)/etc/uci-defaults
  73. $(INSTALL_DATA) ./files/imx6 $(1)/etc/uci-defaults/30_uboot-envtools
  74. endif
  75. ifneq ($(CONFIG_TARGET_ipq806x),)
  76. $(INSTALL_DIR) $(1)/etc/uci-defaults
  77. $(INSTALL_DATA) ./files/ipq $(1)/etc/uci-defaults/30_uboot-envtools
  78. endif
  79. ifneq ($(CONFIG_TARGET_kirkwood),)
  80. $(INSTALL_DIR) $(1)/etc/uci-defaults
  81. $(INSTALL_DATA) ./files/kirkwood $(1)/etc/uci-defaults/30_uboot-envtools
  82. endif
  83. ifneq ($(CONFIG_TARGET_lantiq),)
  84. $(INSTALL_DIR) $(1)/etc/uci-defaults
  85. $(INSTALL_DATA) ./files/lantiq $(1)/etc/uci-defaults/30_uboot-envtools
  86. endif
  87. ifneq ($(CONFIG_TARGET_mvebu),)
  88. $(INSTALL_DIR) $(1)/etc/uci-defaults
  89. $(INSTALL_BIN) ./files/mvebu $(1)/etc/uci-defaults/30_uboot-envtools
  90. endif
  91. ifneq ($(CONFIG_TARGET_mxs),)
  92. $(INSTALL_DIR) $(1)/etc/uci-defaults
  93. $(INSTALL_BIN) ./files/mxs $(1)/etc/uci-defaults/30_uboot-envtools
  94. endif
  95. ifneq ($(CONFIG_TARGET_oxnas),)
  96. $(INSTALL_DIR) $(1)/etc/uci-defaults
  97. $(INSTALL_BIN) ./files/oxnas $(1)/etc/uci-defaults/30_uboot-envtools
  98. endif
  99. ifneq ($(CONFIG_TARGET_ramips),)
  100. $(INSTALL_DIR) $(1)/etc/uci-defaults
  101. $(INSTALL_DATA) ./files/ramips $(1)/etc/uci-defaults/30_uboot-envtools
  102. endif
  103. endef
  104. $(eval $(call BuildPackage,uboot-envtools))