1 Star 1 Fork 380

Zz_er/workflow

forked from 搜狗开源/workflow 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
GNUmakefile 1.55 KB
一键复制 编辑 原始数据 按行查看 历史
wzlsuccess 提交于 2021-06-22 23:03 . update cmake file
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
ALL_TARGETS := all base check install preinstall clean tutorial
MAKE_FILE := Makefile
DEFAULT_BUILD_DIR := build
BUILD_DIR := $(shell if [ -f $(MAKE_FILE) ]; then echo "."; else echo $(DEFAULT_BUILD_DIR); fi)
CMAKE3 := $(shell if which cmake3>/dev/null ; then echo cmake3; else echo cmake; fi;)
KAFKA ?= n
MYSQL ?= y
REDIS ?= y
UPSTREAM ?= y
.PHONY: $(ALL_TARGETS)
all: base
make -C $(BUILD_DIR) -f Makefile
base:
mkdir -p $(BUILD_DIR)
ifeq ($(DEBUG),y)
cd $(BUILD_DIR) && $(CMAKE3) -D CMAKE_BUILD_TYPE=Debug -D KAFKA=$(KAFKA) -D MYSQL=$(MYSQL) -D REDIS=$(REDIS) -D UPSTREAM=$(UPSTREAM) $(ROOT_DIR)
else ifneq ("${INSTALL_PREFIX}install_prefix", "install_prefix")
cd $(BUILD_DIR) && $(CMAKE3) -DCMAKE_INSTALL_PREFIX:STRING=${INSTALL_PREFIX} -D KAFKA=$(KAFKA) -D MYSQL=$(MYSQL) -D REDIS=$(REDIS) -D UPSTREAM=$(UPSTREAM) $(ROOT_DIR)
else
cd $(BUILD_DIR) && $(CMAKE3) -D KAFKA=$(KAFKA) -D MYSQL=$(MYSQL) -D REDIS=$(REDIS) -D UPSTREAM=$(UPSTREAM) $(ROOT_DIR)
endif
tutorial: all
make -C tutorial
check: all
make -C test check
install preinstall: base
mkdir -p $(BUILD_DIR)
cd $(BUILD_DIR) && $(CMAKE3) $(ROOT_DIR)
make -C $(BUILD_DIR) -f Makefile $@
clean:
ifeq (build, $(wildcard build))
-make -C build clean
endif
-make -C test clean
-make -C tutorial clean
rm -rf $(DEFAULT_BUILD_DIR)
rm -rf _include
rm -rf _lib
find . -name CMakeCache.txt | xargs rm -f
find . -name Makefile | xargs rm -f
find . -name "*.cmake" | xargs rm -f
find . -name CMakeFiles | xargs rm -rf
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/zz_er/workflow.git
git@gitee.com:zz_er/workflow.git
zz_er
workflow
workflow
master

搜索帮助