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