From 118a549cc82f07b4c8b13aeebd866d2912ff3f1b Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Fri, 7 Jun 2013 22:03:09 +0100 Subject: [PATCH] General build system spring-cleaning. Most of this comes from the shiny new build system for Catacomb. --- Makefile.am | 2 +- hash/Makefile.am | 4 ++-- vars.am | 40 ++++++++++++++++++++++++++++++++-------- 3 files changed, 35 insertions(+), 11 deletions(-) diff --git a/Makefile.am b/Makefile.am index 101d533..5a11eb7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 $@ diff --git a/hash/Makefile.am b/hash/Makefile.am index fa829e0..07fa219 100644 --- a/hash/Makefile.am +++ b/hash/Makefile.am @@ -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 --- a/vars.am +++ b/vars.am @@ -25,22 +25,44 @@ ### 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. -- 2.11.0