-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
45 lines (33 loc) · 1.38 KB
/
Makefile
File metadata and controls
45 lines (33 loc) · 1.38 KB
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
BASEDIR=$(dir $(abspath $(lastword $(MAKEFILE_LIST))))
VERSION=$(shell $(BASEDIR)/bin/arb4jVersion)
SOURCES=native/arb_wrap.c native/complex.c native/ml.c
JAVA_HOME=$(shell readlink -f `which javac` | sed "s:bin/javac::")
C_INCLUDES=-I$(JAVA_HOME)include -I$(JAVA_HOME)include/linux -I/usr/include/flint
CFLAGS=-g -O3 -fPIC -shared -Wno-int-conversion \
-Dflint_rand_struct=flint_rand_s \
-Dflint_rand_init=flint_randinit \
-Dflint_rand_clear=flint_randclear \
-Dflint_rand_set_seed=flint_randseed
SWIGFLAGS=-v -java -package arb -outdir src/main/java/arb
all: libarblib.so
jar: build/libs/arb4j-$(VERSION).jar
build/libs/arb4j-$(VERSION).jar: install
native/arb_wrap.c: $(shell find native -name "*.i")
swig $(SWIGFLAGS) native/arb.i
# FLINT 3.1/3.2 workaround: stride field removed (restored in 3.3)
sed -i 's|if (arg1) (arg1)->stride = arg2;|// stride removed in FLINT 3.1-3.2|g' native/arb_wrap.c
sed -i 's|result = (long) ((arg1)->stride);|result = 0; // stride removed in FLINT 3.1-3.2|g' native/arb_wrap.c
libarblib.so: $(SOURCES)
clang $(CFLAGS) $(SOURCES) $(C_INCLUDES) -olibarblib.so -lflint -lxdo
clean:
rm -rf libarblib.so *.o native/arb_wrap.c build/*
test:
mvn test
documentation:
mvn javadoc:javadoc
docs: documentation
doc: docs
install: libarblib.so
mvn install -Dmaven.test.skip=true
debian-install: libarblib.so
mvn -Pdebian install -Dmaven.test.skip=true