Hallo David,

this patch prevents building target binaries when mtd-utils is
being implicitly added by user/Makefile for JFFS2.

Without this change the build effectively breaks for targets
that don't use libz, required by mtd-utils and not being
added by the usual config.in rule.

Please apply.


diff -u -p -r1.9 Makefile
--- user/mtd-utils/Makefile	21 Mar 2004 04:43:03 -0000	1.9
+++ user/mtd-utils/Makefile	1 Jun 2004 16:24:08 -0000
@@ -6,19 +6,22 @@
 # These flags are used for build native versions of the tools for the
 # host system so it can generate images etc
 #
-#MY_CFLAGS = -I$(ROOTDIR)/$(LINUXDIR)/include
-MY_CFLAGS = -I/usr/include
-BUILD_CFLAGS += $(MY_CFLAGS)
+MY_CFLAGS = -I$(ROOTDIR)/$(LINUXDIR)/include
+#MY_CFLAGS = -I/usr/include
 CFLAGS := $(MY_CFLAGS) $(CFLAGS)
 BUILD_CC = gcc
 CFLAGS += $(INCZ) -D__USE_BSD
 
+# Don't build target binaries when mtd-utils is being
+# implicitly added by user/Makefile for JFFS2.
+ifeq ($(strip $(CONFIG_USER_MTDUTILS)),y)
 TARGETS = erase eraseall \
 	      nftl_format nftldump doc_loadbios doc_loadipl \
 	      ftl_format ftl_check \
 	      nanddump nandtest nandwrite \
 	      mkfs.jffs mkfs.jffs2 \
-	      lock unlock einfo mtd_debug fcp 
+	      lock unlock einfo mtd_debug fcp
+endif
 
 BUILD_TARGETS = $(patsubst %,build/%,$(TARGETS))
 
@@ -43,6 +46,8 @@ clean:
 	rm -rf build
 
 romfs:
+	true
+ifeq ($(strip $(CONFIG_USER_MTDUTILS)),y)
 	$(ROMFSINST) -e CONFIG_USER_MTDUTILS_ERASE        /bin/erase
 	$(ROMFSINST) -e CONFIG_USER_MTDUTILS_ERASEALL     /bin/eraseall
 	$(ROMFSINST) -e CONFIG_USER_MTDUTILS_FTL_CHECK    /bin/ftl_check
@@ -56,6 +61,7 @@ romfs:
 	$(ROMFSINST) -e CONFIG_USER_MTDUTILS_NANDWRITE    /bin/nandwrite
 	$(ROMFSINST) -e CONFIG_USER_MTDUTILS_DOC_LOADBIOS /bin/doc_loadbios
 	$(ROMFSINST) -e CONFIG_USER_MTDUTILS_DOC_LOADIPL  /bin/doc_loadipl
+endif
 
 mkfs.jffs2.o crc32.o: crc32.h
 build/mkfs.jffs2.o build/crc32.o: crc32.h
