Mailinglist Archive: opensuse-programming (6 mails)

< Previous Next >
Re: [opensuse-programming] Redefining GNU make's implicit RM variable
  • From: Roger Oberholtzer <roger@xxxxxx>
  • Date: Thu, 04 Aug 2011 09:27:22 +0200
  • Message-id: <1312442842.30163.17.camel@acme.pacific>
On Thu, 2011-08-04 at 07:34 +0100, John D Lamb wrote:
On Wed, 2011-08-03 at 13:37 +0200, Roger Oberholtzer wrote:

All I am really trying to accomplish is to not have the make process
echo the rm command when it removes objects it make to satisfy some
rule. So, I want to define it as:

RM = @rm -f

I guess the built-in rule uses 'rm' instead of $(RM). At least it is
acting that way. Another odd thing is that the Gnu docs say the default
RM command is 'rm -f'. But I see 'rm' being used.

Am I looking in the wrong place to redefine RM?

No. You can redefine RM as an environmental variable and make will use
what it finds.

Check the makefile, especially if you did not write it by hand. Does it
use ${RM} to remove files? If not then changing RM will have no effect.
Makefiles created by configure scripts usually don’t use ${RM}.

It is a hand-made Makefile that I have made.

My Makefile does not call the RM. It is not supposed to. make has a
built-in rule to convert a bunch of .c files in to an executable. It
uses variables like CC, CFLAGS, LD, etc as part of this rule. You can
re-define CC if you would like, and make will use this as part of the
built-in procedure. It seems, however, that even though Gnu define RM as
the variable to remove files, RM is not in fact used by this built-in
series of steps to convert the .c files into an executable.

Is this as intended? How can I list these internal rules? Perhaps I need
to redefine it slightly so it does not use 'rm' direct, buy instead uses
the variable RM?

As a minimum, there should be a way to tell make not to echo these
built-in commands. That was what I was trying be defining RM to be a
command that started with '@'. To no avail.

Yours sincerely,

Roger Oberholtzer

OPQ Systems / Ramböll RST

Office: Int +46 10-615 60 20
Mobile: Int +46 70-815 1696

Ramböll Sverige AB
Krukmakargatan 21
P.O. Box 17009
SE-104 62 Stockholm, Sweden

To unsubscribe, e-mail: opensuse-programming+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-programming+help@xxxxxxxxxxxx

< Previous Next >
List Navigation
Follow Ups