Makefile 1.1 KB

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