|
Home > Archive > Unix Programming > September 2007 > disable makefile error messages
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
disable makefile error messages
|
|
| andyhaupt@netscape.net 2007-09-24, 7:23 pm |
| Hello,
consider this simple makefile:
bar:
@if test -d /tmp ; then echo yes; exit 1; fi
make bar displays
yes
*** Error code 1
The following command caused the error:
if test -d /tmp ; then echo yes; exit 1; fi
make: Fatal error: Command failed for target `bar'
I only want to see the printed 'yes' and the standard make error msg
should be disabled somehow.
Is this possible and how?
The output is from 'make' on Solaris 10 ,
gnu make shows just one line gmake: *** [bar] Error 1
but the issue remains: is it possible to skip that msg?
rgds
andy
| |
| Ben Bacarisse 2007-09-24, 7:23 pm |
| andyhaupt@netscape.net writes:
> consider this simple makefile:
>
> bar:
> @if test -d /tmp ; then echo yes; exit 1; fi
>
>
> make bar displays
>
> yes
> *** Error code 1
> The following command caused the error:
> if test -d /tmp ; then echo yes; exit 1; fi
> make: Fatal error: Command failed for target `bar'
>
> I only want to see the printed 'yes' and the standard make error msg
> should be disabled somehow.
> Is this possible and how?
Err.. How about not making the command fail?
--
Ben.
| |
| andyhaupt@netscape.net 2007-09-25, 7:31 am |
| My example is of course a simplified one to show the issue in as few
lines as possible.
Imagine this bigger scenario:
make install should install the code in some dir.
I want to check whether the dir exists (and is writable by me) or if
not I will create it.
Checks for writability or mkdir might fail.
In case of failure I want to put out an error msg of my own (that
would be the 'yes' in the example)
and stop any further execution, I don't want to see any additional
info from make itself.
If there is no way to disable it I might go for gnu make since one
line of make output
is easier to digest than the verbose Solaris 10 lines.
rgds
andy
On 25 Sep., 02:11, Ben Bacarisse <ben.use...@bsb.me.uk> wrote:
> andyha...@netscape.net writes:
>
>
>
>
>
> Err.. How about not making the command fail?
>
> --
> Ben.
| |
| Ivan Gotovchits 2007-09-25, 1:26 pm |
| andyhaupt@netscape.net wrote:
> The following command caused the error:
> if test -d /tmp ; then echo yes; exit 1; fi
> make: Fatal error: Command failed for target `bar'
try to
exec 3>/dev/null
--
s/.../.gotovchits/g for email.
| |
| Ben Bacarisse 2007-09-25, 1:26 pm |
| andyhaupt@netscape.net writes:
> On 25 Sep., 02:11, Ben Bacarisse <ben.use...@bsb.me.uk> wrote:
>
> My example is of course a simplified one to show the issue in as few
> lines as possible.
>
> Imagine this bigger scenario:
> make install should install the code in some dir.
> I want to check whether the dir exists (and is writable by me) or if
> not I will create it.
> Checks for writability or mkdir might fail.
Ah, I see. Sorry, I know of no way to stop the messages. You can
ignore errors, of course (by several mechanisms), but that is not what
you want.
BTW, most technical groups prefer trimmed and interleaved replies to
"top post, full quote".
--
Ben.
|
|
|
|
|