help-make
[Top][All Lists]
Advanced

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

removing implicit 'rm'


From: ron . peterson
Subject: removing implicit 'rm'
Date: Fri, 16 Jul 2004 22:23:37 -0400
User-agent: Mutt/1.3.28i

I've have a makefile like so:

%.o: %.cxx
    $(CXX) $(CXXFLAGS) $(MYINCLUDES) $*.cxx -c -o $@

%: %.o
    $(CXX) $(CXXFLAGS) $^ $(PQLIB)/libpqxx.a $(MYLIBS) -o $@

The values of the variables aren't so important.  I use this makefile
like so:

make test004

...which expands to:

521$ make test004
/usr/bin/g++ -Wall -O2 -I/local/apps/postgresql/include 
-I/local/apps/libpqxx/include test004.cxx -c -o test004.o
/usr/bin/g++ -Wall -O2 test004.o /local/apps/libpqxx/lib/libpqxx.a 
-L/local/apps/postgresql/lib -lpq -o test004
rm test004.o

My question is, where does the 'rm' command come from?  If I make the
object file by itself, it stays put; and if I subsequently make my
executable target, a pre-existing .o file stays put.  But if my object
file rule is called by my executable target rule, an 'rm' is added.

So, where did this 'rm' come from, and can I stop this behaviour?

522$ make --version
GNU Make 3.80

TIA

-- 
Ron Peterson                   -o)
87 Taylor Street               /\\
Granby, MA  01033             _\_v
https://www.yellowbank.com/   ---- 




reply via email to

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