This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
About g++ option -MM
- From: Peng Yu <pengyu dot ut at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Wed, 25 Jan 2006 20:10:39 -0600
- Subject: About g++ option -MM
Suppose I have a file "main.cc", if I run the following command "g++
-MM main.cc, I end up with following rule "main.o: main.cc main.h".
What if I want something like the following contents? Basically, what
I want are two sets of objects code. One is with compiler option "-g",
the other is with option "-O3".
Is it possible to do it in g++, or I have to do some scripting like using perl.
####################
main-g.o: main.cc main.h
$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -g -c -o $@ $<
main-o.o: main.cc main.h
$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -O3 -c -o $@ $<
####################
Thanks,
Peng