File: rules

package info (click to toggle)
libgdf 0.1.2-2.1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 1,100 kB
  • sloc: cpp: 6,120; makefile: 64; sh: 29
file content (63 lines) | stat: -rwxr-xr-x 1,846 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
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

export LDFLAGS = -Wl,--as-needed

UVER = $(shell LC_ALL=C dpkg-parsechangelog | grep '^Version:' | cut -d ' ' -f 2,2 | cut -d '-' -f 1,1)
H2MVER = $(shell help2man --version | head -1 | sed -e 's/.* //g')

DEB_CMAKE_EXTRA_FLAGS = \
	-DBUILD_SHARED_LIBS:BOOL=ON \
	-DBUILD_TESTING:BOOL=ON

# get octave paths (have to build-depend on liboctave-dev)
# which is dependent upon by dh-octave
OCTDIR=$(shell octave-config --print LOCALOCTFILEDIR)

%:
	dh $@ --buildsystem=cmake

override_dh_auto_configure:
	dh_auto_configure -- \
		$(DEB_CMAKE_EXTRA_FLAGS)

override_dh_auto_build:
	dh_auto_build

	: # Build quick and dirty manpage whenever recent help2man is available
	if dpkg --compare-versions $(H2MVER) ge 1.37.1; then \
	  LD_LIBRARY_PATH=$$(/bin/ls -d $$PWD/obj-*)/libgdf \
		help2man --no-info -S libGDF -s 1 --version-string=$(UVER) \
		-n "Merge multiple GDF files" \
		*/tools/gdf_merger/gdf_merger >| gdf_merger.1; \
	else \
		touch gdf_merger.1; \
	fi

	: # Build Octave bindings
	cd matlab; \
	 for f in *.cpp; do \
		mkoctfile --mex $$f -I../libgdf/include -L$$(/bin/ls -d $$PWD/../obj-*)/libgdf -lGDF; \
	 done

override_dh_auto_install:
	dh_auto_install
	: # Install Octave bindings
	dh_install -poctave-gdf matlab/*.mex $(OCTDIR)/gdf
	dh_octave_substvar -poctave-gdf \

override_dh_strip:
	dh_strip --dbg-package=libgdf0-dbg

override_dh_clean:
	dh_clean
	rm -f gdf_merger.1
	-cd matlab; rm *.mex *.o