On Thu, Sep 30 2010, Olly Betts wrote: > 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 tried using bith versions of the script.
/tmp/make-first-existing-target: Joey's latest script
/tmp/make-first-existing-target-1: Olly's script using -q
These work""
--8<---------------cut here---------------start------------->8---
/tmp/make-first-existing-target clean distclean -- -f debian/rules
/tmp/make-first-existing-target-1 clean distclean -- -f debian/rules
/tmp/make-first-existing-target foo clean -- -f debian/rules
--8<---------------cut here---------------end--------------->8---
This correctly runs clean.
The following fails, however it does produce a listing of
available targets:
--8<---------------cut here---------------start------------->8---
/tmp/make-first-existing-target-1 foo clean -- -f debian/rules
dh foo --parallel --with autoreconf
dh: Unknown sequence foo (choose from: binary binary-arch binary-indep build
build-arch build-indep clean install install-arch install-indep)
debian/rules:9: recipe for target 'foo' failed
make: *** [foo] Error 255
[1] 28568 exit 2 /tmp/make-first-existing-target-1 foo clean -- -f
debian/rules
--8<---------------cut here---------------end--------------->8---
Comments?
manoj
--
Politicians should read science fiction, not westerns and detective
stories. Arthur C. Clarke
Manoj Srivastava <[email protected]> <http://www.golden-gryphon.com/>
4096R/C5779A1C E37E 5EC5 2A01 DA25 AD20 05B6 CF48 9438 C577 9A1C
signature.asc
Description: PGP signature

