向静态lib编译添加标志

时间:2014-08-20 09:14:42

标签: c++ makefile

美好的一天!让我说我有一个编译静态库的makefile。

CC = g++





SOURCES  =  $(wildcard way_to_src/src/*.cpp)
INCLUDES = -Iway_to Incl
OBJECTS  = $(SOURCES:.cpp=.o)

CFLAGS += $(INCLUDES)


TARGET_STATIC    =    libmy_.a




clean:
    rm -f $(OBJECTS) $(TARGET_SO) $(TARGET_STATIC) 

static :  $(OBJECTS)
    ar rcs $(TARGET_STATIC) $(OBJECTS) 

如何添加' -fpermissive'标志编译?

1 个答案:

答案 0 :(得分:0)

设置CXXFLAGS

CXXFLAGS=-fpermissive

同样CFLAGS += $(INCLUDES)也应定位CXXFLAGS

CXXFLAGS += -fpermissive $(INCLUDES)