[prev in list] [next in list] [prev in thread] [next in thread]
List: asterisk-dev
Subject: Re: [asterisk-dev] [Code Review]: Clean up Makefile "warning" clutter when makeopts doesn't exist
From: "Jason Parker" <reviewboard () asterisk ! org>
Date: 2013-01-30 17:56:00
Message-ID: 20130130175600.20707.96777 () hotblack ! digium ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
> On Jan. 30, 2013, 10:35 a.m., David Lee wrote:
> > What do you think about putting the defaults in build_tools/make_version itself? \
> > That would have the added bonus of making it easier to run the script from the \
> > command line.
>
> wdoekes wrote:
> That would only fix the make_version problem. The other $(shell ...) stuff would \
> still have issues.
> I can certainly add defaults to make_version *as* *well* if you like.
>
> Jason Parker wrote:
> The ASTERISKVERSION/ASTERISKVERSIONNUM case is easy enough - just create a \
> .tmpversion file and include it within the Makefile. If it doesn't exist, we don't \
> continue (it's not needed for most operations, and it would let us fail with a \
> useful error, rather than "Illegal option -").
> The slightly trickier case is the grep for documentation. It adds all .c files \
> that contain XML documentation, to the dependency list for the .xml files, so that \
> if any of those files change, the docs get regenerated. It seems like this could \
> be architected a little differently, and be avoided altogether.
Or for xmldocs, something like this perhaps?
-doc/core-en_US.xml: makeopts $(foreach dir,$(MOD_SUBDIRS),$(shell $(GREP) -l \
"language=\"en_US\"" $(dir)/*.c $(dir)/*.cc 2>/dev/null)) +ifneq ($(GREP),)
+XMLDOCFILES_en_US=$(foreach dir,$(MOD_SUBDIRS),$(shell $(GREP) -l \
"language=\"en_US\"" $(dir)/*.c $(dir)/*.cc 2>/dev/null)) +endif
+
+doc/core-en_US.xml: makeopts $(XMLDOCFILES_en_US)
- Jason
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2304/#review7774
-----------------------------------------------------------
On Jan. 30, 2013, 4:24 a.m., wdoekes wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/2304/
> -----------------------------------------------------------
>
> (Updated Jan. 30, 2013, 4:24 a.m.)
>
>
> Review request for Asterisk Developers and Jason Parker.
>
>
> Summary
> -------
>
> When there is no makeopts (distclean removes it), we get ugly errors when running \
> make.
> $ make
> build_tools/make_version: 183: URL: not found
> build_tools/make_version: 183: {print $2;}: not found
> svn: Write error: Broken pipe
> /bin/sh: Illegal option -
> /bin/sh: Illegal option -
> ...
> ****
> **** The configure script must be executed before running 'make'.
> **** Please run "./configure".
> ****
>
> Those ugly errors can be avoided in the majority of case by providing defaults for \
> AWK and GREP. That's what this patch does.
> This means that you can now run make distclean twice and get output without ugly \
> errors.
>
> P.S. @admins: https://reviewboard.asterisk.org/r/2303/ yields a Django error and is \
> uneditable because I accidentally called qwell "Jason Parker".
>
> Diffs
> -----
>
> /trunk/Makefile 380448
>
> Diff: https://reviewboard.asterisk.org/r/2304/diff
>
>
> Testing
> -------
>
> It works if awk en grep are in your path. If they aren't, the errors will at least \
> be more readable (missing grep instead of "Illegal option").
> AWK and GREP will still get overridden by makeopts if it exists, so no loss of \
> functionality there.
>
> Thanks,
>
> wdoekes
>
>
[Attachment #5 (text/html)]
<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 \
solid;"> <tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="https://reviewboard.asterisk.org/r/2304/">https://reviewboard.asterisk.org/r/2304/</a>
</td>
</tr>
</table>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;"> <p style="margin-top: 0;">On January 30th, 2013, 10:35 a.m., <b>David \
Lee</b> wrote:</p> <blockquote style="margin-left: 1em; border-left: 2px solid \
#d0d0d0; padding-left: 10px;"> <pre style="white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">What do you think about putting the defaults in build_tools/make_version \
itself? That would have the added bonus of making it easier to run the script from \
the command line.</pre> </blockquote>
<p>On January 30th, 2013, 10:41 a.m., <b>wdoekes</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;"> <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">That would only fix the \
make_version problem. The other $(shell ...) stuff would still have issues.
I can certainly add defaults to make_version *as* *well* if you like.</pre>
</blockquote>
<p>On January 30th, 2013, 10:48 a.m., <b>Jason Parker</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;"> <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">The \
ASTERISKVERSION/ASTERISKVERSIONNUM case is easy enough - just create a .tmpversion \
file and include it within the Makefile. If it doesn't exist, we don't \
continue (it's not needed for most operations, and it would let us fail with a \
useful error, rather than "Illegal option -").
The slightly trickier case is the grep for documentation. It adds all .c files that \
contain XML documentation, to the dependency list for the .xml files, so that if any \
of those files change, the docs get regenerated. It seems like this could be \
architected a little differently, and be avoided altogether.</pre> </blockquote>
</blockquote>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Or for xmldocs, \
something like this perhaps?
-doc/core-en_US.xml: makeopts $(foreach dir,$(MOD_SUBDIRS),$(shell $(GREP) -l \
"language=\"en_US\"" $(dir)/*.c $(dir)/*.cc 2>/dev/null)) \
+ifneq ($(GREP),) +XMLDOCFILES_en_US=$(foreach dir,$(MOD_SUBDIRS),$(shell $(GREP) -l \
"language=\"en_US\"" $(dir)/*.c $(dir)/*.cc 2>/dev/null)) \
+endif +
+doc/core-en_US.xml: makeopts $(XMLDOCFILES_en_US)</pre>
<br />
<p>- Jason</p>
<br />
<p>On January 30th, 2013, 4:24 a.m., wdoekes wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('https://reviewboard.asterisk.org/media/rb/images/review_request_box_top_bg.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px black \
solid;"> <tr>
<td>
<div>Review request for Asterisk Developers and Jason Parker.</div>
<div>By wdoekes.</div>
<p style="color: grey;"><i>Updated Jan. 30, 2013, 4:24 a.m.</i></p>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0"> <tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">When there is no makeopts (distclean removes it), we get ugly errors \
when running make.
$ make
build_tools/make_version: 183: URL: not found
build_tools/make_version: 183: {print $2;}: not found
svn: Write error: Broken pipe
/bin/sh: Illegal option -
/bin/sh: Illegal option -
...
****
**** The configure script must be executed before running 'make'.
**** Please run "./configure".
****
Those ugly errors can be avoided in the majority of case by providing defaults for \
AWK and GREP. That's what this patch does.
This means that you can now run make distclean twice and get output without ugly \
errors.
P.S. @admins: https://reviewboard.asterisk.org/r/2303/ yields a Django error and is \
uneditable because I accidentally called qwell "Jason Parker".</pre> </td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0"> <tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">It works if awk en grep are in your path. If they aren't, the errors \
will at least be more readable (missing grep instead of "Illegal option").
AWK and GREP will still get overridden by makeopts if it exists, so no loss of \
functionality there.</pre> </td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>/trunk/Makefile <span style="color: grey">(380448)</span></li>
</ul>
<p><a href="https://reviewboard.asterisk.org/r/2304/diff/" style="margin-left: \
3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>
--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-dev
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic