#!/usr/bin/make -f

SHELL+= -e
#export DH_VERBOSE=1

# support noopt; nostrip is handled dh_strip
CFLAGS = -g
ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -O2
endif
export CFLAGS

build: build-stamp
build-stamp:
	dh_testdir
	$(MAKE)
	touch build-stamp

clean:
	dh_testdir
	$(MAKE) clean
	-rm -f build-stamp
	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_installdirs
	$(MAKE) install DESTDIR=$(CURDIR)/debian/bsdmainutils

binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installdocs
	dh_installchangelogs
	dh_installcron
	dh_strip
	dh_compress
	dh_fixperms -Xbsd-write
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_installdeb
	dh_builddeb

binary-indep:

binary: binary-arch

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