On 2009-06-05 19:08Z, Erik Rull wrote:
CXXNONOPTIMIZED = -O0
CXXOPTIMIZED = -O3
library: optimized nonoptimized
optimized: file1.o file2.o # these should be compiled with CXXOPTIMIZED
nonoptimized: file3.o file4.o # these should be compiled with CXXNONOPTIMIZED
Use target-specific variable values, e.g.:
optimized := file1.o file2.o
nonoptimized := file3.o file4.o
$(optimized) : optimization_flag := -O3
$(nonoptimized): optimization_flag := -O0
%.o: %.cpp
$(CXX) -c $(optimization_flag) $(CXXFLAGS) $< -o$@