summaryrefslogtreecommitdiff
path: root/ubi-utils/Makefile
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2011-06-25 13:20:37 -0400
committerArtem Bityutskiy <dedekind1@gmail.com>2011-06-27 09:07:07 +0300
commit3285a49dd871d54c1ec13076173ad617443baae1 (patch)
tree6b0962b6ec8437ffd54f03846f454943ea8bc443 /ubi-utils/Makefile
parent966122b0bbb175e9d8cc9876bb455e12c1d70eb9 (diff)
rewrite build system to avoid recursion
The ubi-utils/src/ subdir is tossed as it just complicates things for no real gain. The dictionary.h header is relocated to the ubi-utils/include/ since other headers in there need it. The top level clean is replaced with a `find -delete` on objects, so it might prune more than necessary, but many projects now do this sort of thing and no one complained there. A "mkdep" helper generates the actual rule, and the variables are used with "foreach" to expand these automatically. The tests subdir is updated only to reflect the ubi-utils source move. Otherwise, it is left untouched as making that non-recursive isn't really worth the effort. While we're gutting things, also through in kbuild style output while building to make things more legible. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
Diffstat (limited to 'ubi-utils/Makefile')
-rw-r--r--ubi-utils/Makefile60
1 files changed, 0 insertions, 60 deletions
diff --git a/ubi-utils/Makefile b/ubi-utils/Makefile
deleted file mode 100644
index df81cd9..0000000
--- a/ubi-utils/Makefile
+++ /dev/null
@@ -1,60 +0,0 @@
-#
-# Makefile for ubi-utils
-#
-
-KERNELHDR := ../include
-
-# CFLAGS += -Werror
-CPPFLAGS += -Iinclude -Isrc -I$(KERNELHDR)
-
-LIBS = libubi libubigen libiniparser libscan
-TARGETS = ubiupdatevol ubimkvol ubirmvol ubicrc32 ubinfo ubiattach \
- ubidetach ubinize ubiformat ubirename mtdinfo ubirsvol
-
-VPATH = src
-LDLIBS = -L$(BUILDDIR)/../lib -lmtd
-
-include ../common.mk
-
-# And the below is the rule to get final executable from its .o and ubiutils-common.o
-$(TARGETS): $(addprefix $(BUILDDIR)/,\
- libubi.a ubiutils-common.o)
-# $(CC) $(CFLAGS) $(filter %.o, $^) -L. -lubi -o $@
-
-$(BUILDDIR)/ubicrc32: $(addprefix $(BUILDDIR)/,\
- ubicrc32.o)
-# $(CC) $(CFLAGS) -o $@ $^
-
-$(BUILDDIR)/ubinize: $(addprefix $(BUILDDIR)/,\
- ubinize.o ubiutils-common.o libiniparser.a libubigen.a)
-# $(CC) $(CFLAGS) $(filter %.o, $^) -L. -liniparser -lubigen -o $@
-
-$(BUILDDIR)/mtdinfo: $(addprefix $(BUILDDIR)/,\
- libubigen.a ubiutils-common.o)
-# $(CC) $(CFLAGS) $(filter %.o, $^) -L. -lmtd -lubigen -o $@
-
-$(BUILDDIR)/ubiformat: $(addprefix $(BUILDDIR)/,\
- ubiformat.o ubiutils-common.o libscan.a libubi.a libubigen.a)
-# $(CC) $(CFLAGS) $(filter %.o, $^) -L. -lmtd -lscan -lubi -lubigen -o $@
-
-$(BUILDDIR)/libubi.a: $(BUILDDIR)/libubi.o
-
-$(BUILDDIR)/libubigen.a: $(BUILDDIR)/libubigen.o
-
-$(BUILDDIR)/libiniparser.a: $(addprefix $(BUILDDIR)/,\
- libiniparser.o dictionary.o)
-
-$(BUILDDIR)/libscan.a: $(addprefix $(BUILDDIR)/,\
- libscan.o)
-
-clean::
- rm -f $(addsuffix .a, $(LIBS))
-
-install::
- mkdir -p ${DESTDIR}/${SBINDIR}
- install -m 0755 ${TARGETS} ${DESTDIR}/${SBINDIR}/
-
-uninstall:
- for file in ${TARGETS}; do \
- $(RM) ${DESTDIR}/${SBINDIR}/$$file; \
- done