build: Don't make libraries for precomputation utilities on demand.
authorMark Wooding <mdw@distorted.org.uk>
Fri, 7 Jun 2013 21:03:40 +0000 (22:03 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Fri, 21 Jun 2013 10:55:26 +0000 (11:55 +0100)
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
hash/Makefile.am
vars.am

index 5b393f7..101d533 100644 (file)
@@ -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
index 938b605..fa829e0 100644 (file)
@@ -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 (file)
--- 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.