Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 1 | From 1c989e4c36d0bf76ab444f984bc73b98eeacd03f Mon Sep 17 00:00:00 2001 |
| 2 | From: Andrea Adami <andrea.adami@gmail.com> |
| 3 | Date: Sun, 29 Jun 2014 00:32:29 +0200 |
| 4 | Subject: [PATCH 1/9] Makefile: build ubi-utils only |
| 5 | |
| 6 | We build all the static ubi-utils but actually only ubiattach is needed in |
| 7 | a minimalistic initramfs for the mount of ubi volumes. |
| 8 | |
| 9 | More fixes are needed in order to build the full mtd-utils. |
| 10 | The first issue is: |
| 11 | |
| 12 | | mkfs.jffs2.c:64:20: fatal error: libgen.h: No such file or directory |
| 13 | | #include <libgen.h> |
| 14 | |
| 15 | Removing 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 | |
| 21 | Upstream-Status: Inappropriate [embedded specific] |
| 22 | |
| 23 | Signed-off-by: Andrea Adami <andrea.adami@gmail.com> |
| 24 | --- |
| 25 | Makefile | 26 ++------------------------ |
| 26 | 1 file changed, 2 insertions(+), 24 deletions(-) |
| 27 | |
| 28 | diff --git a/Makefile b/Makefile |
| 29 | index 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 | -- |
| 86 | 2.7.4 |
| 87 | |