#!/usr/bin/make -f
# xdemineur debian/rules
# Andreas Tille <tille@debian.org>
# Wed, 04 Jul 2001 11:11:00 +0200

#export DH_VERBOSE=1

TMPDIR = `pwd`/debian/xdemineur

DEB_HOST_GNU_TYPE=$(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE=$(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
CROSS=CC=$(DEB_HOST_GNU_TYPE)-gcc
else
CROSS=
endif

build: xdemineur
xdemineur:
	dh_testdir
	xmkmf
	$(MAKE) $(CROSS) CFLAGS+="$(CFLAGS)"
	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	if [ -f Makefile ]; then $(MAKE) clean; fi
	dh_clean Makefile

install: build
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs
	make DESTDIR=$(TMPDIR) BINDIR=/usr/games install
	cp -a debian/xdemineur-icon.xpm $(TMPDIR)/usr/share/pixmaps
	cp debian/xdemineur.desktop $(TMPDIR)/usr/share/applications

binary-indep: build install

binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installdocs README
	dh_installexamples
	dh_installmenu
	cp -a xdemineur.man $(TMPDIR)/usr/share/man/man6/xdemineur.6x
	dh_installchangelogs
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

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

