forked from satori-com/mzbench
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
44 lines (35 loc) · 1015 Bytes
/
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
REBAR := $(abspath $(shell which ../../bin/rebar3 || which rebar3))
SOURCES := src/http_worker.erl src/http_worker.app.src
.PHONY: compile
compile: .make/compilation-up-to-date
.PHONY: generate_tgz
generate_tgz: pkgroot
mkdir -p pkgroot
rsync -aW pkgroot/ pkgroot
cd pkgroot && tar czf ../http_worker.tgz ./${PKG_NAME} && cd ..
rm -rf pkgroot
.make/compilation-up-to-date: $(SOURCES) rebar.config
$(REBAR) compile
mkdir -p .make && touch $@
.PHONY: clean
clean:
rm -f *.tgz
rm -rf pkgroot
rm -rf pkgroot
rm -rf .make
$(REBAR) clean
.PHONY: check
check:
cd test && ./main.py
.PHONY: check-local
check-local:
cd test && ./main.py --local
PKG_NAME = http_worker
.PHONY: pkgroot
pkgroot: .make/compilation-up-to-date
rm -rf pkgroot
mkdir -p pkgroot/${PKG_NAME}/ebin
mkdir pkgroot/${PKG_NAME}/deps
cp _build/default/deps/*/ebin/* pkgroot/${PKG_NAME}/ebin/
if [ -d "examples" ]; then cp -Rf examples pkgroot/${PKG_NAME}; fi
if [ -d "resources" ]; then cp -Rf resources pkgroot/${PKG_NAME}; fi