On Thu, 2011-08-04 at 14:08 +0100, John D Lamb wrote:
On Thu, 2011-08-04 at 09:27 +0200, Roger Oberholtzer wrote:
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.
I should have thought of that. Look at pattern rules for make. I think you’ll need to redefine the pattern rule in the make file. For example the implicit rule for compiling C files is
%.o : %.c $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@
If you write a suitable pattern rule for your needs (with $(RM) instead of rm) and put it in the makefile then Make should use the environment variable for RM.
OK. I listed the rules with -p. I see 'rm' in these places: # default RM = rm -f %.out: % # commands to execute (built-in): @rm -f $@ cp $< $@ As well as this: # This program built for i686-pc-linux-gnu rm a.o c.o c.o This final one is the first thing make -p lists. I have no such rule. Mysterious. I think there is a rule not shown with the -p option.
-- JDL
Yours sincerely, Roger Oberholtzer OPQ Systems / Ramböll RST Office: Int +46 10-615 60 20 Mobile: Int +46 70-815 1696 roger.oberholtzer@ramboll.se ________________________________________ Ramböll Sverige AB Krukmakargatan 21 P.O. Box 17009 SE-104 62 Stockholm, Sweden www.rambollrst.se -- To unsubscribe, e-mail: opensuse-programming+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-programming+help@opensuse.org