Package: libssw / 1.1-1

build_all_libs.patch Patch series | download
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
56
57
58
59
60
61
62
63
Description: build all libraries
 This patch makes sure that also static libraries are built, and that
 the correct SONAMEs etc. are used for the shared ones.
 Not upstreamed as upstream intends their C source to be inlined with the
 code using the functions.
Author: Sascha Steinbiss <sascha@steinbiss.name>
--- a/src/Makefile
+++ b/src/Makefile
@@ -5,24 +5,29 @@
 LOBJS = ssw.o
 LCPPOBJS = ssw_cpp.o
 PROG = ssw_test
-LIB = libssw.so
+SOVERS=.0
+LIB = libssw.so$(SOVERS)
+STATICLIB = libssw.a
 EXAMPLE = example_c
 EXAMPLE_CPP = example_cpp
 JAVA_JAR = ssw.jar
 JAVA_LIB = libsswjni.so
-JAVA_INLCUDES = -I"$(JAVA_HOME)/include" -I"$(JAVA_HOME)/include/linux"
-JAVA_OBJ = ssw/Aligner.class ssw/Alignment.class ssw/Example.class
+JAVA_INLCUDES = -I"$(JAVA_HOME)/include" -I"$(JAVA_HOME)/include/linux" -I/usr/lib/jvm/default-java/include/  -I/usr/lib/jvm/default-java/include/linux
+JAVA_OBJ = ssw/Aligner.class ssw/Alignment.class
 
 .PHONY: all default java clean
 
-default: $(PROG) $(EXAMPLE) $(EXAMPLE_CPP) $(LIB) 
+default: $(PROG) $(EXAMPLE) $(EXAMPLE_CPP) $(LIB) $(STATICLIB)
 
 all: default java
 
 java: $(JAVA_JAR) $(JAVA_LIB)
 
-$(LIB): ssw.c ssw.h
-	$(CC) $(CFLAGS) -fPIC -shared -rdynamic -o $@ $<
+$(LIB): ssw.c ssw.h ssw_cpp.h ssw_cpp.cpp
+	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -fPIC -shared -rdynamic -Wl,-soname,$(LIB) -o $@ $^
+
+$(STATICLIB): $(LOBJS) $(LCPPOBJS)
+	ar rcs $@ $^
 
 $(PROG): main.c kseq.h
 
@@ -38,10 +43,10 @@
 	$(CC) $(CFLAGS) $(JAVA_INLCUDES) -fPIC -shared -rdynamic -o $@ $< ssw.c 
 
 $(JAVA_JAR): $(JAVA_OBJ)
-	jar cvfe $@ ssw.Example $^
+	jar cvf $@ $^
 
 %.class: %.java
-	javac -cp ./ $<
+	javac -target 1.6 -source 1.6 $<
 	
 ssw.o: ssw.c ssw.h
 	$(CC) -c -o $@ $< $(CFLAGS)
@@ -50,4 +55,4 @@
 	$(CXX) -c -o $@ $< $(CXXFLAGS)
 
 clean:
-	-rm -f $(LOBJS) $(LCPPOBJS) $(PROG) $(LIB) $(EXAMPLE) $(EXAMPLE_CPP) $(JAVA_LIB) $(JAVA_JAR) $(JAVA_OBJ) *~ 
+	-rm -f $(LOBJS) $(LCPPOBJS) $(PROG) $(LIB) $(EXAMPLE) $(EXAMPLE_CPP) $(JAVA_LIB) *.jar $(JAVA_OBJ) *~ $(STATICLIB)