-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
55 lines (44 loc) · 1.79 KB
/
Makefile
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
46
47
48
49
50
51
52
53
54
55
#
# Inspired by https://github.com/xerial/snappy-java/blob/develop/Makefile .
#
OBJ=obj
MVN=mvn
NATIVES-TARGET=src/main/resources/NATIVE/$(shell bin/os-arch.sh)/$(shell bin/os-name.sh)
all: build
build: $(OBJ)/libmurmur-hash-v3-java.so class
$(OBJ)/MurmurHashV3.o: $(addprefix src/main/java/com/logentries/murmur/, MurmurHashV3.cpp MurmurHashV3.h)
mkdir -p $(OBJ)
$(CXX) -O3 -g -fPIC -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux -c src/main/java/com/logentries/murmur/MurmurHashV3.cpp -o $(OBJ)/MurmurHashV3.o
$(OBJ)/libmurmur-hash-v3-java.so: $(OBJ)/MurmurHashV3.o
$(CXX) -shared -Wl,-soname,libmurmur-hash-v3-java.so -o $(OBJ)/libmurmur-hash-v3-java.so $(OBJ)/MurmurHashV3.o
class: build-class
build-class: target/libmurmur-hash-v3-1.0-SNAPSHOT.jar
target/libmurmur-hash-v3-1.0-SNAPSHOT.jar: add-so
$(MVN) package -Dmaven.test.skip=true
add-so: $(OBJ)/libmurmur-hash-v3-java.so
mkdir -p $(NATIVES-TARGET)
cp $(OBJ)/libmurmur-hash-v3-java.so $(NATIVES-TARGET)
test:
$(JAVA_HOME)/bin/javac MurmurHashV3.java
mkdir -p src/test/resources/ie/ucd/murmur
mv MurmurHashV3.class src/test/resources/ie/ucd/murmur
$(MVN) test
#download-murmur: .download-murmur.stamp
#
#.download-murmur.stamp:
# mkdir -p src/test/resources
# wget 'https://github.com/trevorah/murmurhash-java/archive/master.tar.gz'
# tar xvf master.tar.gz
# touch .download-murmur.stamp
#
#compile-murmur: download-murmur
# $(JAVA_HOME)/bin/javac murmurhash-java-master/src/main/java/ie/ucd/murmur/MurmurHash.java
# mkdir -p src/test/resources/ie/ucd/murmur/
# mv murmurhash-java-master/src/main/java/ie/ucd/murmur/MurmurHash.class src/test/resources/ie/ucd/murmur/
clean:
rm -fr obj
rm -fr target
rm -fr src/main/resources/NATIVE
rm -fr src/test/resources/ie
rm -f .*.stamp
rm -f src/main/java/com/logentries/murmur/MurmurHashV3.class