#!/usr/bin/make -f

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

CFLAGS := $(shell dpkg-buildflags --get CFLAGS)
CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS)
LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS)

CFLAGS += -Wall -Wformat

build: build-arch build-indep

build-arch: build-stamp
build-indep:

build-stamp:
	dh_testdir
	$(MAKE) CPPFLAGS='$(CPPFLAGS)' CFLAGS='$(CFLAGS)' \
		LDFLAGS='$(LDFLAGS)' STRIP='# '
	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp configure-stamp

	# Add here commands to clean up after the build process.
	$(MAKE) clean

	dh_clean

binary-indep:

binary-arch: build-stamp
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs

	# Add here commands to install the package into debian/acorn-fdisk.
	$(MAKE) install DESTDIR=$(CURDIR)/debian/acorn-fdisk
	find $(CURDIR)/debian/acorn-fdisk -type d -empty -delete
	dh_installdocs
	dh_installexamples
	dh_installmenu
	dh_installcron
	dh_installman
	dh_installinfo
	dh_installchangelogs ChangeLog
	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-arch build-indep build clean binary-indep binary-arch binary
