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: Greg Chicares
Subject: Re: Different Compiler Options within one Makefile
Date: Fri, 05 Jun 2009 19:31:48 +0000
User-agent: Thunderbird 2.0.0.21 (Windows/20090302)

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]