File: rules

package info (click to toggle)
openms 2.4.0-real-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 646,136 kB
  • sloc: cpp: 392,260; xml: 215,373; python: 10,976; ansic: 3,325; php: 2,482; sh: 901; ruby: 399; makefile: 141; perl: 85
file content (229 lines) | stat: -rwxr-xr-x 6,743 bytes parent folder | 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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
#!/usr/bin/make -f

export DH_VERBOSE=1
export DH_OPTIONS=-v

CMAKE=/usr/bin/cmake

DEB_HOST_GNU_TYPE	?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE	?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_HOST_MULTIARCH	?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

DEBIAN_DIR = $(CURDIR)/debian

BUILD_DIR = $(DEBIAN_DIR)/build

# Path to the tools subdirectory in the top source dir to build the
# documentation.
export PATH := $(BUILD_DIR)/bin:$(CURDIR)/tools:$(PATH)
export LD_LIBRARY_PATH := $(BUILD_DIR)/lib/:$(LD_LIBRARY_PATH)

LIB_BIN_PACKAGE = libopenms2.4.0
LIB_SOVERSION = 2.4.0
PACK_VERSION = 2.4.0
DEB_PACK_VERSION = $(PACK_VERSION)-1


ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	CXXFLAGS += -O0
else
	CXXFLAGS += -O2
endif

$(info "---------------------------------------")
$(info NUMJOBS: $(NUMJOBS))
$(info MAKEFLAGS: $(MAKEFLAGS))
$(info DEB_BUILD_OPTIONS: $(DEB_BUILD_OPTIONS))
$(info "---------------------------------------")

# Hardening stuff, see http://wiki.debian.org/Hardening
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk
CFLAGS+=$(CPPFLAGS)
CXXFLAGS+=$(CPPFLAGS)

.NOTPARALLEL: 

.PHONY: clean
clean: 
	@echo "entering the clean target"
	dh_testdir
	dh_testroot

	rm -rf $(BUILD_DIR)
	
	# Remove the generated xpm icon files:
	rm -f debian/TOPPAS.xpm
	rm -f debian/TOPPView.xpm
	
	# Remove the generated topp.1 man page:
	rm -f debian/topp.1
	
	dh_clean


build-arch-stamp:
	dh_testdir
	dh_prep -a

	mkdir -p $(BUILD_DIR)

# On the command line, use 
# -DCONTRIB_LIB_DIR="/usr/lib/$(dpkg-architecture -qDEB_BUILD_GNU_TYPE);/usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH);" 
# see debian/changelog for the rationale.

	@echo "DEB_BUILD_GNU_TYPE: $(DEB_BUILD_GNU_TYPE)"
		@echo "DEB_HOST_MULTIARCH: $(DEB_HOST_MULTIARCH)"
	
	cd $(BUILD_DIR) && \
		$(CMAKE) -DCMAKE_FIND_LIBRARY_SUFFIXES=".so" \
		-DCMAKE_INSTALL_PREFIX="/usr" \
		-DOPENMS_CONTRIB_LIBS="/usr/lib;/usr/lib/$(DEB_BUILD_GNU_TYPE);/lib/$(DEB_BUILD_GNU_TYPE);/usr/lib/$(DEB_HOST_MULTIARCH);/lib/$(DEB_HOST_MULTIARCH)" \
		-DCF_OPENMS_DATA_PATH=/usr/share/openms-common/ \
		-DCF_OPENMS_DOC_PATH=/usr/share/doc/openms-doc/ \
		-DCMAKE_BUILD_TYPE=release \
		-DDEBIAN_BUILD=ON -DBOOST_USE_STATIC=OFF ../.. 
	
	# Build the libs and executable binaries
	VERBOSE=1 $(MAKE) -C $(BUILD_DIR) \
					OpenMS GUI OpenSwathAlgo SuperHirn TOPP \
					UTILS Tutorials_build doc_tutorials
	
	# Run the test suite
	#VERBOSE=1 $(MAKE) -C $(BUILD_DIR) test
	
	# Prepare the xpm-formatted pixmaps for the Debian menu system.
	# Setting imagemagick to Build-Depends, for use of convert.
	convert src/openms_gui/source/VISUAL/ICONS/TOPPAS.png -resize 32x32 debian/TOPPAS.xpm
	convert src/openms_gui/source/VISUAL/ICONS/TOPPView.png -resize 32x32 debian/TOPPView.xpm
	
	# Prepare the topp.1 man page with all the one-line description got
	# from calling individually each program in $(BUILD_DIR)/bin with
	# --help switch. The newly built libs need be in the path so that the
	# binaries can execute. Same for the shared data path, because the
	# binaries need it to run. Note the calling in sh ./ with the script
	# shell being itself executable, otherwise git-buildpackage would
	# fail.
	@echo $(shell pwd)
	cd $(DEBIAN_DIR) && \
		OPENMS_DATA_PATH=$(CURDIR)/share/OpenMS/ \
		LD_LIBRARY_PATH=$(BUILD_DIR)/lib/:$(LD_LIBRARY_PATH)\
		sh ./binaries-extract-one-line-man-desc.sh
	
	# Build the documentation, which needs a running XWindow server. We
	# thus use the doc_minimal target.
	
	cd $(BUILD_DIR) && \
		$(CMAKE) -DCMAKE_FIND_LIBRARY_SUFFIXES=".so" \
		-DCMAKE_INSTALL_PREFIX="/usr" \
		-DOPENMS_CONTRIB_LIBS="/usr/lib;/usr/lib/$(DEB_BUILD_GNU_TYPE);/lib/$(DEB_BUILD_GNU_TYPE);/usr/lib/$(DEB_HOST_MULTIARCH);/lib/$(DEB_HOST_MULTIARCH)" \
		-DCF_OPENMS_DATA_PATH=/usr/share/openms-common/ \
		-DCF_OPENMS_DOC_PATH=/usr/share/doc/openms-doc/ \
		-DCMAKE_BUILD_TYPE=release \
		-DDEBIAN_BUILD=ON -DBOOST_USE_STATIC=OFF ../.. 
	
	VERBOSE=1 LD_LIBRARY_PATH=$(BUILD_DIR)/lib/:$(LD_LIBRARY_PATH)\
		PATH=$(BUILD_DIR)/bin:$(CURDIR)/tools:$(PATH)\
		OPENMS_DATA_PATH=$(CURDIR)/share/OpenMS/ \
		$(MAKE) -C $(BUILD_DIR) doc_progs doc_tutorials \
		doc_minimal doc_class_only

	VERBOSE=1 LD_LIBRARY_PATH=$(BUILD_DIR)/lib/:$(LD_LIBRARY_PATH)\
		PATH=$(BUILD_DIR)/bin:$(CURDIR)/tools:$(PATH)\
		OPENMS_DATA_PATH=$(CURDIR)/share/OpenMS/ \
		cd $(BUILD_DIR)/doc/doxygen && doxygen Doxyfile

	# The install/fast target allows installing without having to first make 
	# all the targets, including the target that makes the build fail due
	# to not having a working X session.
	
	VERBOSE=1 LD_LIBRARY_PATH=$(BUILD_DIR)/lib/:$(LD_LIBRARY_PATH)\
		PATH=$(BUILD_DIR)/bin:$(CURDIR)/tools:$(PATH)\
		OPENMS_DATA_PATH=$(CURDIR)/share/OpenMS/ \
		$(MAKE) -C $(BUILD_DIR) install/fast DESTDIR=$(BUILD_DIR)
	
	# There are two files that we do not want to ship because
	# they exist in their own Debian packages.
	
	rm -f $(BUILD_DIR)/usr/share/doc/html/jquery.js
	
	touch build-arch-stamp


#  Note that this requires a build of the binary arch stuff.
build-indep-stamp: build-arch-stamp

	touch build-indep-stamp


.PHONY: build
build: 	build-arch-stamp build-indep-stamp


.PHONY: build-indep
build-indep: build-indep-stamp


.PHONY: build-arch
build-arch: build-arch-stamp


# Build architecture-independent files here.
.PHONY: binary-indep
binary-indep: build-indep
	dh_testdir -i
	dh_testroot -i
	dh_installchangelogs -i CHANGELOG 
	dh_installdocs -i
	dh_install -i
	dh_installman -i
	dh_compress -XOpenMS_tutorial.pdf -XTOPP_tutorial.pdf -i
	dh_fixperms -i
	dh_installdeb -i
	dh_lintian -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i


# Build architecture-dependent files here.
.PHONY: binary-arch
binary-arch: build-arch
	dh_testdir -a
	dh_testroot -a
	dh_link
	dh_installchangelogs -a CHANGELOG
	dh_installdocs -a
	dh_install -a
	# Now that install has been performed, remove all the Tutorial*
	# binaries that will not ship in the topp package, but in the
	# openms-doc package.
	rm -vf $(DEBIAN_DIR)/topp/usr/bin/Tutorial*
	dh_installmenu -a
	dh_installman -a
	dh_strip -p$(LIB_BIN_PACKAGE)
	dh_strip -ptopp
	dh_compress -a
	dh_fixperms -a
	
	dh_makeshlibs -a
	dh_shlibdeps -a
	dh_gencontrol -a
	dh_installdeb -a

	dpkg-gensymbols -P$(DEBIAN_DIR) -p$(LIB_BIN_PACKAGE) \
		-v$(PACK_VERSION) -c2 -d \
		-e$(BUILD_DIR)/lib/libOpenMS.so.$(LIB_SOVERSION) \
		-e$(BUILD_DIR)/lib/libOpenMS_GUI.so.$(LIB_SOVERSION) \
		-e$(BUILD_DIR)/lib/libOpenSwathAlgo.so.$(LIB_SOVERSION) \
		-e$(BUILD_DIR)/lib/libSuperHirn.so.$(LIB_SOVERSION) \
		-O$(DEBIAN_DIR)/$(LIB_BIN_PACKAGE)/DEBIAN/symbols

	dh_lintian -a
	dh_md5sums -a
	dh_builddeb -a


.PHONY: binary
binary: binary-arch binary-indep