forked from basho/basho_bench
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
104 lines (77 loc) · 2.81 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
REPO ?= basho_bench
PKG_REVISION ?= $(shell git describe --tags)
PKG_VERSION ?= $(shell git describe --tags | tr - .)
PKG_ID = basho-bench-$(PKG_VERSION)
PKG_BUILD = 1
BASE_DIR = $(shell pwd)
ERLANG_BIN = $(shell dirname $(shell which erl))
REBAR ?= $(BASE_DIR)/rebar
OVERLAY_VARS ?=
all: deps compile
$(REBAR) skip_deps=true escriptize
.PHONY: deps compile rel lock locked-all locked-deps
rel: deps compile
cd rel && $(REBAR) generate skip_deps=true $(OVERLAY_VARS)
deps:
$(REBAR) get-deps
##
## Lock Targets
##
## see https://github.com/seth/rebar_lock_deps_plugin
lock: deps compile
$(REBAR) lock-deps
locked-all: locked-deps compile
locked-deps:
@echo "Using rebar.config.lock file to fetch dependencies"
$(REBAR) -C rebar.config.lock get-deps
compile: deps
# Temp hack to work around https://github.com/basho/riak-erlang-client/issues/151
(cd deps/riak_pb ; $(REBAR) clean compile deps_dir=..)
@($(REBAR) compile)
clean:
@$(REBAR) clean
distclean: clean
@rm -rf basho_bench deps
results:
Rscript --vanilla priv/summary.r -i tests/current
ops_sec-results: results
byte_sec-results:
Rscript --vanilla priv/summary.r --ylabel1stgraph byte/sec -i tests/current
kb_sec-results:
Rscript --vanilla priv/summary.r --ylabel1stgraph KB/sec -i tests/current
kib_sec-results:
Rscript --vanilla priv/summary.r --ylabel1stgraph KiB/sec -i tests/current
mb_sec-results:
Rscript --vanilla priv/summary.r --ylabel1stgraph MB/sec -i tests/current
mib_sec-results:
Rscript --vanilla priv/summary.r --ylabel1stgraph MiB/sec -i tests/current
results-browser:
cp -R priv/results-browser/* tests/current && cd tests/current && python -c 'import os, json; print json.dumps(os.listdir("."))' > web/data.json && python ../../priv/results-browser.py
TARGETS := $(shell ls tests/ | grep -v current)
JOBS := $(addprefix job,${TARGETS})
.PHONY: all_results ${JOBS}
all_results: ${JOBS} ; echo "$@ successfully generated."
${JOBS}: job%: ; Rscript --vanilla priv/summary.r -i tests/$*
##
## Packaging targets
##
.PHONY: package
export PKG_VERSION PKG_ID PKG_BUILD BASE_DIR ERLANG_BIN REBAR OVERLAY_VARS RELEASE
package.src: deps
mkdir -p package
rm -rf package/$(PKG_ID)
git archive --format=tar --prefix=$(PKG_ID)/ $(PKG_REVISION)| (cd package && tar -xf -)
${MAKE} -C package/$(PKG_ID) locked-deps
for dep in package/$(PKG_ID)/deps/*; do \
echo "Processing dep: $${dep}"; \
mkdir -p $${dep}/priv; \
git --git-dir=$${dep}/.git describe --always --tags >$${dep}/priv/vsn.git; \
done
find package/$(PKG_ID) -depth -name ".git" -exec rm -rf {} \;
tar -C package -czf package/$(PKG_ID).tar.gz $(PKG_ID)
dist: package.src
cp package/$(PKG_ID).tar.gz .
package: package.src
${MAKE} -C package -f $(PKG_ID)/deps/node_package/Makefile
pkgclean: distclean
rm -rf package