#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.

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

export DH_OPTIONS

DB2MAN=/usr/share/xml/docbook/stylesheet/docbook-xsl/manpages/docbook.xsl
XP=xsltproc --nonet

TG_BRANCHES:=debian/disable-src-mods
include $(wildcard /usr/share/topgit/tg2quilt.mk)

CFLAGS = -Wall -g

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -O0
else
	CFLAGS += -O2
endif

%: 
	dh $@

override_dh_auto_configure:
	perl makever.pl

override_dh_auto_build:
	$(MAKE) -f makefile
	cd Doc && perl make.pl linux examples
	$(XP) -o sketch.1 $(DB2MAN)  debian/sketch-man.xml

override_dh_auto_clean:
	$(MAKE) clean


