Re: [PATCH] build: use automake's new $(AM_V_GEN) and $(AM_V_at) variables
Ralf Wildenhues wrote: Hi Jim, Jim Meyering writes: --- a/src/Makefile.am +++ b/src/Makefile.am @@ -290,26 +290,29 @@ editpl = sed -e 's,@''PERL''@,$(PERL),g' BUILT_SOURCES += dircolors.h dircolors.h: dcgen dircolors.hin -@rm -f $@ $...@-t -$(PERL) -w -- $(srcdir)/dcgen $(srcdir)/dircolors.hin $...@-t -@chmod a-w $...@-t -mv $...@-t $@ +$(AM_V_GEN) +$(AM_V_at)rm -f $@ $...@-t +$(AM_V_at)$(PERL) -w -- $(srcdir)/dcgen $(srcdir)/dircolors.hin $...@-t +$(AM_V_at)chmod a-w $...@-t +$(AM_V_at)mv $...@-t $@ Thanks for using these. Note the $(AM_V_GEN) will expand to the empty string with V=1 or --disable-silent-rules. I am actually not sure whether any make implementation fails hard upon empty rule commands, but a couple of them will output a warning, such as FreeBSD: $(AM_V_GEN) expands to empty string and AIX: make: 1254-053 Command $(AM_V_GEN) expands to empty string. You might want to just prepend the $(AM_V_GEN) to the next command, without anything in-between. We might want to document this better in automake.texi. Hi Ralf, How about making AM_V_GEN expand to :; rather than the empty string? That would seem slightly more symmetric. Fewer pitfalls for users, too. ___ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils
Re: [PATCH] build: use automake's new $(AM_V_GEN) and $(AM_V_at) variables
Hi Jim, * Jim Meyering wrote on Sat, Apr 25, 2009 at 08:04:36AM CEST: Ralf Wildenhues wrote: Jim Meyering writes: + $(AM_V_GEN) + $(AM_V_at)rm -f $@ $...@-t Thanks for using these. Note the $(AM_V_GEN) will expand to the empty string with V=1 or --disable-silent-rules. I am actually not sure whether any make implementation fails hard upon empty rule commands, but a couple of them will output a warning, such as FreeBSD: How about making AM_V_GEN expand to :; rather than the empty string? That would seem slightly more symmetric. Fewer pitfalls for users, too. Yes, I'm still considering that as an alternative. There are two minor draw-backs of using :; over the empty string: - the verbose output from 'make' will contain the :;, and users might wonder about that; on a more aesthetic note (but still quite able to turn a pretty bikeshed color into an ugly one), this makes the verbose output from packages using 'silent-rules' differ ever so slightly more from the output from packages not using the 'silent-rules' option in the first place. - GNU make has this minor optimization that, when a rule doesn't contain any characters special to the shell, then it can go ahead and exec the command directly, rather than going through another forkexec with sh -c command ... The :; would prevent this optimization. Thanks! Ralf ___ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils
[PATCH] build: use automake's new $(AM_V_GEN) and $(AM_V_at) variables
With the change below, the default build output for generated files in src/ is slightly more succinct: $ cd src make GEN wheel.h GEN wheel-size.h GEN version.h GEN version.c GEN fs.h make all-am make[1]: Entering directory `/h/meyering/w/co/coreutils/src' CC version.o CC uname.o CC hostid.o ... From 207daac5c1e9b22348d65439281f4da6dce9bdb2 Mon Sep 17 00:00:00 2001 From: Jim Meyering meyer...@redhat.com Date: Fri, 24 Apr 2009 15:16:46 +0200 Subject: [PATCH] build: use automake's new $(AM_V_GEN) and $(AM_V_at) variables * src/Makefile.am (dircolors.h, wheel-size.h, wheel.h, fs.h): (version.c, version.h): Mark with $(AM_V_GEN) and $(AM_V_at), so that the latest automake prints GEN $@ by default. --- src/Makefile.am | 56 ++ 1 files changed, 31 insertions(+), 25 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index a266d7b..1997573 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -290,26 +290,29 @@ editpl = sed -e 's,@''PERL''@,$(PERL),g' BUILT_SOURCES += dircolors.h dircolors.h: dcgen dircolors.hin - @rm -f $@ $...@-t - $(PERL) -w -- $(srcdir)/dcgen $(srcdir)/dircolors.hin $...@-t - @chmod a-w $...@-t - mv $...@-t $@ + $(AM_V_GEN) + $(AM_V_at)rm -f $@ $...@-t + $(AM_V_at)$(PERL) -w -- $(srcdir)/dcgen $(srcdir)/dircolors.hin $...@-t + $(AM_V_at)chmod a-w $...@-t + $(AM_V_at)mv $...@-t $@ wheel_size = 5 BUILT_SOURCES += wheel-size.h wheel-size.h: Makefile.am - @rm -f $@ $...@-t - echo '#define WHEEL_SIZE $(wheel_size)' $...@-t - @chmod a-w $...@-t - mv $...@-t $@ + $(AM_V_GEN) + $(AM_V_at)rm -f $@ $...@-t + $(AM_V_at)echo '#define WHEEL_SIZE $(wheel_size)' $...@-t + $(AM_V_at)chmod a-w $...@-t + $(AM_V_at)mv $...@-t $@ BUILT_SOURCES += wheel.h wheel.h: wheel-gen.pl Makefile.am - @rm -f $@ $...@-t - $(srcdir)/wheel-gen.pl $(wheel_size) $...@-t - @chmod a-w $...@-t - mv $...@-t $@ + $(AM_V_GEN) + $(AM_V_at)rm -f $@ $...@-t + $(AM_V_at)$(srcdir)/wheel-gen.pl $(wheel_size) $...@-t + $(AM_V_at)chmod a-w $...@-t + $(AM_V_at)mv $...@-t $@ # false exits nonzero even with --help or --version. # test doesn't support --help or --version. @@ -318,25 +321,28 @@ AM_INSTALLCHECK_STD_OPTIONS_EXEMPT = false test BUILT_SOURCES += fs.h fs.h: stat.c extract-magic - rm -f $@ - $(PERL) $(srcdir)/extract-magic $(srcdir)/stat.c $...@t - @chmod a-w $...@t - mv $...@t $@ + $(AM_V_GEN) + $(AM_V_at)rm -f $@ + $(AM_V_at)$(PERL) $(srcdir)/extract-magic $(srcdir)/stat.c $...@t + $(AM_V_at)chmod a-w $...@t + $(AM_V_at)mv $...@t $@ BUILT_SOURCES += version.c version.c: Makefile - rm -f $@ - printf '#include config.h\n' $...@t - printf 'char const *Version = $(PACKAGE_VERSION);\n' $...@t - @chmod a-w $...@t - mv $...@t $@ + $(AM_V_GEN) + $(AM_V_at)rm -f $@ + $(AM_V_at)printf '#include config.h\n' $...@t + $(AM_V_at)printf 'char const *Version = $(PACKAGE_VERSION);\n' $...@t + $(AM_V_at)chmod a-w $...@t + $(AM_V_at)mv $...@t $@ BUILT_SOURCES += version.h version.h: Makefile - rm -f $@ - printf 'extern char const *Version;\n' $...@t - @chmod a-w $...@t - mv $...@t $@ + $(AM_V_GEN) + $(AM_V_at)rm -f $@ + $(AM_V_at)printf 'extern char const *Version;\n' $...@t + $(AM_V_at)chmod a-w $...@t + $(AM_V_at)mv $...@t $@ DISTCLEANFILES = version.c version.h MAINTAINERCLEANFILES = $(BUILT_SOURCES) -- 1.6.3.rc1.223.g2f326 ___ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils
Re: [PATCH] build: use automake's new $(AM_V_GEN) and $(AM_V_at) variables
Hi Jim, Jim Meyering writes: --- a/src/Makefile.am +++ b/src/Makefile.am @@ -290,26 +290,29 @@ editpl = sed -e 's,@''PERL''@,$(PERL),g' BUILT_SOURCES += dircolors.h dircolors.h: dcgen dircolors.hin - @rm -f $@ $...@-t - $(PERL) -w -- $(srcdir)/dcgen $(srcdir)/dircolors.hin $...@-t - @chmod a-w $...@-t - mv $...@-t $@ + $(AM_V_GEN) + $(AM_V_at)rm -f $@ $...@-t + $(AM_V_at)$(PERL) -w -- $(srcdir)/dcgen $(srcdir)/dircolors.hin $...@-t + $(AM_V_at)chmod a-w $...@-t + $(AM_V_at)mv $...@-t $@ Thanks for using these. Note the $(AM_V_GEN) will expand to the empty string with V=1 or --disable-silent-rules. I am actually not sure whether any make implementation fails hard upon empty rule commands, but a couple of them will output a warning, such as FreeBSD: $(AM_V_GEN) expands to empty string and AIX: make: 1254-053 Command $(AM_V_GEN) expands to empty string. You might want to just prepend the $(AM_V_GEN) to the next command, without anything in-between. We might want to document this better in automake.texi. Thanks! Ralf ___ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils