Package: dssp / 2.0.4-2

makefile 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
Description: assorted fixes
 [Maarten L. Hekkelman <m.hekkelman@cmbi.ru.nl>]
  * DEST_DIR patched to DESTDIR
 .
 [Laszlo Kajan <lkajan@rostlab.org>]
  * stripping is patched out so that it can be done by dh into a debug package
  * line echo suppression is removed
  * spelling errors in man page fixed
 .
 Upstream is aware of this patch.
Author: Maarten L. Hekkelman <m.hekkelman@cmbi.ru.nl>
Author: Laszlo Kajan <lkajan@rostlab.org>
--- a/makefile
+++ b/makefile
@@ -9,37 +9,36 @@
 # new one if it doesn't exist. In this make.config you can set site
 # specific variables like the Boost library location.
 
-firstTarget: mkdssp
-
-include make.config
+all: mkdssp
 
 VERSION				= 2.0.4
 
-DEST_DIR			?= /usr/local/
-LIB_DIR				= $(BOOST_LIB_DIR)
-INC_DIR				= $(BOOST_INC_DIR)
-MAN_DIR				= $(DEST_DIR)man/man1/
+CXXFLAGS			:= $(shell dpkg-buildflags --get CXXFLAGS)
+LDFLAGS				:= $(shell dpkg-buildflags --get LDFLAGS)
+
+BIN_DIR				= $(DESTDIR)/usr/bin
+MAN_DIR				= $(DESTDIR)/usr/share/man/man1
 
-BOOST_LIBS			= thread regex filesystem program_options date_time iostreams math_c99 system
-LIBS				= $(BOOST_LIBS:%=boost_%$(BOOST_LIB_SUFFIX)) z bz2
+BOOST_LIBS			= thread program_options iostreams system
+LIBS				= $(BOOST_LIBS:%=boost_%)
 
 DEFINES				= USE_COMPRESSION LINUX VERSION='"$(VERSION)"'
-CC					= c++
+CXX					= g++
 
-CFLAGS				= $(INC_DIR:%=-I%) -iquote src -g -Wall -Wno-multichar -pthread
-LDOPTS				= $(LIB_DIR:%=-L%) $(LIBS:%=-l%) -g -pthread
+CXXFLAGS			+= -I $(HOME)/projects/boost/include -iquote src -g -Wall -Wno-multichar -pthread
+LDOPTS				+= -L $(HOME)/projects/boost/lib $(LIBS:%=-l%) -g -pthread
 
 OBJ_DIR				= obj
 
 ifeq ($(DEBUG),1)
 OBJ_DIR				:= $(OBJ_DIR).dbg
-CFLAGS				+= -g3
+CXXFLAGS			+= -g3
 else
 DEFINES				+= NDEBUG
-CFLAGS				+= -O3
+CXXFLAGS			+= -O3
 endif
 
-CFLAGS				+= $(DEFINES:%=-D%)
+CXXFLAGS			+= $(DEFINES:%=-D%)
 
 DIST_NAME			= dssp-$(VERSION)
 
@@ -48,25 +47,21 @@
 OBJECTS = $(OBJ_DIR)/mkdssp.o $(OBJ_DIR)/dssp.o $(OBJ_DIR)/primitives-3d.o $(OBJ_DIR)/structure.o $(OBJ_DIR)/utils.o
 
 mkdssp: $(OBJECTS)
-	@ echo linking $@
-	@ $(CC) -static -o $@ $^ $(LDOPTS)
-	@ echo OK
-
-include $(OBJECTS:%.o=%.d)
-
-$(OBJECTS:.o=.d):
-
-$(OBJ_DIR)/%.o: %.cpp
-	@ if [ ! -d $(OBJ_DIR) ]; then mkdir $(OBJ_DIR); fi
-	@ echo compiling $@
-	@ $(CC) -MD -c -o $@ $< $(CFLAGS)
+	$(CXX) -o $@ $^ $(LDOPTS)
+
+$(OBJ_DIR):
+	mkdir -p $(OBJ_DIR)
+
+$(OBJ_DIR)/%.o: %.cpp | $(OBJ_DIR)
+	$(CXX) -MD -c -o $@ $< $(CXXFLAGS)
 
 clean:
 	rm -rf $(OBJ_DIR)/* mkdssp
 
 install: mkdssp
-	sudo install -m 755 mkdssp $(DEST_DIR)bin/mkdssp
-	sudo install doc/mkdssp.1 $(MAN_DIR)mkdssp.1
+	install -d $(BIN_DIR) $(MAN_DIR)
+	install -m 755 mkdssp $(BIN_DIR)/mkdssp
+	install doc/mkdssp.1 $(MAN_DIR)/mkdssp.1
 
 dist: $(OBJECTS)
 	@ rm -rf $(DIST_NAME)
@@ -81,11 +76,3 @@
 	@ cp doc/mkdssp.1 $(DIST_NAME)/doc/mkdssp.1
 	tar czf $(DIST_NAME).tgz $(DIST_NAME)
 	cp $(DIST_NAME).tgz dssp_$(VERSION).orig.tar.gz
-
-make.config:
-	@echo "creating empty make.config file"
-	@echo "# Set local options for make here" > make.config
-	@echo "#BOOST_LIB_SUFFIX = -mt" >> make.config
-	@echo "#BOOST_LIB_DIR    = $(HOME)/projects/boost/lib" >> make.config
-	@echo "#BOOST_INC_DIR    = $(HOME)/projects/boost/include" >> make.config
-
--- a/doc/mkdssp.1
+++ b/doc/mkdssp.1
@@ -13,7 +13,7 @@
 Please note that \fImkdssp\fP \fBdoes not predict\fP secondary structure.
 .SH OPTIONS
 If you invoke \fImkdssp\fP with only one parameter, it will be
-interpreted as the PDB file to process and output will be send to
+interpreted as the PDB file to process and output will be sent to
 stdout. If a second parameter is specified this is interpreted as
 the name of the DSSP file to create. Both the input and the output
 file names may have either \.gz or \.bz2 as extension resulting in
@@ -159,7 +159,7 @@
 .SH TODO
 The code desperately needs an update. The first thing that needs
 implementing is the improved recognition of pi\-helices. A second
-improvement would be to use angle dependant H\-bond energy calculation.
+improvement would be to use angle dependent H\-bond energy calculation.
 .SH BUGS
 If you find any, please let me know.
 .SH AUTHOR