[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 05/22] maint: improve remake rules for maintainers
From: |
Stefano Lattarini |
Subject: |
[PATCH 05/22] maint: improve remake rules for maintainers |
Date: |
Sat, 1 Sep 2012 01:46:42 +0200 |
This is a follow up on today's former commit "build: refactor
how lists of coreutils programs are defined".
* Makefile.am ($(top_srcdir)/m4/cu-progs.m4,
$(srcdir)/src/cu-progs.mk): New, generate these files from the
'build-aux/gen-lists-of-programs.sh', the same way it's done
from the bootstrap script.
* bootstrap.conf (bootstrap_post_import_hook): Add comment about
the necessity to keep those new rules synced with the commands
here. Enhance those commands so to that the generated files are
set read-only.
---
Makefile.am | 15 +++++++++++++++
bootstrap.conf | 10 +++++++---
2 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 6a56f68..2d5fdaa 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -55,6 +55,21 @@ EXTRA_DIST = \
maint.mk \
thanks-gen
+gen_progs_lists = $(top_srcdir)/build-aux/gen-lists-of-programs.sh
+
+# Keep these in sync with bootstrap.conf:bootstrap_post_import_hook().
+# Use '$(top_srcdir)/m4' and '$(srcdir)/src' for the benefit of non-GNU
+# makes: it is with those directories that 'cu-progs.m4' and 'cu-progs.mk'
+# appear in our dependencies.
+$(top_srcdir)/m4/cu-progs.m4: $(gen_progs_lists)
+ $(AM_V_GEN)rm -f $@ $@-t \
+ && $(SHELL) $(gen_progs_lists) --autoconf >$@-t \
+ && chmod a-w $@-t && mv -f $@-t $@
+$(srcdir)/src/cu-progs.mk: $(gen_progs_lists)
+ $(AM_V_GEN)rm -f $@ $@-t \
+ && $(SHELL) $(gen_progs_lists) --automake >$@-t \
+ && chmod a-w $@-t && mv -f $@-t $@
+
ALL_RECURSIVE_TARGETS += install-root
install-root:
cd src && $(MAKE) $@
diff --git a/bootstrap.conf b/bootstrap.conf
index 4ef3fc8..dc0ffb6 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -329,9 +329,13 @@ bootstrap_post_import_hook ()
# Automake requires that ChangeLog exist.
touch ChangeLog || return 1
# List of coreutils programs. See heading comments in the invoked
- # script for more info.
- build-aux/gen-lists-of-programs.sh --autoconf >m4/cu-progs.m4 || return 1
- build-aux/gen-lists-of-programs.sh --automake >src/cu-progs.mk || return 1
+ # script for more info. Keep this in sync with the rules in
+ (m4f=m4/cu-progs.m4 mkf=src/cu-progs.mk tmp=cu-progs.tmp \
+ && rm -f $m4f $mkf $tmp-1 $tmp-2 \
+ && build-aux/gen-lists-of-programs.sh --autoconf >$tmp-1 \
+ && build-aux/gen-lists-of-programs.sh --automake >$tmp-2 \
+ && chmod a-w $tmp-1 $tmp-2 \
+ && mv -f $tmp-1 $m4f && mv -f $tmp-2 $mkf)
}
bootstrap_epilogue()
--
1.7.12
- [PATCH 00/22] Patches to avoid use of make recursion in the 'src/' subdir, Stefano Lattarini, 2012/08/31
- [PATCH 01/22] maint: add our 'bootstrap_post_import_hook' function, Stefano Lattarini, 2012/08/31
- [PATCH 02/22] build: refactor how lists of coreutils programs are defined, Stefano Lattarini, 2012/08/31
- [PATCH 04/22] build: fix generation of manpages for programs not built by default, Stefano Lattarini, 2012/08/31
- [PATCH 05/22] maint: improve remake rules for maintainers,
Stefano Lattarini <=
- [PATCH 06/22] maint: remove unused target 'install-root', Stefano Lattarini, 2012/08/31
- [PATCH 07/22] maint: fix and simplify maintainer checks, Stefano Lattarini, 2012/08/31
- [PATCH 09/22] maint: update gitignore entries, Stefano Lattarini, 2012/08/31
- [PATCH 08/22] maint: fix one stray reference to src/Makefile.am, Stefano Lattarini, 2012/08/31
- [PATCH 03/22] build: don't use recursive make to build the 'src' subdirectory, Stefano Lattarini, 2012/08/31
- [PATCH 10/22] build: simplify: get rid of some indirection variables, Stefano Lattarini, 2012/08/31
- [PATCH 12/22] build: one less unneeded make variable, Stefano Lattarini, 2012/08/31
- [PATCH 11/22] build: simplify and make more portable to non-GNU make, Stefano Lattarini, 2012/08/31
- [PATCH 13/22] build: rename dist_man1_MANS -> man1_MANS, Stefano Lattarini, 2012/08/31
- [PATCH 14/22] build: simplify: get rid of yet some more indirection variables, Stefano Lattarini, 2012/08/31