2010-01-11 09:04:15 +08:00
|
|
|
#
|
2015-05-26 17:25:30 +08:00
|
|
|
# Copyright (C) 2006-2015 OpenWrt.org
|
2006-06-27 08:44:04 +08:00
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
2005-03-06 11:34:52 +08:00
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
|
2012-03-02 03:55:48 +08:00
|
|
|
PKG_NAME:=mtd-utils
|
2015-12-05 23:44:58 +08:00
|
|
|
PKG_VERSION:=1.5.2
|
2005-03-06 11:34:52 +08:00
|
|
|
|
2015-12-05 23:44:58 +08:00
|
|
|
PKG_SOURCE_VERSION:=aea36417067dade75192bafa03af70b6eb2677b1
|
2016-10-04 20:28:54 +08:00
|
|
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
|
2009-06-15 04:42:12 +08:00
|
|
|
PKG_SOURCE_URL:=git://git.infradead.org/mtd-utils.git
|
|
|
|
PKG_SOURCE_PROTO:=git
|
|
|
|
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
2016-10-04 20:28:54 +08:00
|
|
|
PKG_MIRROR_MD5SUM:=e11b342b85a36b2e438a8412ec52f87621d3046aec1a93039f8c72de9990b2a7
|
2005-05-28 17:17:29 +08:00
|
|
|
|
2009-06-15 04:42:12 +08:00
|
|
|
HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)-$(PKG_VERSION)
|
2005-05-28 17:17:29 +08:00
|
|
|
|
2006-06-21 14:19:43 +08:00
|
|
|
include $(INCLUDE_DIR)/host-build.mk
|
2005-05-28 17:17:29 +08:00
|
|
|
|
2011-02-20 11:25:56 +08:00
|
|
|
HOST_CFLAGS += -I$(STAGING_DIR_HOST)/include/e2fsprogs
|
2010-02-25 07:02:38 +08:00
|
|
|
CFLAGS := $(HOST_CFLAGS) -I$(HOST_BUILD_DIR)/include -L$(HOST_BUILD_DIR) -L$(STAGING_DIR_HOST)/lib -DNO_NATIVE_SUPPORT
|
2006-10-11 03:19:24 +08:00
|
|
|
ifneq ($(HOST_OS),Linux)
|
2010-01-16 08:11:43 +08:00
|
|
|
CFLAGS += -Dloff_t=off_t -D__BYTE_ORDER=BYTE_ORDER -include getline.h -include endian.h -I$(CURDIR)/include -include fls.h
|
2015-09-14 22:51:07 +08:00
|
|
|
MTD_STATIC := 0
|
|
|
|
else
|
|
|
|
MTD_STATIC := 1
|
2006-09-28 01:03:36 +08:00
|
|
|
endif
|
|
|
|
|
2009-06-15 04:42:12 +08:00
|
|
|
MTD_MAKEOPTS = \
|
|
|
|
CFLAGS="$(CFLAGS)" \
|
2015-02-06 08:00:43 +08:00
|
|
|
LDFLAGS="$(HOST_LDFLAGS)" \
|
2012-03-02 03:55:48 +08:00
|
|
|
WITHOUT_LZO=1 WITHOUT_XATTR=1 \
|
2009-06-15 04:42:12 +08:00
|
|
|
SUBDIRS="" \
|
2015-09-14 22:51:07 +08:00
|
|
|
BUILDDIR="$(HOST_BUILD_DIR)" \
|
|
|
|
STATIC=$(MTD_STATIC) \
|
|
|
|
V=$(if $(findstring c,$(OPENWRT_VERBOSE)),1)
|
2009-06-15 04:42:12 +08:00
|
|
|
|
2009-02-22 12:37:20 +08:00
|
|
|
define Host/Compile
|
2010-10-03 20:03:21 +08:00
|
|
|
$(MAKE) -C $(HOST_BUILD_DIR) \
|
|
|
|
$(MTD_MAKEOPTS) \
|
2015-05-26 17:25:30 +08:00
|
|
|
TARGETS="mkfs.jffs2 ubi-utils/ubinize mkfs.ubifs/mkfs.ubifs"
|
2006-06-21 14:19:43 +08:00
|
|
|
endef
|
2005-03-06 11:34:52 +08:00
|
|
|
|
2009-02-22 12:37:20 +08:00
|
|
|
define Host/Install
|
2009-06-15 04:42:23 +08:00
|
|
|
$(CP) \
|
|
|
|
$(HOST_BUILD_DIR)/mkfs.jffs2 \
|
2010-01-13 13:21:50 +08:00
|
|
|
$(HOST_BUILD_DIR)/mkfs.ubifs/mkfs.ubifs \
|
2015-05-26 17:25:30 +08:00
|
|
|
$(HOST_BUILD_DIR)/ubi-utils/ubinize \
|
2009-06-15 04:42:23 +08:00
|
|
|
$(STAGING_DIR_HOST)/bin/
|
2006-06-21 14:19:43 +08:00
|
|
|
endef
|
2005-05-28 17:17:29 +08:00
|
|
|
|
2009-02-22 12:37:20 +08:00
|
|
|
define Host/Clean
|
2010-01-13 13:21:50 +08:00
|
|
|
rm -f $(STAGING_DIR_HOST)/bin/{mkfs.jffs2,mkfs.ubifs,ubinize}
|
2006-09-25 04:49:31 +08:00
|
|
|
endef
|
|
|
|
|
2006-06-21 14:19:43 +08:00
|
|
|
$(eval $(call HostBuild))
|