-
Notifications
You must be signed in to change notification settings - Fork 523
/
Makefile
132 lines (99 loc) · 2.76 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# Copyright (C) 2021 Jingli Chen (Wine93), NetEase Inc.
.PHONY: list build dep ci-list ci-build ci-dep install image playground check test docker format
stor?=""
prefix?= "$(PWD)/projects"
release?= 0
dep?= 0
only?= "*"
tag?= "curvebs:unknown"
case?= "*"
os?= "debian11"
ci?=0
define help_msg
## build curvebs
make build stor=bs dep=1
make dep stor=bs && make build stor=bs
## build curvefs
make build stor=fs dep=1
make dep stor=fs && make build stor=fs
## list
Usage:
make list stor=bs/fs
Examples:
make list stor=bs
## build
Usage:
make build stor=bs/fs only=TARGET1,...,TARGETx dep=0/1 release=0/1 os=OS
Examples:
make build stor=bs only=//src/chunkserver:chunkserver
make build stor=bs only=src/*,test/* dep=0
make build stor=fs only=test/* os=debian11
make build stor=fs release=1
Note:
Extra build options can be specified using BUILD_OPTS environment variable, which will be passed to bazel build command.
## dep
## configure dependency(before build)
Usage:
make dep stor=bs/fs
Examples:
make dep stor=bs
## ci-list/build/dep
## use the same way above, but in the container
## install
Usage:
make install stor=bs/fs prefix=PREFIX only=TARGET
Examples:
make install stor=bs prefix=/usr/local/curvebs only=*
make install stor=bs prefix=/usr/local/curvebs only=chunkserver
make install stor=fs prefix=/usr/local/curvefs only=etcd
## image
Usage:
make image stor=bs/fs tag=TAG os=OS
Examples:
make image stor=bs tag=opencurvedocker/curvebs:v1.2 os=debian11
## package
Usage:
make <tar|deb> release=0/1 dep=0/1 os=OS
Examples:
make deb
make tar release=1 dep=1 os=debian11
## playground
## create/run a container, changes outside will be mapped into the container
Usage/Example:
make playground
endef
export help_msg
help:
@echo "$$help_msg"
list:
@bash util/build.sh --stor=$(stor) --list
build:
@bash util/build.sh --stor=$(stor) --only=$(only) --dep=$(dep) --release=$(release) --ci=$(ci) --os=$(os)
dep:
@bash util/build.sh --stor=$(stor) --only="" --dep=1
ci-list:
@bash util/build_in_image.sh --stor=$(stor) --list
ci-build:
@bash util/build_in_image.sh --stor=$(stor) --only=$(only) --dep=$(dep) --release=$(release) --ci=$(ci) --os=$(os)
ci-dep:
@bash util/build_in_image.sh --stor=$(stor) --only="" --dep=1
install:
@bash util/install.sh --stor=$(stor) --prefix=$(prefix) --only=$(only)
image:
@bash util/image.sh $(stor) $(tag) $(os)
tar deb:
@RELEASE=$(release) DEP=$(dep) OS=$(os) bash util/package.sh $@
playground:
@bash util/playground.sh --version=$(version)
check:
@bash util/check.sh $(stor)
test:
@bash util/test.sh $(stor) $(only)
docker:
@bash util/docker.sh --os=$(os) --ci=$(ci)
init-hadoop:
@bash util/init-hadoop.sh
sdk:
@bash util/sdk.sh
clean:
@bash util/clean.sh