forked from radiospiel/eep0018
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
49 lines (38 loc) · 1.23 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
# This file is part of eep0018 released under the MIT license.
# See the LICENSE file for more information.
top_builddir := `pwd`
PACKAGE_VERNAME=json-0.0.1
ERL=erl
DIALYZER=dialyzer
DIALYZER_FLAGS=
erl_lib_dir := $(shell $(ERL) -noinput -eval 'io:format("~s",[code:lib_dir()]), init:stop()')
INSTALL = install
INSTALL_UIDGID = -o root -g root
#DESTDIR =
.PHONY: doc
%.beam: %.erl
erlc -o test/ $<
all:
@mkdir -p ebin
./rebar compile
check: test/etap.beam test/util.beam
ERL_FLAGS="-pa ./ebin" JSON_NIF_DIR=$(top_builddir)/priv \
./rebar eunit
ERL_FLAGS="-pa ./ebin" JSON_NIF_DIR=$(top_builddir)/priv \
prove test/*.t
$(DIALYZER) $(DIALYZER_FLAGS) --build_plt --output_plt json.plt ebin/json.beam >json.log 2>&1 || { e=$$?; cat json.log; exit $$e; }
clean:
./rebar clean
rm -f test/*.beam json.plt json.log
doc:
./rebar doc
install:
for d in ebin priv doc/html; do \
$(INSTALL) $(INSTALL_UIDGID) -d $(DESTDIR)$(erl_lib_dir)/$(PACKAGE_VERNAME)/$$d || exit $$?; \
for f in $$d/*; do \
$(INSTALL) $(INSTALL_UIDGID) $$f $(DESTDIR)$(erl_lib_dir)/$(PACKAGE_VERNAME)/$$f || exit $$?; \
done \
done
for f in LICENSE; do \
$(INSTALL) $(INSTALL_UIDGID) $$f $(DESTDIR)$(erl_lib_dir)/$(PACKAGE_VERNAME)/$$f || exit $$?; \
done