File: rules

package info (click to toggle)
libcitadel 902-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 2,072 kB
  • ctags: 1,203
  • sloc: ansic: 15,113; sh: 8,303; makefile: 308
file content (114 lines) | stat: -rwxr-xr-x 2,544 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
#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-

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

include /usr/share/quilt/quilt.make

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

CFLAGS = `dpkg-buildflags --get CFLAGS`
CFLAGS += -Wall

CPPFLAGS += `dpkg-buildflags --get CPPFLAGS`

LDFLAGS = `dpkg-buildflags --get LDFLAGS`

ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -O0 -ggdb -rdynamic -MD -MP -D DEBUG -D VALGRIND
	EXTRA_ARGS =  --with-backtrace
else
	CFLAGS += -O2
endif

ifneq (,$(findstring profiling,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -pg
	LDFLAGS += -pg
endif

configure: patch configure-stamp
configure-stamp:
	dh_testdir

	dh_autotools-dev_updateconfig
	CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
		$(EXTRA_ARGS) \
		--prefix=/usr

	touch configure-stamp

build: build-arch build-indep
build-arch: build-stamp
build-indep: build-stamp
build-stamp: configure
	dh_testdir

	$(MAKE)

	touch build-stamp

clean: unpatch
	dh_testdir
	dh_testroot
	rm -f build-stamp install*-stamp configure-stamp

	[ ! -f Makefile ] || $(MAKE) distclean

	-rm -f libcitadel.pc sysdep.h tests/Makefile config.log

	dh_autotools-dev_restoreconfig
	dh_clean

install: install-stamp
install-stamp: build-stamp
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs

	$(MAKE) DESTDIR=`pwd`/debian/tmp install

	touch install-stamp

# Build architecture-independent files here.
binary-indep: build install
	dh_testdir -i
	dh_testroot -i
	dh_installdocs -i -A README.txt
	dh_installchangelogs -i debian/no-upstream-changelog
	dh_install -i --sourcedir=debian/tmp
	dh_link -i
	dh_strip -i
	dh_compress -i
	dh_fixperms -i
	dh_installdeb -i
	dh_shlibdeps -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

# Build architecture-dependent files here.
binary-arch: build install
	dh_testdir -a
	dh_testroot -a
	dh_installchangelogs -a -plibcitadel4
	dh_installdocs -a
	dh_install -a --sourcedir=debian/tmp
	dh_link -a
	dh_strip -a --dbg-package=libcitadel4-dbg
	dh_compress -a
	dh_fixperms -a
	dh_makeshlibs -a -V
	dh_installdeb -a
	dh_shlibdeps -a
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

source diff:                                                                  
	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install