Makefile 1.2 KB

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