makefile多核编译

INCS += -I ./CPP/include/ -I .
FILE += $(wildcard  *.cpp)
FILE += $(wildcard  GenICamA/*.cpp)
FILE += $(wildcard  CLProtocolA/*.cpp)
FILE += $(wildcard  GenCPA/*.cpp)
FILE += $(wildcard  TinyXml/*.cpp)

OBJS = $(patsubst %.cpp, %.o, $(FILE))

CXXFLAGS += -DNDEBUG -DHAVE_CONFIG_H -D__linux__ -D_GENCP_ALPHA_SUPPORTED_ -fthreadsafe-statics -fexceptions -frtti -std=c++14

CXX = g++

target = libVK.so

all: $(OBJS)

$(OBJS): %.o:%.cpp
        $(CXX) -c -fpic $^ $(INCS) $(CXXFLAGS) -o $@

lib:
        $(CXX) -shared $(OBJS) -o $(target)

.PHONY:clean
clean:
        @-rm $(OBJS)
        @-rm $(target)
make -j
make lib
posted @ 2023-01-10 16:07  thomas_blog  阅读(199)  评论(0编辑  收藏  举报