-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile
42 lines (31 loc) · 1.04 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
# =============================================================================
# Variables
# =============================================================================
PREFIX ?= "/usr"
BIN := "$(PREFIX)/bin"
# =============================================================================
# Rules
# =============================================================================
.PHONY= all test clean repl shell build test analyze configure install
all: test
clean:
rm -rf rebar.lock
rm -rf _build
rm -rf .cache
repl:
nix-shell --run "erl"
shell:
nix-shell --run "bash"
configure:
nix-shell --pure --command 'eval "$$configurePhase"; echo $?'
build: configure
nix-shell --pure --command 'eval "$$buildPhase"'
analyze: bootstrap
nix-shell --pure --run "TERM=dumb HOME=$(CURDIR) rebar3 do escriptize,dialyzer"
test: build
nix-shell --pure --run "TERM=dumb HOME=$(CURDIR) rebar3 do escriptize,dialyzer,eunit"
install:
HOME=$(CURDIR) rebar3 escriptize
mkdir -p "$(BIN)"
cp "$(CURDIR)/_build/default/bin/hex2nix" "$(BIN)"
chmod a+x "$(BIN)/hex2nix"