Makefile 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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:=21
  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. include $(INCLUDE_DIR)/package.mk
  16. define Package/mtd
  17. SECTION:=utils
  18. CATEGORY:=Base system
  19. DEPENDS:=+libubox
  20. TITLE:=Update utility for trx firmware images
  21. endef
  22. define Package/mtd/description
  23. This package contains an utility useful to upgrade from other firmware or
  24. older OpenWrt releases.
  25. endef
  26. target=$(firstword $(subst -, ,$(BOARD)))
  27. MAKE_FLAGS += TARGET="$(target)"
  28. TARGET_CFLAGS := $(TARGET_CFLAGS) -Dtarget_$(target)=1 -Wall
  29. ifdef CONFIG_MTD_REDBOOT_PARTS
  30. MAKE_FLAGS += FIS_SUPPORT=1
  31. TARGET_CFLAGS += -DFIS_SUPPORT=1
  32. endif
  33. define Package/mtd/install
  34. $(INSTALL_DIR) $(1)/sbin
  35. $(INSTALL_BIN) $(PKG_BUILD_DIR)/mtd $(1)/sbin/
  36. endef
  37. $(eval $(call BuildPackage,mtd))