Makefile 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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.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:=
  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. MTD_STATIC := 0
  24. else
  25. MTD_STATIC := 1
  26. endif
  27. MTD_MAKEOPTS = \
  28. CFLAGS="$(CFLAGS)" \
  29. LDFLAGS="$(HOST_LDFLAGS)" \
  30. WITHOUT_LZO=1 WITHOUT_XATTR=1 \
  31. SUBDIRS="" \
  32. BUILDDIR="$(HOST_BUILD_DIR)" \
  33. STATIC=$(MTD_STATIC) \
  34. V=$(if $(findstring c,$(OPENWRT_VERBOSE)),1)
  35. define Host/Compile
  36. $(MAKE) -C $(HOST_BUILD_DIR) \
  37. $(MTD_MAKEOPTS) \
  38. TARGETS="mkfs.jffs2 ubi-utils/ubinize mkfs.ubifs/mkfs.ubifs"
  39. endef
  40. define Host/Install
  41. $(CP) \
  42. $(HOST_BUILD_DIR)/mkfs.jffs2 \
  43. $(HOST_BUILD_DIR)/mkfs.ubifs/mkfs.ubifs \
  44. $(HOST_BUILD_DIR)/ubi-utils/ubinize \
  45. $(STAGING_DIR_HOST)/bin/
  46. endef
  47. define Host/Clean
  48. rm -f $(STAGING_DIR_HOST)/bin/{mkfs.jffs2,mkfs.ubifs,ubinize}
  49. endef
  50. $(eval $(call HostBuild))