List Info

Thread: GNU Make: Add something to CXXFLAGS when invoking make




GNU Make: Add something to CXXFLAGS when invoking make
user name
2006-11-17 19:17:48
Eric Lilja wrote:
> Hello, can you do what the topic says?
> I tried:
> hivemindmindcooler
> ~/jobb/example_programs/overloaded_comparison_operators
> $ make CXXFLAGS+='-DFRIEND
> but instead of adding -DFRIEND to CXXFLAGS, it replaced
it...the
> Makefile itself is:
> CXX =g++
> CXXFLAGS = -Wall -Wextra -std=c++98 -pedantic -g -c
> LDFLAGS = -o $(EXEC)
> EXEC = overloaded_comparison_operators.exe
> OBJECTS = overloaded_comparison_operators.o
>
> all: $(OBJECTS)
> 	$(CXX) $^ $(LDFLAGS)
>
> overloaded_comparison_operators.o:
overloaded_comparison_operators.cpp
> 	$(CXX) $(CXXFLAGS) $<
>
> clean:
> 	rm -f $(OBJECTS) $(EXEC) *~ *.stackdump
>
> I'm trying to avoid writing several Makefiles or having
to specify the
> other CXXFLAGS on the command line other than the
defines I want at the
> moment.
>
> / E

CXXFLAGS = -Wall -Wextra -std=c++98 -pedantic -g -c
$(EXTRA_CXXFLAGS)

make EXTRA_CXXFLAGS=-DFRIEND

James

_______________________________________________
help-gnu-utils mailing list
help-gnu-utilsgnu.org

http://lists.gnu.org/mailman/listinfo/help-gnu-utils
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )