help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is there something grep like in make besides the findstringfunction?


From: Randy Kao
Subject: Re: Is there something grep like in make besides the findstringfunction?
Date: Wed, 20 Jun 2007 16:57:11 -0700

Good points Brian. Thanks for the feedback.

I will definitely go your suggested route.

Thanks again.
-Randy

On 6/20/07, Brian Dessent < address@hidden> wrote:
Randy Kao wrote:

> bash: doxygen: command not found
>
> or
>
> sh: doxygen: command not found
>
> Is there any easier way of accomplishing my end goal?

Searching for an error string is always a bad idea.  What if the user
has their locale set to display errors in German?  You'd go crazy trying
to search for all the different ways of saying "command not found" in
every shell and every language.

It's not necessary either as the shell gives you a status value when a
command fails to execute a command, which you can test e.g.

foo := $(shell doxygen --version >/dev/null 2>&1 && echo "yes")

...will result in foo being "yes" if the command was successful
otherwise blank.  If you want yes/no then you can do something like:

foo := $(shell if cmd; then echo yes; else echo no; fi)

Brian


reply via email to

[Prev in Thread] Current Thread [Next in Thread]