Blob Blame History Raw
diff --git a/Makefile b/Makefile
index b7ffd58..503021c 100644
--- a/Makefile
+++ b/Makefile
@@ -1,12 +1,13 @@
 
 # -*- sh -*-
 
+OPTFLAGS := -O2 -Wall
 SBINDIR=/usr/sbin
 MANDIR=/usr/man
 INCLUDEDIR=/usr/include
 #CROSS=arm-linux-
 CC := $(CROSS)gcc
-CFLAGS := -I./include -O2 -Wall
+CFLAGS := -I./include $(OPTFLAGS)
 
 ifeq ($(origin CROSS),undefined)
   BUILDDIR := .
@@ -42,6 +43,7 @@ $(BUILDDIR)/%.o: %.c
 .SUFFIXES:
 
 all: $(TARGETS)
+	make -C $(BUILDDIR)/ubi-utils
 
 IGNORE=${wildcard $(BUILDDIR)/.*.c.dep}
 -include ${IGNORE}
@@ -49,6 +51,7 @@ IGNORE=${wildcard $(BUILDDIR)/.*.c.dep}
 clean:
 	rm -f $(BUILDDIR)/*.o $(TARGETS) $(BUILDDIR)/.*.c.dep $(SYMLINKS)
 	if [ "$(BUILDDIR)x" != ".x" ]; then rm -rf $(BUILDDIR); fi
+	make -C $(BUILDDIR)/ubi-utils clean
 
 $(SYMLINKS):
 	ln -sf ../fs/jffs2/$@ $@
@@ -89,3 +92,4 @@ install: ${TARGETS}
 	install -m0755 ${TARGETS} ${DESTDIR}/${SBINDIR}/
 	mkdir -p ${DESTDIR}/${MANDIR}/man1
 	gzip -c mkfs.jffs2.1 > ${DESTDIR}/${MANDIR}/man1/mkfs.jffs2.1.gz
+	make -C $(BUILDDIR)/ubi-utils install
diff --git a/ubi-utils/Makefile b/ubi-utils/Makefile
index 797807d..db984c8 100644
--- a/ubi-utils/Makefile
+++ b/ubi-utils/Makefile
@@ -7,12 +7,15 @@ HOST_VERSION_NAME := $(shell uname -r)
 BUILD_CPU := $(shell uname -m)
 BUILD_OS := $(shell uname -o)
 
+OPTFLAGS := -O2 -g -Wall
 KERNELHDR := ../include
 DESTDIR := /usr/local
-SBINDIR := bin
+SBINDIR=/usr/sbin
+MANDIR=/usr/man
+INCLUDEDIR=/usr/include
 
 CC := $(CROSS)gcc
-CFLAGS := -I./inc -I./src -I$(KERNELHDR) -O2 -g -Wall -Werror \
+CFLAGS := -I./inc -I./src -I$(KERNELHDR) $(OPTFLAGS) -Werror \
 	-Wwrite-strings -W -std=gnu99 \
         -DHOST_OS_NAME=\"$(HOST_OS_NAME)\" \
         -DHOST_VERSION_NAME=\"$(HOST_VERSION_NAME)\" \
diff --git a/ubi-utils/src/bootenv.c b/ubi-utils/src/bootenv.c
index 561d473..a6dd4de 100644
--- a/ubi-utils/src/bootenv.c
+++ b/ubi-utils/src/bootenv.c
@@ -33,7 +33,7 @@
 #include <mtd/ubi-header.h>
 #include "crc32.h"
 
-#define __unused __attribute__((unused))
+#define ubi_unused __attribute__((unused))
 
 #define BOOTENV_MAXLINE 512 /* max line size of a bootenv.txt file */
 
@@ -399,7 +399,7 @@ err:
 }
 
 static int
-fill_output_buffer(bootenv_t env, char *buf, size_t buf_size_max __unused,
+fill_output_buffer(bootenv_t env, char *buf, size_t buf_size_max ubi_unused,
 		size_t *written)
 {
 	int rc = 0;
@@ -586,7 +586,7 @@ err:
 }
 
 int
-bootenv_valid(bootenv_t env __unused)
+bootenv_valid(bootenv_t env ubi_unused)
 {
 	/* @FIXME No sanity check implemented. */
 	return 0;
@@ -646,8 +646,8 @@ err:
 
 int
 bootenv_pdd_keep(bootenv_t env_old, bootenv_t env_new, bootenv_t *env_res,
-		 int *warnings, char *err_buf __unused,
-		 size_t err_buf_size __unused)
+		 int *warnings, char *err_buf ubi_unused,
+		 size_t err_buf_size ubi_unused)
 {
 	bootenv_list_t l_old = NULL;
 	bootenv_list_t l_new = NULL;
@@ -756,8 +756,8 @@ err:
 
 int
 bootenv_pdd_overwrite(bootenv_t env_old, bootenv_t env_new,
-		      bootenv_t *env_res, int *warnings __unused,
-		      char *err_buf __unused, size_t err_buf_size __unused)
+		      bootenv_t *env_res, int *warnings ubi_unused,
+		      char *err_buf ubi_unused, size_t err_buf_size ubi_unused)
 {
 	if ((env_old == NULL) || (env_new == NULL) || (env_res == NULL))
 		return -EINVAL;
@@ -767,7 +767,7 @@ bootenv_pdd_overwrite(bootenv_t env_old, bootenv_t env_new,
 
 int
 bootenv_pdd_merge(bootenv_t env_old, bootenv_t env_new, bootenv_t *env_res,
-		  int *warnings __unused, char *err_buf, size_t err_buf_size)
+		  int *warnings ubi_unused, char *err_buf, size_t err_buf_size)
 {
 	if ((env_old == NULL) || (env_new == NULL) || (env_res == NULL))
 		return -EINVAL;
diff --git a/ubi-utils/src/config.h b/ubi-utils/src/config.h
index 8c4dd54..55e60f3 100644
--- a/ubi-utils/src/config.h
+++ b/ubi-utils/src/config.h
@@ -23,6 +23,6 @@
 #define PACKAGE_BUGREPORT						\
 	"haver@vnet.ibm.com, dedekind@linutronix.de, or tglx@linutronix.de"
 
-#define __unused __attribute__((unused))
+#define ubi_unused __attribute__((unused))
 
 #endif
diff --git a/ubi-utils/src/libpfiflash.c b/ubi-utils/src/libpfiflash.c
index e60290a..9f17208 100644
--- a/ubi-utils/src/libpfiflash.c
+++ b/ubi-utils/src/libpfiflash.c
@@ -53,11 +53,11 @@
 #include <mtd/ubi-header.h>	/* FIXME Is this ok here? */
 #include "crc32.h"
 
-#define __unused __attribute__((unused))
+#define ubi_unused __attribute__((unused))
 
 #define COMPARE_BUFFER_SIZE 2048
 
-static const char copyright [] __unused =
+static const char copyright [] ubi_unused =
 	"Copyright International Business Machines Corp., 2006, 2007";
 
 /* simply clear buffer, then write into front of it */
diff --git a/ubi-utils/src/libubigen.c b/ubi-utils/src/libubigen.c
index 258e555..238c6fa 100644
--- a/ubi-utils/src/libubigen.c
+++ b/ubi-utils/src/libubigen.c
@@ -247,7 +247,7 @@ ubigen_write_broken_update(ubi_info_t u, uint32_t blk)
 }
 
 void
-dump_info(ubi_info_t u __unused)
+dump_info(ubi_info_t u ubi_unused)
 {
 #ifdef DEBUG
 	int err = 0;
diff --git a/ubi-utils/src/libubiold_sysfs.c b/ubi-utils/src/libubiold_sysfs.c
index c4860f6..5b42075 100644
--- a/ubi-utils/src/libubiold_sysfs.c
+++ b/ubi-utils/src/libubiold_sysfs.c
@@ -129,7 +129,7 @@ sysfs_read_dev_subst(const char *patt, unsigned int *major,
 }
 
 static int
-sysfs_read_ull(const char *file __unused, unsigned long long *num __unused)
+sysfs_read_ull(const char *file ubi_unused, unsigned long long *num ubi_unused)
 {
 	return 0;
 }
@@ -148,7 +148,7 @@ sysfs_read_ull_subst(const char *patt, unsigned long long *num, int n, ...)
 }
 
 static int
-sysfs_read_uint(const char *file __unused, unsigned int *num __unused)
+sysfs_read_uint(const char *file ubi_unused, unsigned int *num ubi_unused)
 {
 	return 0;
 }
--- mtd-utils-1.1.0/ubi-utils/Makefile~	2007-08-29 14:37:35.000000000 +0100
+++ mtd-utils-1.1.0/ubi-utils/Makefile	2007-08-29 14:38:24.000000000 +0100
@@ -15,7 +15,7 @@ MANDIR=/usr/man
 INCLUDEDIR=/usr/include
 
 CC := $(CROSS)gcc
-CFLAGS := -I./inc -I./src -I$(KERNELHDR) $(OPTFLAGS) -Werror \
+CFLAGS := -I./inc -I./src -I$(KERNELHDR) $(OPTFLAGS) \
 	-Wwrite-strings -W -std=gnu99 \
         -DHOST_OS_NAME=\"$(HOST_OS_NAME)\" \
         -DHOST_VERSION_NAME=\"$(HOST_VERSION_NAME)\" \