make and qcc

bridged with qnx.development_tools
Post Reply
Mario Charest

make and qcc

Post by Mario Charest » Wed Jul 12, 2006 8:57 pm

With Watcom under QNX4 a *.err file is created if the compiler detects some
error/warning.

I'm trying to find a simple solution, within a makefile and haven't been
able to find anything that doesn't look like a kludge.

Any hint?

Chris Herborth

Re: make and qcc

Post by Chris Herborth » Thu Jul 13, 2006 6:36 pm

Mario Charest wrote:
With Watcom under QNX4 a *.err file is created if the compiler detects some
error/warning.

I'm trying to find a simple solution, within a makefile and haven't been
able to find anything that doesn't look like a kludge.

Any hint?
Something like this in your Makefile?

..c.o:
qcc $CFLAGS $< -o $@ 2> $<.err
if [ ! -s $<.err ] ; then \
rm -f $<.err ; \
else \
echo Compile errors in $<: ; \
cat $<.err ; \
fi

Assuming I've got the $< and $@ right, that'll build the file and
redirect error output to filename.err... if the .err file is empty,
it'll be deleted.

--
Chris Herborth (cherborth@qnx.com) - Senior Zombiologist and Tech Writer
Never send a monster to do the work of an evil scientist.
Monthly QNX newsletter - http://www.qnx.com/news/forms/newsletter.html

Post Reply

Return to “qnx.development_tools”