Debian Bug report logs - #598534
add make-first-existing-target

version graph

Package: make; Maintainer for make is Manoj Srivastava <srivasta@debian.org>; Source for make is src:make-dfsg.

Reported by: Joey Hess <joeyh@debian.org>

Date: Wed, 29 Sep 2010 19:15:01 UTC

Severity: wishlist

Found in version make-dfsg/3.81-8

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, kilobyte@angband.pl, Manoj Srivastava <srivasta@debian.org>:
Bug#598534; Package make. (Wed, 29 Sep 2010 19:15:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Joey Hess <joeyh@debian.org>:
New Bug report received and forwarded. Copy sent to kilobyte@angband.pl, Manoj Srivastava <srivasta@debian.org>. (Wed, 29 Sep 2010 19:15:04 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Joey Hess <joeyh@debian.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: add make-first-existing-target
Date: Wed, 29 Sep 2010 15:13:22 -0400
[Message part 1 (text/plain, inline)]
Package: make
Version: 3.81-8
Severity: wishlist

Please add the attached make-first-existing-target script to Debian's
make package. (pod2man will generate a man page.) This script provides
an interface for running one of several possibly existing targets in a
Makefile. Its DESCRIPTION block discusses why this is generally a hard
thing to do reliably.

Adam Borowski thought of the general technique of observing make's
output when running a nonexistant target, and comparing it with the output
when running possibly existing targets.
http://lists.debian.org/debian-devel/2010/09/msg00602.html
I have refined that, and made it also work with eg, dh tiny rules files
with implicit pattern rules.

As I discuss here, debhelper uses a not-too-robust make -n trick to
guess which of a set of targets (like "build", "all", etc) exists.
http://lists.debian.org/debian-devel/2010/09/msg00649.html
In order to support optional targets in debian/rules like build-arch,
dpkg-buildpackage should be able to run build-arch with a fallback to
build. So that's two use cases, and the interface of
make-first-existing-target will support both.

I think it belongs in make's package because there is potential to
add hooks to make that let it be implemented in cleaner ways. Also of
course, it's slightly tied to the current implementation of make.

-- 
see shy jo
[make-first-existing-target (text/plain, attachment)]
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Manoj Srivastava <srivasta@debian.org>:
Bug#598534; Package make. (Wed, 29 Sep 2010 19:33:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Joey Hess <joeyh@debian.org>:
Extra info received and forwarded to list. Copy sent to Manoj Srivastava <srivasta@debian.org>. (Wed, 29 Sep 2010 19:33:03 GMT) Full text and rfc822 format available.

Message #10 received at 598534@bugs.debian.org (full text, mbox):

From: Joey Hess <joeyh@debian.org>
To: 598534@bugs.debian.org
Subject: updated version with -c swtich
Date: Wed, 29 Sep 2010 15:32:00 -0400
[Message part 1 (text/plain, inline)]
-- 
see shy jo
[make-first-existing-target (text/plain, attachment)]

Information forwarded to debian-bugs-dist@lists.debian.org, Manoj Srivastava <srivasta@debian.org>:
Bug#598534; Package make. (Thu, 30 Sep 2010 03:48:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Olly Betts <olly@survex.com>:
Extra info received and forwarded to list. Copy sent to Manoj Srivastava <srivasta@debian.org>. (Thu, 30 Sep 2010 03:48:03 GMT) Full text and rfc822 format available.

Message #15 received at 598534@bugs.debian.org (full text, mbox):

From: Olly Betts <olly@survex.com>
To: 598534@bugs.debian.org
Subject: alternative approach
Date: Thu, 30 Sep 2010 16:14:48 +1300
[Message part 1 (text/plain, inline)]
You can use "make -q" to probe targets less intrusively.  This also works
for a makefile with default rule like this one:

%:
	echo $@

This matches the dummy target the other approach uses, so it doesn't work.

Using '-q' also seems less brittle than trying to pattern match output.

I've attached an updated version of the script which uses this approach,
though the description needs updating to match.

Hope this is useful.

Cheers,
    Olly
[make-first-existing-target (text/plain, attachment)]
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Manoj Srivastava <srivasta@debian.org>:
Bug#598534; Package make. (Tue, 15 Feb 2011 01:12:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jonathan Nieder <jrnieder@gmail.com>:
Extra info received and forwarded to list. Copy sent to Manoj Srivastava <srivasta@debian.org>. (Tue, 15 Feb 2011 01:12:03 GMT) Full text and rfc822 format available.

Message #20 received at 598534@bugs.debian.org (full text, mbox):

From: Jonathan Nieder <jrnieder@gmail.com>
To: 598534@bugs.debian.org
Cc: Joey Hess <joeyh@debian.org>
Subject: Re: add make-first-existing-target
Date: Mon, 14 Feb 2011 19:09:55 -0600
Hi Manoj,

Joey Hess wrote:

> Please add the attached make-first-existing-target script to Debian's
> make package. (pod2man will generate a man page.) This script provides
> an interface for running one of several possibly existing targets in a
> Makefile. Its DESCRIPTION block discusses why this is generally a hard
> thing to do reliably.

Ping?  Any thoughts on this suggestion?  Would you like help with
"make" maintenance?

Jonathan




Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Wed Apr 23 11:21:17 2014; Machine Name: buxtehude.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.