forked from Qiware/search
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
87 lines (74 loc) · 2.06 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
###############################################################################
## Copyright(C) 2014-2024 Qiware technology Co., Ltd
##
## 功 能: 遍历编译目录,并执行指定的操作
## 1. 编译操作
## 2. 删除操作
## 3. 重新编译
## 注意事项:
## 1. 当需要增加编译目录时, 请将目录加入变量DIR中, 不用修改该文件其他数据!
## 2. 如果只想编译指定目录的代码, 则可执行命令:
## Make DIR=指定目录 如: Make DIR=src/lib/core
## 作 者: # Qifeng.zou # 2014.08.28 #
###############################################################################
include ./make/func.mak
export VERSION=v0.1 # 版本号
# 根目录
export PROJ = ${PWD}
export PROJ_3RD = ${PROJ}/3rd
export PROJ_BIN = ${PROJ}/bin
export PROJ_LIB = ${PROJ}/lib
export PROJ_LOG = ${PROJ}/log
export PROJ_CONF = ${PROJ}/conf
export GCC_LOG = ${PROJ_LOG}/gcc.log
# 编译目录(注:编译按顺序执行 注意库之间的依赖关系)
LIB_DIR = "src/lib"
DIR = "$(PROJ_3RD)/crypt"
DIR += "$(LIB_DIR)/core"
DIR += "$(LIB_DIR)/rtmq"
DIR += "$(LIB_DIR)/sdtp"
DIR += "$(LIB_DIR)/gumbo"
DIR += "$(LIB_DIR)/redis"
DIR += "$(LIB_DIR)/agent"
DIR += "$(LIB_DIR)/invert"
EXEC_DIR = "src/exec"
DIR += "$(EXEC_DIR)/frwder"
DIR += "$(EXEC_DIR)/mmexec"
DIR += "$(EXEC_DIR)/crawler"
DIR += "$(EXEC_DIR)/filter"
DIR += "$(EXEC_DIR)/logsvr"
DIR += "$(EXEC_DIR)/listend"
DIR += "$(EXEC_DIR)/monitor"
DIR += "$(EXEC_DIR)/invertd"
DEMO_DIR = "src/demo"
#DIR += "$(DEMO_DIR)/rtmq"
# 获取系统配置
CPU_CORES = $(call func_cpu_cores)
.PHONY: all clean rebuild help
# 1. 编译操作
all:
$(call func_mkdir)
@for ITEM in ${DIR}; \
do \
if [ -e $${ITEM}/Makefile ]; then \
cd $${ITEM}; \
#make -j$(CPU_CORES) 2>&1 | tee -a ${GCC_LOG}; \
make -j$(CPU_CORES) 2>&1 || exit; \
cd ${PROJ}; \
fi \
done
# 2. 清除操作
clean:
@for ITEM in ${DIR}; \
do \
if [ -e $${ITEM}/Makefile ]; then \
cd $${ITEM}; \
make clean; \
cd ${PROJ}; \
fi \
done
# 3. 重新编译
rebuild: clean all
# 4. 显示帮助
help:
@cat make/help.mak