#!/usr/bin/make -f

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

CFLAGS = -Wall -W -pedantic -g -D_REENTRANT

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

build:
	dh_testdir
	$(MAKE) CFLAGS="$(CFLAGS)"

clean:
	dh_testdir
	dh_testroot
	[ ! -f Makefile ] || $(MAKE) clean
	dh_clean 

install:
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs
	dh_install

binary-arch: install
	dh_testdir
	dh_testroot
	dh_installchangelogs HISTORY.TXT
	dh_installdocs
	dh_installexamples
	dh_installman
	dh_link
	dh_strip
	dh_compress 
	dh_fixperms
	dh_makeshlibs
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

# do nothing
binary-indep:

binary: binary-arch binary-indep
.PHONY: build clean binary-arch binary install binary-indep
