From 8f627247f651e80834d7b0441328151be180b335 Mon Sep 17 00:00:00 2001 From: Kevin Cernekee Date: Wed, 7 Jul 2010 17:30:10 -0700 Subject: mtd-utils: move libmtd source files to lib/ subdirectory Source files for libmtd, crc32, and fec are scattered throughout the tree. Move them to a central location so they can be built into a common "libmtd.a" library used by all mtd-utils programs. This patch only renames/deletes files and does not change the content. Also modify the build system and source code so that libmtd.a can be built from a "common" location (lib/). Statically link all utilities at the top level with libmtd.a . Minor changes to mkfs.ubifs to allow using the common crc32 implementation. Signed-off-by: Kevin Cernekee Signed-off-by: Artem Bityutskiy --- ubi-utils/Makefile | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'ubi-utils/Makefile') diff --git a/ubi-utils/Makefile b/ubi-utils/Makefile index e736a09..327d2d7 100644 --- a/ubi-utils/Makefile +++ b/ubi-utils/Makefile @@ -9,11 +9,12 @@ SUBDIRS = old-utils # CFLAGS += -Werror CPPFLAGS += -Iinclude -Isrc -I$(KERNELHDR) -LIBS = libubi libmtd libubigen libiniparser libscan +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 @@ -23,32 +24,30 @@ $(TARGETS): $(addprefix $(BUILDDIR)/,\ # $(CC) $(CFLAGS) $(filter %.o, $^) -L. -lubi -o $@ $(BUILDDIR)/ubicrc32: $(addprefix $(BUILDDIR)/,\ - ubicrc32.o crc32.o) + ubicrc32.o) # $(CC) $(CFLAGS) -o $@ $^ $(BUILDDIR)/ubinize: $(addprefix $(BUILDDIR)/,\ - ubinize.o common.o crc32.o libiniparser.a libubigen.a) + ubinize.o common.o libiniparser.a libubigen.a) # $(CC) $(CFLAGS) $(filter %.o, $^) -L. -liniparser -lubigen -o $@ $(BUILDDIR)/mtdinfo: $(addprefix $(BUILDDIR)/,\ - libmtd.a libubigen.a crc32.o common.o) + libubigen.a common.o) # $(CC) $(CFLAGS) $(filter %.o, $^) -L. -lmtd -lubigen -o $@ $(BUILDDIR)/ubiformat: $(addprefix $(BUILDDIR)/,\ - ubiformat.o common.o crc32.o libmtd.a libscan.a libubi.a libubigen.a) + ubiformat.o 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)/libmtd.a: $(BUILDDIR)/libmtd.o $(BUILDDIR)/libmtd_legacy.o - $(BUILDDIR)/libubigen.a: $(BUILDDIR)/libubigen.o $(BUILDDIR)/libiniparser.a: $(addprefix $(BUILDDIR)/,\ libiniparser.o dictionary.o) $(BUILDDIR)/libscan.a: $(addprefix $(BUILDDIR)/,\ - libscan.o crc32.o) + libscan.o) clean:: rm -f $(addsuffix .a, $(LIBS)) -- cgit v1.2.3