#!/usr/bin/make -f

build:
	$(MAKE)

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

binary-indep:	checkroot build
	$(checkdir)
	-rm -rf debian/tmp
	install -d debian/tmp/DEBIAN
	install -d debian/tmp/etc
	install -d debian/tmp/usr/doc/sysadmin-guide
	install -d debian/tmp/usr/lib/menu
	cp -a HTML/sag/* debian/tmp/usr/doc/sysadmin-guide
	cp debian/menu debian/tmp/usr/lib/menu/sysadmin-guide
	cp debian/dwww-index debian/tmp/usr/doc/sysadmin-guide/.dwww-index
	cp debian/copyright debian/changelog debian/tmp/usr/doc/sysadmin-guide
	dpkg-gencontrol
	chown -R root.root debian/tmp
	chmod -R g-ws debian/tmp
	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

checkroot:
	$(checkdir)
	test root = "`whoami`"

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