#!/usr/bin/make -f

p=sac

build:
	dh_testdir
	$(MAKE) "CFLAGS=-Wall -O2 -fomit-frame-pointer"
	touch build

clean:
	$(checkdir)
	-rm -f build
	dh_clean
	-$(MAKE) clean

binary-indep:	checkroot build
	$(checkdir)
# There are no architecture-independent files to be uploaded
# generated by this package.  If there were any they would be
# made here.

binary-arch:	checkroot build
	dh_testdir
	-rm -rf debian/tmp
	dh_installdirs
	dh_installdebconf
	make install BINDIR=debian/tmp/usr/bin MANDIR=debian/tmp/usr/share/man
	dh_installdocs debian/README.Debian debian/*.lsm README THANKS TODO debian/notes 
	dh_installexamples scripts/*
	dh_installchangelogs CHANGES
	dh_installmanpages
	strip --remove-section=.comment debian/tmp/usr/bin/* 
	strip --remove-section=.note debian/tmp/usr/bin/* 
	dh_strip
	dh_fixperms
	dh_compress
	dpkg-shlibdeps $(p) rawtmp
	dh_installdeb
	dh_gencontrol
	chown -R root.root debian/tmp
	chmod -R g-ws debian/tmp
	dpkg --build debian/tmp ..

# Below here is fairly generic really

binary:		binary-indep binary-arch

source diff:
	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false

checkroot:
	dh_testdir
	dh_testroot

.PHONY: binary binary-arch binary-indep clean checkroot
