blob: 6ac2cca9d65aa0ce4dc54246234be02f5d2f925d [file] [log] [blame]
Brad Bishop316dfdd2018-06-25 12:45:53 -04001From 1c989e4c36d0bf76ab444f984bc73b98eeacd03f Mon Sep 17 00:00:00 2001
2From: Andrea Adami <andrea.adami@gmail.com>
3Date: Sun, 29 Jun 2014 00:32:29 +0200
4Subject: [PATCH 1/9] Makefile: build ubi-utils only
5
6We build all the static ubi-utils but actually only ubiattach is needed in
7a minimalistic initramfs for the mount of ubi volumes.
8
9More fixes are needed in order to build the full mtd-utils.
10The first issue is:
11
12| mkfs.jffs2.c:64:20: fatal error: libgen.h: No such file or directory
13| #include <libgen.h>
14
15Removing the include then the second error is:
16
17| mkfs.jffs2.c:1570:22: error: '_SC_PAGESIZE' undeclared
18| (first use in this function)
19| page_size = sysconf(_SC_PAGESIZE);
20
21Upstream-Status: Inappropriate [embedded specific]
22
23Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
24---
25 Makefile | 26 ++------------------------
26 1 file changed, 2 insertions(+), 24 deletions(-)
27
28diff --git a/Makefile b/Makefile
29index 3ce8587..8b79f71 100644
30--- a/Makefile
31+++ b/Makefile
32@@ -16,28 +16,11 @@ endif
33
34 TESTS = tests
35
36-MTD_BINS = \
37- ftl_format flash_erase nanddump doc_loadbios \
38- ftl_check mkfs.jffs2 flash_lock flash_unlock \
39- flash_otp_info flash_otp_dump flash_otp_lock flash_otp_write \
40- mtd_debug flashcp nandwrite nandtest mtdpart \
41- jffs2dump \
42- nftldump nftl_format docfdisk \
43- rfddump rfdformat \
44- serve_image recv_image \
45- sumtool jffs2reader
46 UBI_BINS = \
47 ubiupdatevol ubimkvol ubirmvol ubicrc32 ubinfo ubiattach \
48 ubidetach ubinize ubiformat ubirename mtdinfo ubirsvol ubiblock
49
50-BINS = $(MTD_BINS)
51-BINS += mkfs.ubifs/mkfs.ubifs
52-BINS += $(addprefix ubi-utils/,$(UBI_BINS))
53-SCRIPTS = flash_eraseall
54-
55-TARGETS = $(BINS)
56-TARGETS += lib/libmtd.a
57-TARGETS += ubi-utils/libubi.a
58+BINS = $(addprefix ubi-utils/,$(UBI_BINS))
59
60 OBJDEPS = $(BUILDDIR)/include/version.h
61
62@@ -61,12 +44,9 @@ endif
63 rm -f $(BUILDDIR)/include/version.h
64 $(MAKE) -C $(TESTS) clean
65
66-install:: $(addprefix $(BUILDDIR)/,${BINS}) ${SCRIPTS}
67+install:: $(addprefix $(BUILDDIR)/,${BINS})
68 mkdir -p ${DESTDIR}/${SBINDIR}
69 install -m 0755 $^ ${DESTDIR}/${SBINDIR}/
70- mkdir -p ${DESTDIR}/${MANDIR}/man1
71- install -m 0644 mkfs.jffs2.1 ${DESTDIR}/${MANDIR}/man1/
72- -gzip -9f ${DESTDIR}/${MANDIR}/man1/*.1
73
74 tests::
75 $(MAKE) -C $(TESTS)
76@@ -91,8 +71,6 @@ LDLIBS_mkfs.jffs2 = -lz $(LZOLDLIBS)
77 LDFLAGS_jffs2reader = $(ZLIBLDFLAGS) $(LZOLDFLAGS)
78 LDLIBS_jffs2reader = -lz $(LZOLDLIBS)
79
80-$(foreach v,$(MTD_BINS),$(eval $(call mkdep,,$(v))))
81-
82 #
83 # Common libmtd
84 #
85--
862.7.4
87