Peng Yu
2006-01-26 02:10:39 UTC
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
-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