This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]