2 # -*- mode: makefile; coding: utf-8 -*-
4 # Uncomment this to turn on verbose mode.
9 DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
10 DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
12 CFLAGS = -Wall -g -Wformat -Werror=format-security
16 ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
17 CFLAGS += -O0 -ggdb -rdynamic -MD -MP -D DEBUG -D VALGRIND
18 EXTRA_ARGS = --with-backtrace
21 CFLAGS += -O0 -ggdb -rdynamic -MD -MP -D DEBUG -D VALGRIND
24 ifneq (,$(findstring profiling,$(DEB_BUILD_OPTIONS)))
29 ifneq (,$(findstring sprofiling,$(DEB_BUILD_OPTIONS)))
30 CFLAGS += -D SIZE_DEBUG
33 ifneq (,$(findstring gcov,$(DEB_BUILD_OPTIONS)))
34 CFLAGS += -fprofile-arcs -ftest-coverage
35 LDFLAGS += -fprofile-arcs -ftest-coverage
43 export CFLAGS="$(CFLAGS)"; export LDFLAGS="$(LDFLAGS)"; ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
55 rm -f build-stamp install*-stamp
57 [ ! -f Makefile ] || $(MAKE) distclean
61 install: install-stamp
62 install-stamp: build-stamp
68 $(MAKE) DESTDIR=`pwd`/debian/tmp install
72 # Build architecture-independent files here.
73 binary-indep: build install
76 # dh_installdocs -i -A README
77 # dh_installchangelogs -i debian/no-upstream-changelog
78 # dh_install -i --sourcedir=debian/tmp
89 # Build architecture-dependent files here.
90 binary-arch: build install
93 dh_installchangelogs -a -plibcitadel4
95 dh_install -a --sourcedir=debian/tmp
97 dh_strip -a --dbg-package=libcitadel4-dbg
108 @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
110 binary: binary-indep binary-arch
111 .PHONY: build clean binary-indep binary-arch binary install