summaryrefslogtreecommitdiff
path: root/Makefile
blob: a50d91746e1ff7720b7ca6db09b4055f2d6494fa (plain)
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
ERL ?= erl
APP := simplec
USER_UNITS := ~/.config/systemd/user/
SERVICE := $(APP).service

.PHONY: deps

all: compile

compile: deps
	@./rebar compile

deps:
	@./rebar get-deps

clean:
	@./rebar clean

distclean: clean
	@./rebar delete-deps

docs:
	@erl -noshell -run edoc_run application '$(APP)' '"."' '[]'

test: all
	@(./rebar skip_deps=true eunit)

tags:
	find . -name "*.[he]rl" -print | etags -

install_user: test
	cp priv/$(SERVICE) $(USER_UNITS)/$(SERVICE)
	mkdir -p ~/bin/
	ln -s $$(realpath .)/$(APP) ~/bin/$(APP)
	systemctl --user enable $(SERVICE)

uninstall_user:
	systemctl --user stop $(SERVICE)
	systemctl --user disable $(SERVICE)
	rm -f $(USER_UNITS)/$(SERVICE) ~/bin/$(APP)

DEPSOLVER_PLT=$(CURDIR)/.depsolver_plt
$(DEPSOLVER_PLT):
	dialyzer --output_plt $(DEPSOLVER_PLT) --build_plt \
	    --apps erts kernel stdlib crypto http_uri -r deps

dialyzer: $(DEPSOLVER_PLT)
	dialyzer --plt $(DEPSOLVER_PLT) -Wrace_conditions --src src