Toto, we don't support Linux 2.4 anymore..
[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:=20101002
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:=b8bbd73bb5bd0b1f5f2c6a3441486d69a45cc79c
16 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
17 PKG_MD5SUM:=475a6bd4b26bdde63f759f9e1f7bc461
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 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 NO_LZO=1 WITHOUT_XATTR=1 \
32 SUBDIRS="" \
33 BUILDDIR="$(HOST_BUILD_DIR)"
34
35 define Host/Compile
36 $(MAKE) -C $(HOST_BUILD_DIR)/lib \
37 $(MTD_MAKEOPTS) \
38 TARGETS="libmtd.a libcrc32.a" \
39 LIBS="libmtd libcrc32"
40 $(MAKE) -C $(HOST_BUILD_DIR) \
41 $(MTD_MAKEOPTS) \
42 TARGETS=mkfs.jffs2
43 $(MAKE) -C $(HOST_BUILD_DIR)/ubi-utils \
44 $(MTD_MAKEOPTS) \
45 TARGETS=ubinize
46 $(MAKE) -C $(HOST_BUILD_DIR)/mkfs.ubifs \
47 $(MTD_MAKEOPTS) \
48 BUILDDIR="$(HOST_BUILD_DIR)/mkfs.ubifs"
49 endef
50
51 define Host/Install
52 $(CP) \
53 $(HOST_BUILD_DIR)/mkfs.jffs2 \
54 $(HOST_BUILD_DIR)/mkfs.ubifs/mkfs.ubifs \
55 $(HOST_BUILD_DIR)/ubinize \
56 $(STAGING_DIR_HOST)/bin/
57 endef
58
59 define Host/Clean
60 rm -f $(STAGING_DIR_HOST)/bin/{mkfs.jffs2,mkfs.ubifs,ubinize}
61 endef
62
63 $(eval $(call HostBuild))
This page took 0.041821 seconds and 5 git commands to generate.