tools/mtd-utils: fix build error
[openwrt.git] / tools / mtd-utils / Makefile
1 #
2 # Copyright (C) 2006-2010 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
9 PKG_NAME:=mtd-utils
10 PKG_VERSION:=1.4.5
11
12 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
13 PKG_SOURCE_URL:=git://git.infradead.org/mtd-utils.git
14 PKG_SOURCE_PROTO:=git
15 PKG_SOURCE_VERSION:=5319b84974fcb71504aed2d1b8285e9c0a4a4bb8
16 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
17 PKG_CAT:=zcat
18
19 HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)-$(PKG_VERSION)
20
21 include $(INCLUDE_DIR)/host-build.mk
22
23 HOST_CFLAGS += -I$(STAGING_DIR_HOST)/include/e2fsprogs
24 CFLAGS := $(HOST_CFLAGS) -I$(HOST_BUILD_DIR)/include -L$(HOST_BUILD_DIR) -L$(STAGING_DIR_HOST)/lib -DNO_NATIVE_SUPPORT
25 ifneq ($(HOST_OS),Linux)
26 CFLAGS += -Dloff_t=off_t -D__BYTE_ORDER=BYTE_ORDER -include getline.h -include endian.h -I$(CURDIR)/include -include fls.h
27 endif
28
29 MTD_MAKEOPTS = \
30 CFLAGS="$(CFLAGS)" \
31 WITHOUT_LZO=1 WITHOUT_XATTR=1 \
32 LZMA_STATIC_LIB="$(STAGING_DIR_HOST)/lib/liblzma.a" \
33 SUBDIRS="" \
34 BUILDDIR="$(HOST_BUILD_DIR)"
35
36 define Host/Compile
37 $(MAKE) -C $(HOST_BUILD_DIR)/lib \
38 $(MTD_MAKEOPTS) \
39 TARGETS="libmtd.a libcrc32.a" \
40 LIBS="libmtd libcrc32"
41 $(MAKE) -C $(HOST_BUILD_DIR) \
42 $(MTD_MAKEOPTS) \
43 TARGETS=mkfs.jffs2
44 $(MAKE) -C $(HOST_BUILD_DIR)/ubi-utils \
45 $(MTD_MAKEOPTS) \
46 TARGETS=ubinize
47 $(MAKE) -C $(HOST_BUILD_DIR)/mkfs.ubifs \
48 $(MTD_MAKEOPTS) \
49 BUILDDIR="$(HOST_BUILD_DIR)/mkfs.ubifs"
50 endef
51
52 define Host/Install
53 $(CP) \
54 $(HOST_BUILD_DIR)/mkfs.jffs2 \
55 $(HOST_BUILD_DIR)/mkfs.ubifs/mkfs.ubifs \
56 $(HOST_BUILD_DIR)/ubinize \
57 $(STAGING_DIR_HOST)/bin/
58 endef
59
60 define Host/Clean
61 rm -f $(STAGING_DIR_HOST)/bin/{mkfs.jffs2,mkfs.ubifs,ubinize}
62 endef
63
64 $(eval $(call HostBuild))
This page took 0.059248 seconds and 5 git commands to generate.