annotate erlang/erldc/Makefile @ 54:918dab7a6606

- added callback support (comes with some bigger refactoring) - allow CPython's Py{CObject,Capsule} to be used as 'p'ointers
author Tassilo Philipp
date Tue, 02 Feb 2021 20:42:02 +0100
parents 3abd4f1ab473
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
1 # Be sure to 'make clean' after changing the version
41
3abd4f1ab473 - erlang binding: update to dc 1.1 and added note about missing feature
Tassilo Philipp
parents: 24
diff changeset
2 VERSION=1.1
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
3
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
4 OUTPUTS = priv/erldc.so ebin/dyncall.beam ebin/erldc.app
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
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
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
9 ERLANG_INST_DIR=/usr/lib64/erlang
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
10
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
11 all: $(OUTPUTS)
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
12
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
13 priv/erldc.so: c_src/dyncallnif.c
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
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
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
16
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
17 priv/erldc_testtargets.so: c_src/erldctesttargets.c
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
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
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
20
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
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
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
23 erlc +debug_info -o ebin src/dyncall.erl
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
24
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
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
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
27 sed -e 's/---VERSION---/$(VERSION)/' src/erldc.app.src >$@
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
28
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
29 # Dialyzer, credit to erlang.mk
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
30 DIALYZER_OPTS ?= -Werror_handling -Wrace_conditions \
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
31 -Wunmatched_returns # -Wunderspecs
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
32
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
33 build-plt:
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
34 rm -f test/*.beam
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
35 dialyzer --build_plt --output_plt dyncall.plt \
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
36 --apps erts kernel stdlib .
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
37
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
38 dialyze: $(OUTPUTS)
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
39 dialyzer --src src --plt dyncall.plt --no_native $(DIALYZER_OPTS)
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
40
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
41 tests: $(OUTPUTS) priv/erldc_testtargets.so
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
42 mkdir -p log
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
43 # Add priv to runtime ld path so we get test targets
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
44 export LD_LIBRARY_PATH=$$(pwd)/priv:${LD_LIBRARY_PATH}; \
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
45 ct_run -pa ebin -logdir log \
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
46 -suite linkload_SUITE call_SUITE \
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
47 misc_SUITE callf_SUITE
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
48 rm -f test/*.beam
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
49
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
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
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
52
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
53 # Convention appears to be install binaries and source, but not tests or build-related things
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
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
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
56 install -d $$appdir $$appdir/ebin $$appdir/priv $$appdir/src $$appdir/c_src $$appdir/include; \
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
57 install README.txt $$appdir; \
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
58 install src/*.erl $$appdir/src; \
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
59 install include/*.hrl $$appdir/include; \
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
60 install c_src/*.c $$appdir/c_src; \
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
61 install ebin/* $$appdir/ebin; \
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
62 install priv/erldc.so $$appdir/priv
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
63
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
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
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
66 rm -rf $$appdir
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
67
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
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