diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2008-02-19 14:54:17 +0200 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2008-02-19 16:41:16 +0200 |
commit | 86dd9696d3a1acb036d65909d93d73455b8aed3a (patch) | |
tree | 9e8bb6797b3bebd0bf83ae1fab2151a6dfeafe6a /ubi-utils/new-utils/Makefile | |
parent | ef644090223e5983ca2492850354c1390e3368d1 (diff) |
Revert ubi-tools changes
Restore ubi tools to their "original" state, which means to
the state they were before I stareted cleaning them up.
Instead, create a "new-utils" subdirectory and move my work
there.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'ubi-utils/new-utils/Makefile')
-rw-r--r-- | ubi-utils/new-utils/Makefile | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/ubi-utils/new-utils/Makefile b/ubi-utils/new-utils/Makefile new file mode 100644 index 0000000..fe60ffe --- /dev/null +++ b/ubi-utils/new-utils/Makefile @@ -0,0 +1,63 @@ +# +# Makefile for ubi-utils +# + +OPTFLAGS := -O2 -Wall +KERNELHDR := ../../include +DESTDIR := /usr/local +SBINDIR=/usr/sbin +MANDIR=/usr/man +INCLUDEDIR=/usr/include + +CC := $(CROSS)gcc +CFLAGS := -Iinclude -Isrc -I$(KERNELHDR) $(OPTFLAGS) -Werror -Wall + +LIBS = libubi libubigen libiniparser +UTILS = ubi-update ubi-mkvol ubi-rmvol ubi-crc32 ubi-info ubi-attach \ + ubi-detach ubi-nize + +vpath %.c src + +all: $(UTILS) + +# The below cancels existing implicite rule to make programs from .c files, +# in order to force make using our rule defined below +%: %.c + +# The below is the rule to get an .o file from a .c file +%.o: %.c + $(CC) $(CFLAGS) $< -c -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 $@ + +ubi-crc32: ubi-crc32.o crc32.o + $(CC) $(CFLAGS) -o $@ $^ + +ubi-nize: ubi-nize.o common.o crc32.o libiniparser libubigen + $(CC) $(CFLAGS) $(filter %.o, $^) -L. -liniparser -lubigen -o $@ + +libubi: libubi.o + $(AR) crv $@.a $^ + ranlib $@.a + +libubigen: libubigen.o + $(AR) crv $@.a $^ + ranlib $@.a + +libiniparser: libiniparser.o dictionary.o + $(AR) crv $@.a $^ + ranlib $@.a + +clean: + rm -rf *.o $(addsuffix .a, $(LIBS)) $(UTILS) .*.c.dep + +install: ${UTILS} + mkdir -p ${DESTDIR}/${SBINDIR} + install -m0755 ${UTILS} ${DESTDIR}/${SBINDIR}/ + +uninstall: + for file in ${UTILS}; do \ + $(RM) ${DESTDIR}/${SBINDIR}/$$file; \ + done |