#!/usr/bin/make -f
# Derived from hello, debmake, dh_make examples.

package=console-apt

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

build: build-stamp
build-stamp:
	dh_testdir
	$(MAKE) CFLAGS="-O2 -g -Wall"
	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp install-stamp
	[ ! -f Makefile ] || $(MAKE) clean
	dh_clean

install: install-stamp
install-stamp: build-stamp
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs
	$(MAKE) install DESTDIR=`pwd`/debian/tmp/usr
	touch install-stamp

binary-indep: build install
# There are no architecture-independent packages here.

binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installdocs docs/README
	dh_installmenu
	dh_installmanpages
	cd debian/tmp/usr/share/man/man1 && ln -s capt.1.gz console-apt.1.gz && \
	   ln -s capt.1.gz apt-find.1.gz
	dh_installchangelogs
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

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

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