Mercurial > pub > dyncall > bindings
annotate erlang/erldc/Makefile @ 24:681db37a300c
- prep 1.0 release
author | Tassilo Philipp |
---|---|
date | Thu, 19 Apr 2018 18:54:47 +0200 |
parents | 7752fcb107e7 |
children | 3abd4f1ab473 |
rev | line source |
---|---|
0 | 1 # Be sure to 'make clean' after changing the version |
24 | 2 VERSION=1.0 |
0 | 3 |
4 OUTPUTS = priv/erldc.so ebin/dyncall.beam ebin/erldc.app | |
5 | |
12
079718588eb6
made erlang binding work with system *installed* dyncall:
cslag
parents:
0
diff
changeset
|
6 # Used by install target. Default empty PREFIX is for a real install to root filesystem (/). |
079718588eb6
made erlang binding work with system *installed* dyncall:
cslag
parents:
0
diff
changeset
|
7 # Override PREFIX for testing or for a staged install |
079718588eb6
made erlang binding work with system *installed* dyncall:
cslag
parents:
0
diff
changeset
|
8 PREFIX= |
0 | 9 ERLANG_INST_DIR=/usr/lib64/erlang |
10 | |
11 all: $(OUTPUTS) | |
12 | |
13 priv/erldc.so: c_src/dyncallnif.c | |
14 [ -d priv ] || mkdir priv | |
14
7752fcb107e7
- erlang binding build fix, linker arg was at wrong place
cslag
parents:
12
diff
changeset
|
15 $(CC) -o $@ -shared -fPIC $(CFLAGS) c_src/dyncallnif.c -ldyncall_s |
0 | 16 |
17 priv/erldc_testtargets.so: c_src/erldctesttargets.c | |
18 [ -d priv ] || mkdir priv | |
12
079718588eb6
made erlang binding work with system *installed* dyncall:
cslag
parents:
0
diff
changeset
|
19 $(CC) -o $@ -shared -fPIC c_src/erldctesttargets.c |
0 | 20 |
21 ebin/dyncall.beam: src/dyncall.erl | |
12
079718588eb6
made erlang binding work with system *installed* dyncall:
cslag
parents:
0
diff
changeset
|
22 [ -d ebin ] || mkdir ebin |
0 | 23 erlc +debug_info -o ebin src/dyncall.erl |
24 | |
25 ebin/erldc.app: src/erldc.app.src | |
12
079718588eb6
made erlang binding work with system *installed* dyncall:
cslag
parents:
0
diff
changeset
|
26 [ -d ebin ] || mkdir ebin |
0 | 27 sed -e 's/---VERSION---/$(VERSION)/' src/erldc.app.src >$@ |
28 | |
29 # Dialyzer, credit to erlang.mk | |
30 DIALYZER_OPTS ?= -Werror_handling -Wrace_conditions \ | |
31 -Wunmatched_returns # -Wunderspecs | |
32 | |
33 build-plt: | |
34 rm -f test/*.beam | |
35 dialyzer --build_plt --output_plt dyncall.plt \ | |
36 --apps erts kernel stdlib . | |
37 | |
38 dialyze: $(OUTPUTS) | |
39 dialyzer --src src --plt dyncall.plt --no_native $(DIALYZER_OPTS) | |
40 | |
41 tests: $(OUTPUTS) priv/erldc_testtargets.so | |
42 mkdir -p log | |
43 # Add priv to runtime ld path so we get test targets | |
44 export LD_LIBRARY_PATH=$$(pwd)/priv:${LD_LIBRARY_PATH}; \ | |
45 ct_run -pa ebin -logdir log \ | |
46 -suite linkload_SUITE call_SUITE \ | |
47 misc_SUITE callf_SUITE | |
48 rm -f test/*.beam | |
49 | |
50 clean: | |
12
079718588eb6
made erlang binding work with system *installed* dyncall:
cslag
parents:
0
diff
changeset
|
51 rm -rf priv ebin test/*.beam log |
0 | 52 |
53 # Convention appears to be install binaries and source, but not tests or build-related things | |
54 install: $(OUTPUTS) | |
12
079718588eb6
made erlang binding work with system *installed* dyncall:
cslag
parents:
0
diff
changeset
|
55 appdir=$(PREFIX)$(ERLANG_INST_DIR)/lib/erldc-$(VERSION); \ |
0 | 56 install -d $$appdir $$appdir/ebin $$appdir/priv $$appdir/src $$appdir/c_src $$appdir/include; \ |
57 install README.txt $$appdir; \ | |
58 install src/*.erl $$appdir/src; \ | |
59 install include/*.hrl $$appdir/include; \ | |
60 install c_src/*.c $$appdir/c_src; \ | |
61 install ebin/* $$appdir/ebin; \ | |
62 install priv/erldc.so $$appdir/priv | |
63 | |
64 uninstall: | |
12
079718588eb6
made erlang binding work with system *installed* dyncall:
cslag
parents:
0
diff
changeset
|
65 appdir=$(PREFIX)$(ERLANG_INST_DIR)/lib/erldc-$(VERSION); \ |
0 | 66 rm -rf $$appdir |
67 | |
68 .PHONY: clean all tests build-plt dialyze install uninstall | |
12
079718588eb6
made erlang binding work with system *installed* dyncall:
cslag
parents:
0
diff
changeset
|
69 |