From 94a3d5a0b5591ef065f86912948a79cf8b007b13 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Sun, 8 Apr 2012 23:09:14 +0200 Subject: Automatically regenerate files that depend on $(hurd-version). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Follow-up to 05f5cc229323a61799388fbb52da84ca8cb502c9 (»configure: Use modern `AC_INIT' invocation.«). * Makeconf (%: %.sh): Depend on config.make. * Makefile (version.h): Use a stamp file. (stamp-version): Depend on config.make. * doc/Makefile (stamp-version): Likewise. * Makeconf (make-deps): Take additional target-specific dependencies, $*-DEPS. * console-client/Makefile (driver-DEPS): Depend on config.make. * libstore/Makefile (module-DEPS): Likewise. --- Makeconf | 7 +++---- Makefile | 11 +++++++---- console-client/Makefile | 1 + doc/Makefile | 7 ++----- libstore/Makefile | 1 + 5 files changed, 14 insertions(+), 13 deletions(-) diff --git a/Makeconf b/Makeconf index 8ff85241..538202cb 100644 --- a/Makeconf +++ b/Makeconf @@ -121,8 +121,7 @@ library_deps=$(foreach lib,$(HURDLIBS),$(..)lib$(lib)/lib$(lib).so) # Local programs: MKINSTALLDIRS = $(top_srcdir)/mkinstalldirs - - +move-if-change = $(SHELL) $(top_srcdir)/move-if-change # Decode makemode. # After this section, $(targets) and $(progtarg) will be defined, @@ -618,7 +617,7 @@ endif define make-deps set -e; $(CC) $(CFLAGS) $(CPPFLAGS) -M -MG $< | \ -sed > $@.new -e 's/$*\.o:/$*.o $*_pic.o $*_p.o $@:/' \ +sed > $@.new -e 's%$*\.o:%$*.o $*_pic.o $*_p.o $@: $($*-DEPS)%' \ -e 's% [^ ]*/gcc-lib/[^ ]*\.h%%g' mv -f $@.new $@ endef @@ -636,6 +635,6 @@ endef echo '$*.o: $<' > $@ # Rule to make executable shell scripts from .sh files. -%: %.sh +%: %.sh $(..)config.make sed -e 's/STANDARD_HURD_VERSION_\(.[^_]*\)_/\1 (GNU Hurd) $(hurd-version)/' < $< > $@ chmod +x $@ diff --git a/Makefile b/Makefile index e0ba0523..0ff35263 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ # # Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2004, -# 2006, 2009, 2011 Free Software Foundation, Inc. +# 2006, 2009, 2011, 2012 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as @@ -65,9 +65,12 @@ working-prog-subdirs := $(filter-out \ $(subdirs): version.h -version.h: version.h.in - sed -e 's/MASTER_HURD_VERSION/\"$(hurd-version)\"/' < $< > $@ - +version.h: stamp-version; @: +stamp-version: version.h.in config.make + sed -e 's/MASTER_HURD_VERSION/\"$(hurd-version)\"/' \ + < $< > version.h.new + $(move-if-change) version.h.new version.h + touch $@ ## GNU Coding Standards targets (not all are here yet), and some other ## similar sorts of things diff --git a/console-client/Makefile b/console-client/Makefile index 22a492a9..995c2d4a 100644 --- a/console-client/Makefile +++ b/console-client/Makefile @@ -50,6 +50,7 @@ include ../Makeconf driver-CPPFLAGS = -D'CONSOLE_DEFPATH="$(module-dir)\0"' \ -D'CONSOLE_SONAME_SUFFIX=".so.$(hurd-version)"' +driver-DEPS = $(..)config.make console: $(CONSOLE_SRCS:.c=.o) \ ../libnetfs/libnetfs.a ../libfshelp/libfshelp.a \ diff --git a/doc/Makefile b/doc/Makefile index 0c00976c..449b90eb 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -1,5 +1,4 @@ -# -# Copyright (C) 1994, 1998, 1999, 2003 Free Software Foundation +# Copyright (C) 1994, 1998, 1999, 2003, 2012 Free Software Foundation # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as @@ -48,10 +47,8 @@ include ../Makeconf %.ps: %.dvi $(DVIPS) $< -o $@ -move-if-change = $(SHELL) $(top_srcdir)/move-if-change - version.texi: stamp-version; @: -stamp-version: $(top_srcdir)/Makeconf +stamp-version: $(..)config.make echo '@set VERSION $(hurd-version)' > version.texi.new $(move-if-change) version.texi.new version.texi touch $@ diff --git a/libstore/Makefile b/libstore/Makefile index 56c1fdfd..2fb3c70d 100644 --- a/libstore/Makefile +++ b/libstore/Makefile @@ -66,6 +66,7 @@ vpath %.c $(srcdir)/../exec CPPFLAGS += -I$(srcdir)/../exec module-CPPFLAGS = -D'STORE_SONAME_SUFFIX=".so.$(hurd-version)"' +module-DEPS = $(..)config.make libstore_gunzip.so.$(hurd-version): $(GUNZIP_OBJS:.o=_pic.o) libstore_bunzip2.so.$(hurd-version): $(BUNZIP2_OBJS:.o=_pic.o) -- cgit v1.2.3