tools: always build mpc, now that older gcc versions have been eliminated, fixes...
[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
10 PKG_VERSION:=20101124
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:=c1a7889da754dfac2f130772daef783980c65d5d
16 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
17 PKG_MD5SUM:=78e5e74957f458bd808a6d4af0a38071
18 PKG_CAT:=zcat
19
20 HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)-$(PKG_VERSION)
21
22 include $(INCLUDE_DIR)/host-build.mk
23
24 HOST_CFLAGS += -I$(STAGING_DIR_HOST)/include/e2fsprogs
25 CFLAGS := $(HOST_CFLAGS) -I$(HOST_BUILD_DIR)/include -L$(HOST_BUILD_DIR) -L$(STAGING_DIR_HOST)/lib -DNO_NATIVE_SUPPORT
26 ifneq ($(HOST_OS),Linux)
27 CFLAGS += -Dloff_t=off_t -D__BYTE_ORDER=BYTE_ORDER -include getline.h -include endian.h -I$(CURDIR)/include -include fls.h
28 endif
29
30 MTD_MAKEOPTS = \
31 CFLAGS="$(CFLAGS)" \
32 NO_LZO=1 WITHOUT_XATTR=1 \
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.04828 seconds and 5 git commands to generate.