g+
g+ Communities
Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014 
<== Date ==> <== Thread ==>

Subject: ECHO variable in build rules
From: Benjamin Franksen <benjamin.franksen@helmholtz-berlin.de>
To: <tech-talk@aps.anl.gov>
Date: Fri, 27 Apr 2012 15:19:42 +0200
Hi All

CONFIG_COMMON currently contains this snippet:

#-------------------------------------------------------
# Make echo output - suppress echoing if make's '-s' flag is set
COMMENT = \#
ECHO = @$(if $(findstring s,$(patsubst T_A=%,,$(MAKEFLAGS))),
$(COMMENT),echo)

(for win32 COMMENT gets overridden as COMMENT = $(PERL) -e '')

This is a bit dangerous, as it breaks rules that use ';', e.g.

	$(ECHO) Creating foo; ../create-foo.sh > foo

The comment will disable the whole command line, not only the echo command.

This broke one of our self-written build rules and took me and a colleague 
almost a whole day to debug.

There is an alternative: The colon (':') can be used as NOP (ignore all 
arguments) in all unix shells (including at least dash, bash, and zsh).

So I propose to replace COMMENT with NOP, defining

NOP = ":"
ECHO = @$(if $(findstring s,$(patsubst T_A=%,,$(MAKEFLAGS))),$(NOP),echo)

and on win32 systems

NOP = $(PERL) -e ''

The extra definition for ECHO in RULES.Db is not necessary and should be 
removed.

Cheers
Ben

Attachment: signature.asc
Description: This is a digitally signed message part.


Replies:
Re: ECHO variable in build rules Andrew Johnson

Navigate by Date:
Prev: Problem installing EDM on Fedora 16 manta santosh aditya santosh_aditya
Next: Re: [StreamDevice] need advice Pavel Masloff
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014 
Navigate by Thread:
Prev: Problem installing EDM on Fedora 16 manta santosh aditya santosh_aditya
Next: Re: ECHO variable in build rules Andrew Johnson
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014 
ANJ, 18 Nov 2013 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· EPICSv4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·