1
0

Makefile 1.6 KB

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