Makefile 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #
  2. # Copyright (C) 2006-2012 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. include $(INCLUDE_DIR)/kernel.mk
  9. PKG_NAME:=mtd
  10. PKG_RELEASE:=26
  11. PKG_BUILD_DIR := $(KERNEL_BUILD_DIR)/$(PKG_NAME)
  12. STAMP_PREPARED := $(STAMP_PREPARED)_$(call confvar,CONFIG_MTD_REDBOOT_PARTS)
  13. PKG_LICENSE:=GPL-2.0+
  14. PKG_LICENSE_FILES:=
  15. PKG_FLAGS:=nonshared
  16. PKG_BUILD_FLAGS:=lto
  17. include $(INCLUDE_DIR)/package.mk
  18. define Package/mtd
  19. SECTION:=utils
  20. CATEGORY:=Base system
  21. DEPENDS:=+libubox
  22. TITLE:=Update utility for trx firmware images
  23. endef
  24. define Package/mtd/description
  25. This package contains an utility useful to upgrade from other firmware or
  26. older libreCMC releases.
  27. endef
  28. target=$(firstword $(subst -, ,$(BOARD)))
  29. MAKE_FLAGS += TARGET="$(target)"
  30. TARGET_CFLAGS += -Dtarget_$(target)=1 -Wall
  31. ifdef CONFIG_MTD_REDBOOT_PARTS
  32. MAKE_FLAGS += FIS_SUPPORT=1
  33. TARGET_CFLAGS += -DFIS_SUPPORT=1
  34. endif
  35. define Package/mtd/install
  36. $(INSTALL_DIR) $(1)/sbin
  37. $(INSTALL_BIN) $(PKG_BUILD_DIR)/mtd $(1)/sbin/
  38. endef
  39. $(eval $(call BuildPackage,mtd))