Makefile 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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:=2014.04
  11. PKG_RELEASE:=2
  12. PKG_SOURCE:=$(PKG_DISTNAME)-$(PKG_VERSION).tar.bz2
  13. PKG_SOURCE_URL:= \
  14. http://mirror2.openwrt.org/sources \
  15. ftp://ftp.denx.de/pub/u-boot
  16. PKG_MD5SUM:=6d2116d1385a66e9a59742caa9d62a54
  17. PKG_BUILD_DIR:=$(BUILD_DIR)/u-boot-$(PKG_VERSION)
  18. PKG_BUILD_DEPENDS:=+fstools
  19. include $(INCLUDE_DIR)/package.mk
  20. define Package/uboot-envtools
  21. SECTION:=utils
  22. CATEGORY:=Utilities
  23. TITLE:=read/modify U-Boot bootloader environment
  24. URL:=http://www.denx.de/wiki/U-Boot
  25. endef
  26. define Package/uboot-envtools/description
  27. This package includes tools to read and modify U-Boot bootloader environment.
  28. endef
  29. define Package/uboot-envtools/config
  30. source "$(SOURCE)/Config.in"
  31. endef
  32. define Build/Configure
  33. touch $(PKG_BUILD_DIR)/include/config.mk
  34. touch $(PKG_BUILD_DIR)/include/config.h
  35. endef
  36. TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include
  37. define Build/Compile
  38. $(MAKE) -C $(PKG_BUILD_DIR) \
  39. CROSS_COMPILE="$(TARGET_CROSS)" \
  40. TARGET_CFLAGS="$(TARGET_CFLAGS)" \
  41. UBI="$(CONFIG_UBOOT_ENVTOOLS_UBI)" \
  42. env
  43. endef
  44. define Package/uboot-envtools/conffiles
  45. /etc/config/ubootenv
  46. /etc/fw_env.config
  47. endef
  48. define Package/uboot-envtools/install
  49. $(INSTALL_DIR) $(1)/usr/sbin
  50. $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/env/fw_printenv $(1)/usr/sbin
  51. ln -s fw_printenv $(1)/usr/sbin/fw_setenv
  52. $(INSTALL_DIR) $(1)/lib
  53. $(INSTALL_DATA) ./files/uboot-envtools.sh $(1)/lib
  54. ifneq ($(CONFIG_TARGET_ar71xx),)
  55. $(INSTALL_DIR) $(1)/etc/uci-defaults
  56. $(INSTALL_DATA) ./files/ar71xx $(1)/etc/uci-defaults/30_uboot-envtools
  57. endif
  58. ifneq ($(CONFIG_TARGET_cns3xxx),)
  59. $(INSTALL_DIR) $(1)/etc/uci-defaults
  60. $(INSTALL_DATA) ./files/cns3xxx $(1)/etc/uci-defaults/30_uboot-envtools
  61. endif
  62. ifneq ($(CONFIG_TARGET_imx6),)
  63. $(INSTALL_DIR) $(1)/etc/uci-defaults
  64. $(INSTALL_DATA) ./files/imx6 $(1)/etc/uci-defaults/30_uboot-envtools
  65. endif
  66. ifneq ($(CONFIG_TARGET_kirkwood),)
  67. $(INSTALL_DIR) $(1)/etc/uci-defaults
  68. $(INSTALL_DATA) ./files/kirkwood $(1)/etc/uci-defaults/30_uboot-envtools
  69. endif
  70. ifneq ($(CONFIG_TARGET_lantiq),)
  71. $(INSTALL_DIR) $(1)/etc/uci-defaults
  72. $(INSTALL_DATA) ./files/lantiq $(1)/etc/uci-defaults/30_uboot-envtools
  73. endif
  74. ifneq ($(CONFIG_TARGET_mxs),)
  75. $(INSTALL_DIR) $(1)/etc/uci-defaults
  76. $(INSTALL_BIN) ./files/mxs $(1)/etc/uci-defaults/30_uboot-envtools
  77. endif
  78. ifneq ($(CONFIG_TARGET_ramips),)
  79. $(INSTALL_DIR) $(1)/etc/uci-defaults
  80. $(INSTALL_DATA) ./files/ramips $(1)/etc/uci-defaults/30_uboot-envtools
  81. endif
  82. endef
  83. $(eval $(call BuildPackage,uboot-envtools))