From 93df80d2409d6e7d97701ab745b937f8903c808f Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Sat, 28 Mar 2020 17:56:56 -0400 Subject: [PATCH] Teach makefiles to build all static programs using the target all-static Signed-off-by: Theodore Ts'o --- MCONFIG.in | 2 ++ Makefile.in | 10 ++++++++-- e2fsck/Makefile.in | 2 ++ misc/Makefile.in | 6 ++++++ po/Makefile.in.in | 2 ++ resize/Makefile.in | 2 ++ 6 files changed, 22 insertions(+), 2 deletions(-) diff --git a/MCONFIG.in b/MCONFIG.in index 6151825ac..0598f21b7 100644 --- a/MCONFIG.in +++ b/MCONFIG.in @@ -2,6 +2,8 @@ all:: +all-static:: + check:: fullcheck:: diff --git a/Makefile.in b/Makefile.in index b951c0174..bf8081e3c 100644 --- a/Makefile.in +++ b/Makefile.in @@ -36,6 +36,10 @@ all:: subs @ALL_CMT@ $(MAKE) progs @ALL_CMT@ $(MAKE) docs +all-static:: + $(MAKE) libs +@ALL_CMT@ $(MAKE) static-progs + subs: $(DEP_SUBSTITUTE) @for i in $(SUBS) ; do if test -d `dirname $$i` ; \ then $(MAKE) $$i || exit $$? ; fi ; done @@ -44,6 +48,7 @@ subs: $(DEP_SUBSTITUTE) @(if test -d lib/support ; then cd lib/support && $(MAKE) prof_err.h; fi) progs: all-progs-recursive +static-progs: all-static-progs-recursive libs: all-libs-recursive all-progs-recursive all-libs-recursive:: subs @@ -97,8 +102,9 @@ all-progs-recursive install-progs-recursive install-strip-progs-recursive \ uninstall-progs-recursive coverage.txt-progs-recursive:: all-libs-recursive -@ALL_CMT@all-progs-recursive install-progs-recursive install-strip-progs-recursive \ -@ALL_CMT@ uninstall-progs-recursive coverage.txt-progs-recursive:: all-libs-recursive +@ALL_CMT@all-progs-recursive all-static-progs-recursive install-progs-recursive \ +@ALL_CMT@ install-strip-progs-recursive uninstall-progs-recursive \ +@ALL_CMT@ coverage.txt-progs-recursive:: all-libs-recursive @ALL_CMT@ @for subdir in $(PROG_SUBDIRS); do \ @ALL_CMT@ if test -d $$subdir ; then \ @ALL_CMT@ target=`echo $@|$(SED) 's/-progs-recursive//'`; \ diff --git a/e2fsck/Makefile.in b/e2fsck/Makefile.in index 7ca20c86d..6e25d27d8 100644 --- a/e2fsck/Makefile.in +++ b/e2fsck/Makefile.in @@ -111,6 +111,8 @@ all:: profiled $(PROGS) e2fsck $(MANPAGES) $(FMANPAGES) @PROFILE_CMT@all:: e2fsck.profiled +all-static:: e2fsck.static + e2fsck: $(OBJS) $(DEPLIBS) $(E) " LD $@" $(Q) $(LD) $(ALL_LDFLAGS) $(RDYNAMIC) -o e2fsck $(OBJS) $(LIBS) diff --git a/misc/Makefile.in b/misc/Makefile.in index 9f2a8939d..fde01775c 100644 --- a/misc/Makefile.in +++ b/misc/Makefile.in @@ -18,13 +18,16 @@ INSTALL = @INSTALL@ @LINUX_CMT@E4CRYPT_MAN= e4crypt.8 @IMAGER_CMT@E2IMAGE_PROG= e2image +@IMAGER_CMT@E2IMAGE_STATIC= e2image.static @IMAGER_CMT@E2IMAGE_MAN= e2image.8 @UUIDD_CMT@UUIDD_PROG= uuidd +@UUIDD_CMT@UUIDD_STATIC= uuidd.static @UUIDD_CMT@UUIDD_MAN= uuidd.8 @UUIDD_CMT@UUIDD_PROFILED= uuidd.profiled @BLKID_CMT@BLKID_PROG= blkid +@BLKID_CMT@BLKID_STATIC= blkid.static @BLKID_CMT@BLKID_MAN= blkid.8 @BLKID_CMT@FINDFS_LINK= findfs @@ -135,6 +138,9 @@ DEPEND_CFLAGS = -I$(top_srcdir)/e2fsck all:: profiled $(SPROGS) $(UPROGS) $(USPROGS) $(SMANPAGES) $(UMANPAGES) \ $(FMANPAGES) $(LPROGS) $(E4DEFRAG_PROG) $(E4CRYPT_PROGS) e2fuzz +all-static:: $(E2IMAGE_STATIC) $(UUIDD_STATIC) $(BLKID_STATIC) \ + dumpe2fs.static mke2fs.static tune2fs.static + @PROFILE_CMT@all:: tune2fs.profiled blkid.profiled e2image.profiled \ e2undo.profiled mke2fs.profiled dumpe2fs.profiled fsck.profiled \ logsave.profiled filefrag.profiled uuidgen.profiled $(UUIDD_PROFILED) \ diff --git a/po/Makefile.in.in b/po/Makefile.in.in index 67e1f2f45..7ca6b7436 100644 --- a/po/Makefile.in.in +++ b/po/Makefile.in.in @@ -78,6 +78,8 @@ all: all-@USE_NLS@ all-yes: @MAINTAINER_CMT@stamp-po all-no: +all-static: +depend: # stamp-po is a timestamp denoting the last time at which the CATALOGS have # been loosely updated. Its purpose is that when a developer or translator diff --git a/resize/Makefile.in b/resize/Makefile.in index f7f836a20..546dff144 100644 --- a/resize/Makefile.in +++ b/resize/Makefile.in @@ -42,6 +42,8 @@ DEPSTATIC_LIBS= $(STATIC_LIBE2P) $(STATIC_LIBEXT2FS) $(DEPSTATIC_LIBCOM_ERR) all:: $(PROGS) $(TEST_PROGS) $(MANPAGES) +all:: resize2fs.static + resize2fs: $(RESIZE_OBJS) $(DEPLIBS) $(E) " LD $@" $(Q) $(CC) $(ALL_LDFLAGS) -o resize2fs $(RESIZE_OBJS) $(LIBS) -- 2.39.2