aboutsummaryrefslogtreecommitdiff
path: root/ubi-utils/Makefile
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2008-01-23 19:34:52 +0200
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2008-01-23 19:34:52 +0200
commit3ad29ab55ad71d706152781b70a43d9f6be407b9 (patch)
tree4e5a41b23e771faef0f633c6570210a42bd9c037 /ubi-utils/Makefile
parent22f5fe49d60ea43524a902408b3112a78f2c5aae (diff)
ubi-utils: remove all old tools
Remove all old tools because I cannot maintain them and the original authors do not seem to have time for this. Some of the tools do not work properly, some are just vague and undocumented and seem to be oriented to the environment of the IBM guys. Nevertheless, I'll return the tool as is in the next commit, becouse they are still useful. This commit also adds a ubinize utility to generate UBI images. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'ubi-utils/Makefile')
-rw-r--r--ubi-utils/Makefile76
1 files changed, 32 insertions, 44 deletions
diff --git a/ubi-utils/Makefile b/ubi-utils/Makefile
index 1f8e543..8d4412d 100644
--- a/ubi-utils/Makefile
+++ b/ubi-utils/Makefile
@@ -10,65 +10,53 @@ MANDIR=/usr/man
INCLUDEDIR=/usr/include
CC := $(CROSS)gcc
-CFLAGS := -I./inc -I./src -I$(KERNELHDR) $(OPTFLAGS) -Werror -Wall -O0 -g
+CFLAGS := -Iinclude -Isrc -I$(KERNELHDR) $(OPTFLAGS) -Werror -Wall
-PERLPROGS = mkpfi
-TARGETS = ubiupdate ubimkvol ubirmvol ubicrc32 ubinfo ubiattach ubidetach \
- unubi pfi2bin
+LIBS = libubi libubigen libiniparser
+UTILS = ubiupdate ubimkvol ubirmvol ubicrc32 ubinfo ubiattach ubidetach ubinize
-vpath %.c ./src
+vpath %.c src
-%: %.o
- $(CC) $(LDFLAGS) -g -o $@ $^
+all: $(UTILS)
-%.o: %.c
- $(CC) $(CFLAGS) -g -c -o $@ $< -g -Wp,-MD,.$(shell basename $<).dep
-
-all: $(TARGETS) libubi.a
-
-IGNORE=${wildcard .*.c.dep}
--include ${IGNORE}
-
-clean:
- rm -rf *.o $(TARGETS) .*.c.dep libubi.a
-
-libubi.a: libubi.o
- ar cr $@ $^
+# The below cancels existing implicite rule to make programs from .c files,
+# in order to force make using our rule defined below
+%: %.c
-ubidetach: ubidetach.o common.o libubi.o
- $(CC) $(LDFLAGS) -o $@ $^
+# The below is the rule to get an .o file from a .c file
+%.o: %.c
+ $(CC) $(CFLAGS) $< -c -o $@
-ubiattach: ubiattach.o common.o libubi.o
- $(CC) $(LDFLAGS) -o $@ $^
+# And the below is the rule to get final executable from its .o and common.o
+%: libubi %.o common.o
+ $(CC) $(CFLAGS) $(filter %.o, $^) -L. -lubi -o $@
-ubinfo: ubinfo.o common.o libubi.o
- $(CC) $(LDFLAGS) -o $@ $^
+ubicrc32: ubicrc32.o crc32.o
+ $(CC) $(CFLAGS) -o $@ $^
-ubiupdate: ubiupdate.o common.o libubi.o
- $(CC) $(LDFLAGS) -o $@ $^
+ubinize: ubinize.o common.o crc32.o libiniparser libubigen
+ $(CC) $(CFLAGS) $(filter %.o, $^) -L. -liniparser -lubigen -o $@
-ubimkvol: ubimkvol.o common.o libubi.o
- $(CC) $(LDFLAGS) -o $@ $^
+libubi: libubi.o
+ $(AR) crv $@.a $^
+ ranlib $@.a
-ubirmvol: ubirmvol.o common.o libubi.o
- $(CC) $(LDFLAGS) -o $@ $^
+libubigen: libubigen.o
+ $(AR) crv $@.a $^
+ ranlib $@.a
-ubicrc32: ubicrc32.o crc32.o
- $(CC) $(LDFLAGS) -o $@ $^
+libiniparser: libiniparser.o dictionary.o
+ $(AR) crv $@.a $^
+ ranlib $@.a
-unubi: unubi.o crc32.o unubi_analyze.o eb_chain.o
- $(CC) $(LDFLAGS) -o $@ $^
-
-pfi2bin: pfi2bin.o common.o list.o crc32.o libubigen.o bootenv.o \
- hashmap.o libpfi.o common.o
- $(CC) $(LDFLAGS) -o $@ $^
+clean:
+ rm -rf *.o $(addsuffix .a, $(LIBS)) $(UTILS) .*.c.dep
-install: ${TARGETS}
+install: ${UTILS}
mkdir -p ${DESTDIR}/${SBINDIR}
- install -m0755 ${TARGETS} ${DESTDIR}/${SBINDIR}/
- (cd perl && install ${PERLPROGS} ${DESTDIR}/${SBINDIR}/)
+ install -m0755 ${UTILS} ${DESTDIR}/${SBINDIR}/
uninstall:
- for file in ${TARGETS} ${PERLPROGS}; do \
+ for file in ${UTILS}; do \
$(RM) ${DESTDIR}/${SBINDIR}/$$file; \
done