[Top][All Lists]

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

Re: Problem using -R in MAKEFLAGS

From: John Graham-Cumming
Subject: Re: Problem using -R in MAKEFLAGS
Date: Mon, 06 Nov 2006 17:59:15 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040208 Thunderbird/0.5 Mnenhy/

Colm Aengus Murphy wrote:
I tried using ".SUFFIXES:".
Its a lot better but it still doesn't stop all of the built in rules.

For the simple makefile:
.SUFFIXES: %.exe : %.c
   gcc -o $(@F) $<

I still get:
 Considering target file `helloworld.c'.
  Looking for an implicit rule for `helloworld.c'.

Right. .SUFFIXES: only kills off the old-style suffix rules, and not the pattern rules. Hence there are some (quite a few actually, that are still in effect). If you want to kill the pattern rules then you have three choices:

1. Specify -r on the command-line
2. Set -r in MAKEFLAGS in the environment before make is run
3. Kill them off one by one in the Makefile.

To do #3 for your example, you need to kill off the following:

%.c: %.w
%:: RCS/%,v
%:: RCS/%
%:: SCCS/s.%
%:: %,v
%:: s.%

Just writing those lines above in your Makefile will be enough. You can use make -p to print out a list of the rules that are in effect if you need to kill others.

John Graham-Cumming


GNU Make Standard Library:
GNU Make Debugger:
Fast, Parallel Builds:

Sign up for my Spam and Anti-spam Newsletter

Help out in the fight against spam

reply via email to

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