#!/usr/bin/make -f
# Copyright 1996 by Kevin Dalley, base upon many other files
#


package = miscutils

build:
	$(checkdir)
	touch build

clean:
	$(checkdir)
	-rm -f build
	-rm -rf *~ debian/tmp debian/*~ debian/files*

binary-indep:	checkroot build
	$(checkdir)
	-rm -rf debian/tmp
	install -d debian/tmp debian/tmp/DEBIAN
	install -d debian/tmp/usr/doc/$(package)
	install debian/copyright debian/tmp/usr/doc/$(package)/.
	install debian/changelog debian/tmp/usr/doc/$(package)/changelog.Debian
	gzip -9v debian/tmp/usr/doc/$(package)/changelog.Debian
	dpkg-gencontrol
	dpkg --build debian/tmp ..

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

define checkdir
	test -f debian/rules
endef

# 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:
	$(checkdir)
	test root = "`whoami`"

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