From 9f842331032e375df28f871b9ba92b0a7f5fc326 Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Sat, 1 Sep 2012 01:46:42 +0200 Subject: [PATCH] maint: improve remake rules for maintainers This is a follow up on today's commit v8.19-60-g4f2e62b". * 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() -- 2.7.4