-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
48 lines (36 loc) · 1.4 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
PWD := $(shell pwd)
SCP := $(shell which scp)
SED := $(shell which sed)
ES := $(shell which escript)
VER := $(shell cat ./Version)
FS := [email protected]:~/path.in.home
.PHONY: proto codec compile shell test console-dev rel-dev rel-stage rel-prod
all: proto codec compile
proto:
$(PWD)/script/gpb -pkgs -I $(PWD)/proto -o-erl $(PWD)/src -o-hrl $(PWD)/include $(PWD)/proto/*.proto
codec:
$(ES) $(PWD)/script/codec.erl gaby $(PWD)/proto/ $(PWD)/src
compile:
$(PWD)/script/rebar3 compile
shell:
$(PWD)/script/rebar3 shell
test:
$(PWD)/script/rebar3 ct
console-dev:
_build/dev/rel/gaby/bin/gaby console
rel-prod:
$(SED) -i 's/{gaby, "gaby-version"}/{gaby, "$(VER)"}/g' ./rebar.config
$(PWD)/script/rebar3 as prod release
$(PWD)/script/rebar3 as prod tar
$(SED) -i 's/{gaby, "$(VER)"}/{gaby, "gaby-version"}/g' ./rebar.config
#$(SCP) -P 8522 $(PWD)/_build/prod/rel/gaby/gaby-$(VER).tar.gz $(FS)
@printf "\nApplication: %s\n" $(PWD)/_build/prod/rel/gaby/gaby-$(VER).tar.gz
rel-stage:
$(SED) -i 's/{gaby, "gaby-version"}/{gaby, "$(VER)"}/g' ./rebar.config
$(PWD)/script/rebar3 as stage release
$(PWD)/script/rebar3 as stage tar
$(SED) -i 's/{gaby, "$(VER)"}/{gaby, "gaby-version"}/g' ./rebar.config
#$(SCP) -P 8522 $(PWD)/_build/stage/rel/gaby/gaby-$(VER).tar.gz $(FS)
@printf "\nApplication: %s\n" $(PWD)/_build/stage/rel/gaby/gaby-$(VER).tar.gz
rel-dev:
$(PWD)/script/rebar3 as dev release