-
Notifications
You must be signed in to change notification settings - Fork 11
/
make.sh
executable file
·36 lines (29 loc) · 1.33 KB
/
make.sh
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
#!/bin/sh
# This was an old ad-hoc way to build, consider using cmake or autoconf
ERLANG_INSTALL=/usr/local
ERTS_PATH=$ERLANG_INSTALL/lib/erlang/erts-5.10.1
ERL_INTERFACE_PATH=$ERLANG_INSTALL/lib/erlang/lib/erl_interface-3.7.11
CURRENT_VERSION=vsn-1
gcc -Wall -Wextra -Werror -g -O0 -I$ERTS_PATH/include/ \
-o test_functions.o -c -fpic test_functions.c
g++ -Wall -Wextra -Werror -Wno-unused-function -g -O0 -I$ERTS_PATH/include/ \
-DCURRENT_VERSION=$CURRENT_VERSION \
-include test_bindings.h \
-save-temps -o port_driver.o -c -fpic port_driver.cpp \
&& echo "port_driver.ii contains generated code"
g++ -Wall -Wextra -Werror -g -O0 -I$ERTS_PATH/include/ \
-o test_functions_port_driver_$CURRENT_VERSION.so \
-shared port_driver.o test_functions.o
g++ -Wall -Wextra -Werror -g -O0 -I$ERL_INTERFACE_PATH/include/ \
-DCURRENT_VERSION=$CURRENT_VERSION \
-include test_bindings.h \
-save-temps -o port.o -c -fpic port.cpp \
&& echo "port.ii contains generated code"
g++ -Wall -Wextra -Werror -g -O0 -o main.o -c -fpic main.cpp
g++ -Wall -Wextra -Werror -g -O0 \
-L$ERL_INTERFACE_PATH/lib/ -o test_functions_port_$CURRENT_VERSION \
port.o test_functions.o main.o -lei
gcc -Wall -Wextra -Werror -DCURRENT_VERSION=$CURRENT_VERSION \
-include test_bindings.h \
-E -P erlang_functions_hrl.h > erlang_functions.hrl
erlc test_bindings.erl