#!/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