-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
45 lines (34 loc) · 1.21 KB
/
Copy pathMakefile
File metadata and controls
45 lines (34 loc) · 1.21 KB
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
BIN_DIR=bin
CMD_DIR=cmd
SERVER_BINARY=ghost-server
SERVER_DIR=$(CMD_DIR)/${SERVER_BINARY}
SERVER_SOURCES=$(shell find $(SERVER_DIR) -name '*.go')
SERVER_BINARY_OUTPUT=${BIN_DIR}/${SERVER_BINARY}
CLI_BINARY=ghost-cli
CLI_DIR=$(CMD_DIR)/${CLI_BINARY}
CLI_SOURCES=$(shell find $(CLI_DIR) -name '*.go')
CLI_BINARY_OUTPUT=${BIN_DIR}/${CLI_BINARY}
BENCH_BINARY=ghost-benchmark
BENCH_DIR=$(CMD_DIR)/${BENCH_BINARY}
BENCH_SOURCES=$(shell find $(BENCH_DIR) -name '*.go')
BENCH_BINARY_OUTPUT=${BIN_DIR}/${BENCH_BINARY}
ghost-server: $(SERVER_SOURCES)
go build -o ${SERVER_BINARY_OUTPUT} ${SERVER_SOURCES}
ghost-cli: $(CLI_SOURCES)
go build -o ${CLI_BINARY_OUTPUT} ${CLI_SOURCES}
ghost-benchmark: $(BENCH_SOURCES)
go build -o ${BENCH_BINARY_OUTPUT} ${BENCH_SOURCES}
all: ghost-server ghost-benchmark ghost-cli
.PHONY: install
install:
go install ./cmd/ghost-benchmark
go install ./cmd/ghost-cli
go install ./cmd/ghost-server
.PHONY: clean
clean:
if [ -f ${SERVER_BINARY_OUTPUT} ] ; then rm ${SERVER_BINARY_OUTPUT} ; fi
if [ -f ${BENCH_BINARY_OUTPUT} ] ; then rm ${BENCH_BINARY_OUTPUT} ; fi
if [ -f ${CLI_BINARY_OUTPUT} ] ; then rm ${CLI_BINARY_OUTPUT} ; fi
.PHONY: run-benchmark
run-benchmark:
go test ./ghost -bench=. -benchmem