-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
132 lines (96 loc) · 3.48 KB
/
Makefile
File metadata and controls
132 lines (96 loc) · 3.48 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
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
.PHONY: fix-slim-release test
## The all rule should be first
all: compile nitrogen_js_css
# Check if rebar3.mk exists, and if not, download it
ifeq ("$(wildcard rebar3.mk)","")
$(shell curl -O https://raw.githubusercontent.com/choptastic/rebar3.mk/master/rebar3.mk)
endif
# rebar3.mk adds a new rebar3 rule to your Makefile
# (see https://github.com/choptastic/rebar3.mk) for full info
include rebar3.mk
cookie:
@echo Generating a default cookie in /etc/vm.args
@(echo -setcookie `openssl rand -base64 50 | head -n1 | sed -e 's/[^a-zA-Z0-9]//g'` >> etc/vm.args)
compile: rebar3
@($(REBAR) compile)
eunit:
@($(REBAR) eunit)
release: rebar3
@(./make_version_file.escript go && \
etc/assemble_config.escript etc etc/autogenerated.config.all && \
$(REBAR) release && \
make finish_version)
revert_version:
./make_version_file.escript revert
finish_version:
./make_version_file.escript finish
upgrade_running:
./make_version_file.escript go && \
./upgrade_release.sh && \
make finish_version
## Just an alias for daemon
start: daemon
## This path is set during project creation. If you decide to change the
## name of your application or make multiple release versions, you'll very
## likely need to revise this path
daemon: release
_build/default/rel/pokedex/bin/pokedex daemon
## This path is set during project creation. If you decide to change the
## name of your application or make multiple release versions, you'll very
## likely need to revise this path
attach: _build/default/rel/pokedex/bin/pokedex
_build/default/rel/pokedex/bin/pokedex attach
_build/default/rel/pokedex/bin/pokedex:
@echo "ERROR: There is no release built to attach to."
@exit 1;
run:
@echo "Close but no cigar..."
@echo "You can do either 'make run_dev' or 'make run_release'"
run_release: release
@($(REBAR) run)
run_dev: rebar3
@($(REBAR) shell --eval "sync:go().")
upgrade_deps: rebar3
@($(REBAR) upgrade)
nitrogen_js_css: priv/static/nitrogen
copy-static:
@(escript copy_static.escript copy)
link-static:
@(escript copy_static.escript link)
## If the _build directory doesn't exist, we need to pull the dependencies
_build: deps
plugins: _build
@(escript do-plugins.escript)
rebar2_links: site site/static site/src site/templates site/include
site:
@echo Making Nitrogen 2 compatible directory structure symlinks
@(mkdir -p site)
site/static:
@(ln -s ../priv/static site/static)
site/src:
@(ln -s ../src site/src)
site/templates:
@(ln -s ../priv/templates site/templates)
site/include:
@(ln -s ../include site/include)
priv/static/nitrogen: link-static
dialyzer: rebar3
@($(REBAR) dialyzer)
dev:
mkdir -p _checkouts
git clone https://github.com/nitrogen/nitrogen_core -b rebar3 _checkouts/nitrogen_core
git clone https://github.com/nitrogen/nprocreg _checkouts/nprocreg
git clone https://github.com/nitrogen/simple_bridge _checkouts/simple_bridge
git clone https://github.com/nitrogen/rekt _checkouts/rekt
git clone https://github.com/nitrogen/nitro_cache _checkouts/nitro_cache
git clone https://github.com/nitrogen/canister _checkouts/canister
git clone https://github.com/choptastic/qdate _checkouts/qdate
git clone https://github.com/rustyio/sync _checkouts/sync
deps: rebar3
@($(REBAR) deps)
## This is only used during an upgrade from rebar2 to rebar3, generally
fix-deps: rebar3
@echo "Pulling dependencies"
@($(REBAR) deps)
@echo "Using the pulled dependencies to populate the relx application list"
@(./update_config_to_rebar3.escript rebar.config fix_relx_apps)