From 5bd808a6591d299489a6e7af6a4c00ae40410e35 Mon Sep 17 00:00:00 2001 Message-Id: <5bd808a6591d299489a6e7af6a4c00ae40410e35.1715137422.git.mdw@distorted.org.uk> From: Mark Wooding Date: Fri, 7 Jun 2013 22:03:40 +0100 Subject: [PATCH] build: Don't make libraries for precomputation utilities on demand. Organization: Straylight/Edgeware From: Mark Wooding If `make' is in parallel mode, it will fire off multiple simultaneous builds of the same library, and they interfere with each other. Instead, just arrange that the libraries are made when we try to distribute things. --- Makefile.am | 6 ++++++ hash/Makefile.am | 2 -- vars.am | 7 ------- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/Makefile.am b/Makefile.am index 5b393f7..101d533 100644 --- a/Makefile.am +++ b/Makefile.am @@ -107,6 +107,12 @@ SUBDIRS += t ###-------------------------------------------------------------------------- ### Distribution. +## Make sure the precomputed tables are available. Hang this off of any +## distributed file. +mLib.pc.in: ensure-precomp-libs +ensure-precomp-libs: + for d in ui utils; do (cd $$d && $(MAKE) all) || exit 1; done + ## Release number. dist-hook:: echo $(VERSION) >$(distdir)/RELEASE diff --git a/hash/Makefile.am b/hash/Makefile.am index 938b605..fa829e0 100644 --- a/hash/Makefile.am +++ b/hash/Makefile.am @@ -48,7 +48,6 @@ PRECOMPS += $(precomp)/crc32-tab.c if !CROSS_COMPILING $(precomp)/crc32-tab.c: @$(mkdir_p) $(precomp) - @$(build_util_libs) @$(MAKE) crc-mktab$(EXEEXT) $(AM_V_GEN)./crc-mktab -o $@.new \ -p0x04c11db7 -b32 -B8 -r -c \ @@ -80,7 +79,6 @@ PRECOMPS += $(precomp)/unihash-global.c if !CROSS_COMPILING $(precomp)/unihash-global.c: @$(mkdir_p) $(precomp) - @$(build_util_libs) @$(MAKE) unihash-mkstatic$(EXEEXT) $(AM_V_GEN)./unihash-mkstatic -c -sunihash_global -iunihash.h \ -o$@.new && mv $@.new $@ diff --git a/vars.am b/vars.am index 2450f28..33f5495 100644 --- a/vars.am +++ b/vars.am @@ -83,13 +83,6 @@ UTIL_LIBS = \ $(top_builddir)/ui/libui.la \ $(top_builddir)/utils/libutils.la -## Making sure they're built properly. Without this, `make dist' on a bare -## source tree fails hopelessly. -build_util_libs = \ - for i in ui utils; do \ - (cd $(top_builddir)/$$i && $(MAKE) lib$$i.la) || exit 1; \ - done - ###-------------------------------------------------------------------------- ### Testing. -- [mdw]