Mercurial > pub > dyncall > bindings
comparison erlang/erldc/Makefile @ 0:0cfcc391201f
initial from svn dyncall-1745
author | Daniel Adler |
---|---|
date | Thu, 19 Mar 2015 22:26:28 +0100 |
parents | |
children | 079718588eb6 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:0cfcc391201f |
---|---|
1 # ERLANG_INC is used for -I, below, so add paths where it might be on linux, freebsd, etc. | |
2 ERLANG_INC=-I /usr/lib64/erlang/usr/include -I /usr/local/lib/erlang/usr/include | |
3 DYNCALL_SRC_PATH=../../../dyncall | |
4 | |
5 # Be sure to 'make clean' after changing the version | |
6 VERSION=0.1 | |
7 | |
8 OUTPUTS = priv/erldc.so ebin/dyncall.beam ebin/erldc.app | |
9 | |
10 # Used by install target. Default empty DESTDIR is for a real install to root filesystem (/). | |
11 # Override DESTDIR for testing or for a staged install | |
12 DESTDIR= | |
13 ERLANG_INST_DIR=/usr/lib64/erlang | |
14 | |
15 all: $(OUTPUTS) | |
16 | |
17 priv/erldc.so: c_src/dyncallnif.c | |
18 [ -d priv ] || mkdir priv | |
19 cc -o $@ -fPIC -shared \ | |
20 $(ERLANG_INC) -I $(DYNCALL_SRC_PATH) \ | |
21 $(DYNCALL_SRC_PATH)/dyncall/*.o \ | |
22 c_src/dyncallnif.c | |
23 | |
24 priv/erldc_testtargets.so: c_src/erldctesttargets.c | |
25 [ -d priv ] || mkdir priv | |
26 cc -o $@ -shared -fPIC c_src/erldctesttargets.c | |
27 | |
28 ebin/dyncall.beam: src/dyncall.erl | |
29 erlc +debug_info -o ebin src/dyncall.erl | |
30 | |
31 ebin/erldc.app: src/erldc.app.src | |
32 sed -e 's/---VERSION---/$(VERSION)/' src/erldc.app.src >$@ | |
33 | |
34 # Dialyzer, credit to erlang.mk | |
35 DIALYZER_OPTS ?= -Werror_handling -Wrace_conditions \ | |
36 -Wunmatched_returns # -Wunderspecs | |
37 | |
38 build-plt: | |
39 rm -f test/*.beam | |
40 dialyzer --build_plt --output_plt dyncall.plt \ | |
41 --apps erts kernel stdlib . | |
42 | |
43 dialyze: $(OUTPUTS) | |
44 dialyzer --src src --plt dyncall.plt --no_native $(DIALYZER_OPTS) | |
45 | |
46 tests: $(OUTPUTS) priv/erldc_testtargets.so | |
47 mkdir -p log | |
48 # Add priv to runtime ld path so we get test targets | |
49 export LD_LIBRARY_PATH=$$(pwd)/priv:${LD_LIBRARY_PATH}; \ | |
50 ct_run -pa ebin -logdir log \ | |
51 -suite linkload_SUITE call_SUITE \ | |
52 misc_SUITE callf_SUITE | |
53 rm -f test/*.beam | |
54 | |
55 clean: | |
56 rm -rf priv ebin/* test/*.beam log | |
57 | |
58 # Convention appears to be install binaries and source, but not tests or build-related things | |
59 install: $(OUTPUTS) | |
60 appdir=$(DESTDIR)$(ERLANG_INST_DIR)/lib/erldc-$(VERSION); \ | |
61 install -d $$appdir $$appdir/ebin $$appdir/priv $$appdir/src $$appdir/c_src $$appdir/include; \ | |
62 install README.txt $$appdir; \ | |
63 install src/*.erl $$appdir/src; \ | |
64 install include/*.hrl $$appdir/include; \ | |
65 install c_src/*.c $$appdir/c_src; \ | |
66 install ebin/* $$appdir/ebin; \ | |
67 install priv/erldc.so $$appdir/priv | |
68 | |
69 uninstall: | |
70 appdir=$(DESTDIR)$(ERLANG_INST_DIR)/lib/erldc-$(VERSION); \ | |
71 rm -rf $$appdir | |
72 | |
73 .PHONY: clean all tests build-plt dialyze install uninstall |