Makefile 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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:=20
  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 libreCMC releases.
  25. endef
  26. define Build/Prepare
  27. mkdir -p $(PKG_BUILD_DIR)
  28. $(CP) ./src/* $(PKG_BUILD_DIR)/
  29. endef
  30. target=$(firstword $(subst -, ,$(BOARD)))
  31. MAKE_FLAGS += TARGET="$(target)"
  32. TARGET_CFLAGS := $(TARGET_CFLAGS) -Dtarget_$(target)=1 -Wall
  33. ifdef CONFIG_MTD_REDBOOT_PARTS
  34. MAKE_FLAGS += FIS_SUPPORT=1
  35. TARGET_CFLAGS += -DFIS_SUPPORT=1
  36. endif
  37. define Package/mtd/install
  38. $(INSTALL_DIR) $(1)/sbin
  39. $(INSTALL_BIN) $(PKG_BUILD_DIR)/mtd $(1)/sbin/
  40. endef
  41. $(eval $(call BuildPackage,mtd))