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
|
#!/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
export DEB_BUILD_MAINT_OPTIONS=hardening=+all
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)
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_update_autotools_config
CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" ./configure \
--host=$(DEB_HOST_GNU_TYPE) \
--build=$(DEB_BUILD_GNU_TYPE) \
--libdir=/usr/lib/$(DEB_HOST_MULTIARCH) \
--with-pkg-config-libdir=/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig \
$(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
-rm -f debian/libcitadel4.install debian/libcitadel-dev.install
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
debian/%: debian/%.in
sed -e 's/$${DEB_HOST_MULTIARCH}/$(DEB_HOST_MULTIARCH)/g' $< > $@
binary-arch: binary
binary-indep: binary
# Build architecture-dependent files here.
binary: build install debian/libcitadel4.install debian/libcitadel-dev.install
dh_testdir
dh_testroot
dh_installchangelogs
dh_installdocs
dh_install --sourcedir=debian/tmp
dh_link
dh_strip
dh_compress
dh_fixperms
dh_makeshlibs -V
dh_installdeb
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
source diff:
@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
.PHONY: build clean binary-indep binary-arch binary install
|