#!/usr/bin/make -f
# -*- makefile -*-

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

DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk


# This is the only method that actually worked...
# Combined with the CFLAGS += <new flags> in the Makefile.
CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS)
CFLAGS:=$(shell dpkg-buildflags --get CFLAGS) $(CPPFLAGS)
CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS) $(CPPFLAGS)
LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)
DEB_HOST_MULTIARCH?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

%:
	dh $@

override_dh_auto_clean:
	dh_quilt_patch
	make clean
	rm -f debian/comet-ms.1
	dh_quilt_unpatch

manpage:
	docbook-to-man debian/comet-ms.sgml > debian/comet-ms.1

override_dh_auto_build: manpage
	dh_quilt_patch
	make 

override_dh_strip:
	dh_strip --dbg-package=comet-ms-dbg -a
