Package: libssw / 1.1-2

rename_tool.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
Description: build command line aligner
 This patch ensures that 'ssw_test' is called 'ssw-align' in Debian
 and also links against libssw.
Author: Sascha Steinbiss <satta@debian.org>
--- a/src/Makefile
+++ b/src/Makefile
@@ -4,9 +4,10 @@
 #CXXFLAGS := $(CFLAGS)
 LOBJS = ssw.o
 LCPPOBJS = ssw_cpp.o
-PROG = ssw_test
+PROG = ssw-align
 SOVERS=.0
 LIB = libssw.so$(SOVERS)
+LLIB = libssw.so
 STATICLIB = libssw.a
 EXAMPLE = example_c
 EXAMPLE_CPP = example_cpp
@@ -26,14 +27,18 @@
 $(LIB): ssw.c ssw.h ssw_cpp.h ssw_cpp.cpp
 	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -fPIC -shared -rdynamic -Wl,-soname,$(LIB) -o $@ $^ $(LDFLAGS)
 
+$(LLIB): $(LIB)
+	ln -s $< $@
+
 $(STATICLIB): $(LOBJS) $(LCPPOBJS)
 	ar rcs $@ $^
 
-$(PROG): main.c kseq.h
+$(PROG): main.c kseq.h $(LLIB)
+	$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ main.c kseq.h -L. -lssw -lm -lz $(LDFLAGS)
 
 $(EXAMPLE): example.c
 
-$(PROG) $(EXAMPLE): $(LOBJS)
+$(EXAMPLE): $(LOBJS)
 	$(CC) -o $@ $(filter-out %.h,$^) $(CPPFLAGS) $(CFLAGS) -lm -lz $(LDFLAGS)
 
 $(EXAMPLE_CPP): example.cpp $(LOBJS) $(LCPPOBJS)
--- a/src/main.c
+++ b/src/main.c
@@ -297,7 +297,7 @@
 	}
 	if (optind + 2 > argc) {
 		fprintf(stderr, "\n");
-		fprintf(stderr, "Usage: ssw_test [options] ... <target.fasta> <query.fasta>(or <query.fastq>)\n");
+		fprintf(stderr, "Usage: %s [options] ... <target.fasta> <query.fasta>(or <query.fastq>)\n", argv[0]);
 		fprintf(stderr, "Options:\n");
 		fprintf(stderr, "\t-m N\tN is a positive integer for weight match in genome sequence alignment. [default: 2]\n");
 		fprintf(stderr, "\t-x N\tN is a positive integer. -N will be used as weight mismatch in genome sequence alignment. [default: 2]\n");