-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
67 lines (52 loc) · 1.35 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
PROJECT = moneta
ROOT_DIR = $(shell pwd)
REPO = $(shell git config --get remote.origin.url)
LFE = _build/default/lib/lfe/bin/lfe
DOCS_DIR = $(ROOT_DIR)/priv/mdbook
DOCS_BUILD_DIR = $(ROOT_DIR)/docs
LOCAL_DOCS_HOST = localhost
LOCAL_DOCS_PORT = 5099
FINISH=-run init stop -noshell
GET_VERSION = '{ok,[App]}=file:consult("src/$(PROJECT).app.src"), \
V=proplists:get_value(vsn,element(3,App)), \
io:format("~p~n",[V])' \
$(FINISH)
compile:
rebar3 compile
check:
@DEBUG=1 rebar3 as test eunit
repl: compile
@$(LFE)
shell:
@rebar3 shell
clean:
@rebar3 clean
@rm -rf ebin/* _build/default/lib/$(PROJECT)
clean-all: clean
@rebar3 as dev lfe clean
docs-clean:
@echo "\nCleaning build directories ..."
@rm -rf $(DOCS_BUILD_DIR)
docs: docs-clean
@echo "\nBuilding docs ...\n"
@cd $(DOCS_DIR) && mdbook build -d $(DOCS_BUILD_DIR)
@echo "\nURL: file://$(DOCS_BUILD_DIR)/index.html\n"
docs-open: docs-clean
@echo "\nBuilding docs ...\n"
@cd $(DOCS_DIR) && mdbook build -d $(DOCS_BUILD_DIR) -o
show-version:
@erl -eval $(GET_VERSION)
show-versions:
@export VERSION=$$(make show-version) && \
git grep -n $$VERSION
publish: docs
@echo "\nPublishing on hex.pm ...\n"
@./priv/scripts/publish.sh
.PHONY: docs
hex-publish:
@echo "\nPublishing to hex.pm ...\n"
rm -rf doc
mkdir doc
cp priv/html/docs-redirect.html doc/index.html
rebar3 hex publish
rm -rf doc