help-make
[Top][All Lists]
Advanced

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

Re: Different Compiler Options within one Makefile


From: Erik Rull
Subject: Re: Different Compiler Options within one Makefile
Date: Sat, 06 Jun 2009 00:22:47 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.19) Gecko/20081204 SeaMonkey/1.1.14

Great thank you - works!

Greg Chicares wrote:
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$@





reply via email to

[Prev in Thread] Current Thread [Next in Thread]