#!/usr/bin/make -f
# -*- makefile -*- made with the aid of debmake, by Christoph Lameter,
# based on the sample debian/rules file for GNU hello by Ian Jackson.

package=splay

build:
	$(checkdir)
	make DEBUG=""
	touch build

clean:
	$(checkdir)
	-make clean
	-rm -rf $$(find . -name "*~") $$(find debian/* -type d)
	-rm -rf debian/files* core debian/*substvars* build psplay


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
	$(checkdir)
	-rm -rf debian/tmp && install -d debian/tmp
	cd debian/tmp && install -d $$(cat ../dirs)
	install splay debian/tmp/usr/bin/splay
	strip debian/tmp/usr/bin/splay
	install splay_pentium debian/tmp/usr/bin/psplay
	strip debian/tmp/usr/bin/psplay
	cp sound/README* debian/tmp/usr/doc/$(package)/sound
	debstd -p -u sound/ChangeLog README README.han
	dpkg-gencontrol
	chown -R root.root debian/tmp
	chmod -R go=rX debian/tmp
	dpkg --build debian/tmp ..


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
