summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authorPeter Korsgaard <jacmet@sunsite.dk>2010-02-03 15:02:25 +0100
committerPeter Korsgaard <jacmet@sunsite.dk>2010-02-03 15:02:25 +0100
commit6d34b1d0589ce2a9c15bf95c83effafc85ef62c2 (patch)
treec0d8dc07039725e556bc05ce77d302c60c9efc38 /package
parent9277cb760a4cc6e62d0cd23fa938dd953e875a13 (diff)
mtd: host support cleanup
Build host version in build/mtd-utils-<VERSION>-host like other host packages, and install into host/usr/sbin. Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Diffstat (limited to 'package')
-rw-r--r--package/mtd/mtd.mk33
1 files changed, 21 insertions, 12 deletions
diff --git a/package/mtd/mtd.mk b/package/mtd/mtd.mk
index 99bdfa752..e4f59173f 100644
--- a/package/mtd/mtd.mk
+++ b/package/mtd/mtd.mk
@@ -6,9 +6,8 @@
MTD_VERSION:=1.3.1
MTD_SOURCE:=mtd-utils-$(MTD_VERSION).tar.bz2
MTD_SITE:=ftp://ftp.infradead.org/pub/mtd-utils
-MTD_NAME:=mtd-utils-$(MTD_VERSION)
-MTD_HOST_DIR:= $(TOOLCHAIN_DIR)/$(MTD_NAME)
-MTD_DIR:=$(BUILD_DIR)/$(MTD_NAME)
+MTD_DIR:=$(BUILD_DIR)/mtd-utils-$(MTD_VERSION)
+MTD_HOST_DIR:= $(MTD_DIR)-host
MTD_CAT:=$(BZCAT)
#############################################################
@@ -17,25 +16,34 @@ MTD_CAT:=$(BZCAT)
# needed by target/jffs2root.
#
#############################################################
-MKFS_JFFS2 := $(MTD_HOST_DIR)/mkfs.jffs2
-SUMTOOL := $(MTD_HOST_DIR)/sumtool
+MKFS_JFFS2 := $(HOST_DIR)/usr/sbin/mkfs.jffs2
+SUMTOOL := $(HOST_DIR)/usr/sbin/sumtool
$(DL_DIR)/$(MTD_SOURCE):
$(call DOWNLOAD,$(MTD_SITE),$(MTD_SOURCE))
$(MTD_HOST_DIR)/.unpacked: $(DL_DIR)/$(MTD_SOURCE)
- $(MTD_CAT) $(DL_DIR)/$(MTD_SOURCE) | tar -C $(TOOLCHAIN_DIR) $(TAR_OPTIONS) -
+ mkdir -p $(@D)
+ $(MTD_CAT) $^ | tar $(TAR_STRIP_COMPONENTS)=1 -C $(@D) $(TAR_OPTIONS) -
toolchain/patch-kernel.sh $(MTD_HOST_DIR) \
package/mtd/ mtd-utils-\*.patch
touch $@
-$(MKFS_JFFS2): $(MTD_HOST_DIR)/.unpacked
- CC="$(HOSTCC)" CROSS= $(MAKE) BUILDDIR=$(MTD_HOST_DIR) \
- WITHOUT_XATTR=1 -C $(MTD_HOST_DIR) $(MTD_HOST_DIR)/mkfs.jffs2
+$(MTD_HOST_DIR)/mkfs.jffs2: $(MTD_HOST_DIR)/.unpacked
+ CC="$(HOSTCC)" CFLAGS="$(HOST_CFLAGS)" LDFLAGS="$(HOST_LDFLAGS)" \
+ CROSS= $(MAKE) BUILDDIR=$(MTD_HOST_DIR) \
+ WITHOUT_XATTR=1 -C $(MTD_HOST_DIR) $@
-$(SUMTOOL): $(MTD_HOST_DIR)/.unpacked
- CC="$(HOSTCC)" CROSS= $(MAKE) BUILDDIR=$(MTD_HOST_DIR) \
- WITHOUT_XATTR=1 -C $(MTD_HOST_DIR) $(MTD_HOST_DIR)/sumtool
+$(MKFS_JFFS2): $(MTD_HOST_DIR)/mkfs.jffs2
+ install -m 0755 -D $^ $@
+
+$(MTD_HOST_DIR)/sumtool: $(MTD_HOST_DIR)/.unpacked
+ CC="$(HOSTCC)" CFLAGS="$(HOST_CFLAGS)" LDFLAGS="$(HOST_LDFLAGS)" \
+ CROSS= $(MAKE) BUILDDIR=$(MTD_HOST_DIR) \
+ WITHOUT_XATTR=1 -C $(MTD_HOST_DIR) $@
+
+$(SUMTOOL): $(MTD_HOST_DIR)/sumtool
+ install -m 0755 $^ $@
mtd-host: host-lzo $(MKFS_JFFS2) $(SUMTOOL)
@@ -43,6 +51,7 @@ mtd-host-source: $(DL_DIR)/$(MTD_SOURCE)
mtd-host-clean:
-$(MAKE) -C $(MTD_HOST_DIR) clean
+ rm -f $(MKFS_JFFS2) $(SUMTOOL)
mtd-host-dirclean:
rm -rf $(MTD_HOST_DIR)