代码拉取完成,页面将自动刷新
ifneq ($(BUILD),debug)
BUILD = release
endif
CXX = c++
LD = c++
CXXFLAGS += \
-Wall \
-pedantic \
-std=c++17 \
-fexceptions \
-fopenmp \
$(shell pkg-config --cflags opencv4)
LDFLAGS += \
-lopencv_core \
-lopencv_video \
-lopencv_videoio \
-lgomp \
-lpthread \
-fopenmp
ifeq ($(BUILD),debug)
OUT_DIR = bin/Debug/
OBJ_DIR = obj/Debug/src
CXXFLAGS += -g
else
OUT_DIR = bin/Release/
OBJ_DIR = obj/Release/src
CXXFLAGS += -O3
LDFLAGS += -O3 -s
endif
SOURCE := $(wildcard src/*.cpp src/*.h)
CXXSOURCE := $(filter %.cpp, $(SOURCE))
HEADERS := $(filter %.h, $(SOURCE))
OBJS := $(subst src/,$(OBJ_DIR)/, $(CXXSOURCE:.cpp=.o))
all: debug release
before_debug:
test -d bin/Debug || mkdir -p bin/Debug
test -d obj/Debug/src || mkdir -p obj/Debug/src
before_release:
test -d bin/Release || mkdir -p bin/Release
test -d obj/Release/src || mkdir -p obj/Release/src
.PHONY : release debug
debug: before_debug
@$(MAKE) --no-print-directory bin/Debug/biosim4 BUILD=$@
release: before_release
@$(MAKE) --no-print-directory bin/Release/biosim4 BUILD=$@
$(OUT_DIR)biosim4: $(OBJS)
$(LD) -o $@ $^ $(LDFLAGS)
$(OBJS): $(HEADERS)
$(OBJ_DIR)%.o : src%.cpp
$(CXX) $(CXXFLAGS) -c $< -o $@
clean: clean_debug clean_release
clean_debug:
$(RM) -f obj/Debug/src/*
$(RM) -f bin/Debug/biosim4
clean_release:
$(RM) -f obj/Release/src/*
$(RM) -f bin/Release/biosim4
distclean: clean
$(RM) -f logs/* images/*
.PHONY: all clean distclean
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。