About g++ option -MM

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

 



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 of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux