General build system spring-cleaning.
authorMark Wooding <mdw@distorted.org.uk>
Fri, 7 Jun 2013 21:03:09 +0000 (22:03 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Fri, 28 Jun 2013 22:59:00 +0000 (23:59 +0100)
Most of this comes from the shiny new build system for Catacomb.

Makefile.am
hash/Makefile.am
vars.am

index 101d533..5a11eb7 100644 (file)
@@ -45,7 +45,7 @@ EXTRA_DIST            += mLib.pc.in
 CLEANFILES             += mLib.pc
 
 mLib.pc: mLib.pc.in Makefile
-       $(AM_V_GEN)$(confsubst) $(srcdir)/mLib.pc.in >$@.new \
+       $(SUBST) $(srcdir)/mLib.pc.in >$@.new \
                $(SUBSTITUTIONS) && \
                mv $@.new $@
 
index fa829e0..07fa219 100644 (file)
@@ -48,7 +48,7 @@ PRECOMPS              += $(precomp)/crc32-tab.c
 if !CROSS_COMPILING
 $(precomp)/crc32-tab.c:
        @$(mkdir_p) $(precomp)
-       @$(MAKE) crc-mktab$(EXEEXT)
+       @$(MAKE) crc-mktab$e
        $(AM_V_GEN)./crc-mktab -o $@.new \
                -p0x04c11db7 -b32 -B8 -r -c \
                -scrc32_table -icrc32.h -tuint32 && \
@@ -79,7 +79,7 @@ PRECOMPS              += $(precomp)/unihash-global.c
 if !CROSS_COMPILING
 $(precomp)/unihash-global.c:
        @$(mkdir_p) $(precomp)
-       @$(MAKE) unihash-mkstatic$(EXEEXT)
+       @$(MAKE) unihash-mkstatic$e
        $(AM_V_GEN)./unihash-mkstatic -c -sunihash_global -iunihash.h \
                -o$@.new && mv $@.new $@
 endif
diff --git a/vars.am b/vars.am
index 33f5495..8d34b68 100644 (file)
--- a/vars.am
+++ b/vars.am
 ### MA 02111-1307, USA.
 
 ###--------------------------------------------------------------------------
-### Installation directories.
+### Miscellaneous useful definitions.
+
+## Some convenient abbreviations for file suffixes.
+e                       = $(EXEEXT)
+o                       = $(OBJEXT)
+t                       = t$e
 
+## Installation directories.
 pkglibexecdir           = $(libexecdir)/$(PACKAGE)
 
 ###--------------------------------------------------------------------------
 ### Initial values for common variables.
 
+EXTRA_DIST              =
+CLEANFILES              =
+DISTCLEANFILES          =
+MAINTAINERCLEANFILES    =
+BUILT_SOURCES           =
+
 bin_PROGRAMS            =
 check_PROGRAMS          =
 pkginclude_HEADERS      =
-PRECOMPS                =
+
 PROGMANS                =
 LIBMANS                         =
-EXTRA_DIST              = $(PRECOMPS) $(LIBMANS) $(PROGMANS)
-CLEANFILES              =
-MAINTAINERCLEANFILES    = $(PRECOMPS)
+EXTRA_DIST             += $(PROGMANS) $(LIBMANS)
+
+###--------------------------------------------------------------------------
+### Machinery for precomputations.
+
+## Location of precomputed tables.
+precomp                         = $(top_srcdir)/precomp
+
+## Precomputed source code files.
+PRECOMPS                =
+EXTRA_DIST             += $(PRECOMPS)
+BUILT_SOURCES          += $(PRECOMPS)
+MAINTAINERCLEANFILES   += $(PRECOMPS)
 
 ###--------------------------------------------------------------------------
 ### Include path.
@@ -61,7 +83,7 @@ MLIB_INCLUDES          = \
 AM_CPPFLAGS             = $(MLIB_INCLUDES)
 
 ###--------------------------------------------------------------------------
-### Miscellaneous useful definitions.
+### Standard configuration substitutions.
 
 ## Substitute tags in files.
 confsubst               = $(top_srcdir)/config/confsubst
@@ -72,8 +94,10 @@ SUBSTITUTIONS = \
        bindir=$(bindir) sbindir=$(sbindir) \
        PACKAGE=$(PACKAGE) VERSION=$(VERSION)
 
-## Location of precomputed tables.
-precomp                        = $(top_srcdir)/precomp
+V_SUBST = $(V_SUBST_$(V))
+V_SUBST_ = $(V_SUBST_$(AM_DEFAULT_VERBOSITY))
+V_SUBST_0 = @echo "  SUBST  $@";
+SUBST = $(V_SUBST)$(confsubst)
 
 ###--------------------------------------------------------------------------
 ### Building utilities.