Makefile 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #
  2. # Copyright (C) 2006-2015 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. PKG_NAME:=mtd-utils
  9. PKG_VERSION:=1.5.2
  10. PKG_SOURCE_VERSION:=aea36417067dade75192bafa03af70b6eb2677b1
  11. PKG_SOURCE_URL:=git://git.infradead.org/mtd-utils.git
  12. PKG_SOURCE_PROTO:=git
  13. PKG_MIRROR_HASH:=e11b342b85a36b2e438a8412ec52f87621d3046aec1a93039f8c72de9990b2a7
  14. include $(INCLUDE_DIR)/host-build.mk
  15. HOST_CFLAGS += -I$(STAGING_DIR_HOST)/include/e2fsprogs
  16. CFLAGS := $(HOST_CFLAGS) -I$(HOST_BUILD_DIR)/include -L$(HOST_BUILD_DIR) -L$(STAGING_DIR_HOST)/lib -DNO_NATIVE_SUPPORT
  17. ifneq ($(HOST_OS),Linux)
  18. CFLAGS += -Dloff_t=off_t -D__BYTE_ORDER=BYTE_ORDER -include getline.h -include endian.h -I$(CURDIR)/include -include fls.h
  19. MTD_STATIC := 0
  20. else
  21. MTD_STATIC := 1
  22. endif
  23. MTD_MAKEOPTS = \
  24. CFLAGS="$(CFLAGS)" \
  25. LDFLAGS="$(HOST_LDFLAGS)" \
  26. WITHOUT_LZO=1 WITHOUT_XATTR=1 \
  27. SUBDIRS="" \
  28. BUILDDIR="$(HOST_BUILD_DIR)" \
  29. STATIC=$(MTD_STATIC) \
  30. V=$(if $(findstring c,$(OPENWRT_VERBOSE)),1)
  31. define Host/Compile
  32. $(MAKE) -C $(HOST_BUILD_DIR) \
  33. $(MTD_MAKEOPTS) \
  34. TARGETS="mkfs.jffs2 ubi-utils/ubinize mkfs.ubifs/mkfs.ubifs"
  35. endef
  36. define Host/Install
  37. $(CP) \
  38. $(HOST_BUILD_DIR)/mkfs.jffs2 \
  39. $(HOST_BUILD_DIR)/mkfs.ubifs/mkfs.ubifs \
  40. $(HOST_BUILD_DIR)/ubi-utils/ubinize \
  41. $(STAGING_DIR_HOST)/bin/
  42. endef
  43. define Host/Clean
  44. rm -f $(STAGING_DIR_HOST)/bin/{mkfs.jffs2,mkfs.ubifs,ubinize}
  45. endef
  46. $(eval $(call HostBuild))