On Wed, Feb 27, 2002 at 01:48:37PM +0530, Sandip Bhattacharya wrote:
| On Wed, Feb 27, 2002 at 06:25:46AM -0000, Venkata  Subramanian spoke out thus:
| > Actually, I want to run diff command depending on the status of 
| > cmp, i-e only if the exit status is 1, indicating a difference in 
| > the files.
| If you are sure that cmp won't generate an error( return value > 1) then
| you can use 
|    $(TOOL) file1,file2 || diff file1 file2 > file1-file2.diff
| Also, please see that the path to the "override" program (especially
| if it is in the current directory) is completely specified.

override is a (g)make keyword. Lookup 'info gmake'. It's used to
override the variables. For eg, to force CFLAGS to take -ggdb for the
Makefile, I can do the following:

CFLAGS=-ggdb make

Even if makefile initializes CFLAGS to something else, it would use the
value which I'm passing on the command line.

But if I want the Makefile to ignore all the command line passed values,
then I use override keyword. A simple example of Makefile using override
is the following:

<snip>
override CFLAGS = -g

all:
        @echo $(CFLAGS)

</snip>

I don't think it's possible to use override keyword as part of the
commands that are executed for a target. For eg, along with echo, in the
above example. To achieve what you're doing, probably, you can use a
if [ $? = 0 ]; then .. construct.

chyrag.
-- 
Chirag Kantharia, symonds.net/~chyrag/
Linux scrooge 2.4.17 #1 Wed Jan 16 17:07:25 IST 2002 i686 unknown

          ================================================
To subscribe, send email to [EMAIL PROTECTED] with subscribe in subject header
To unsubscribe, send email to [EMAIL PROTECTED] with unsubscribe in subject header
Archives are available at http://www.mail-archive.com/ilugd%40wpaa.org
          =================================================

Reply via email to