What is the best approach to use different CFLAGS for the same source files?
Posted
by evilsocket
on Stack Overflow
See other posts from Stack Overflow
or by evilsocket
Published on 2010-03-25T17:40:33Z
Indexed on
2010/03/25
17:43 UTC
Read the original article
Hit count: 231
Hello,
i need to build the same source tree twice,
1 - with normal cflags to build the project binary 2 - with cflags plus -fPIC to build a static library that would be some sort of SDK to develop project dynamic modules.
Using only one Makefile, what is the best approach to accomplish this?
It would be nice to do some sort of :
all: $(OBJECTS)
lib_rule: $(OBJECTS) CFLAGS += -fPIC
.cpp.o: $(CC) -c $< -o $@ $(CFLAGS)
But obviously it can't be done.
Thanks
© Stack Overflow or respective owner