#!/usr/bin/make -f

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

build:
	dh_testdir
	$(MAKE) -C src -j 2 -f fte-unix.mak
	touch build

clean:
	dh_testdir
	dh_testroot
	rm -f build
	$(MAKE) -C src -f fte-unix.mak clean
	dh_clean

binary-indep:
# There are no architecture-independent files to be uploaded
# generated by this package.  If there were any they would be
# made here.

binary-arch: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs -A

	cd config; $(CURDIR)/src/cfte main.fte $(CURDIR)/debian/fte/etc/fte/system.fterc
	cp debian/fte.sh $(CURDIR)/debian/fte/usr/bin/fte
	tar czf $(CURDIR)/debian/fte-docs/usr/share/doc/fte/config-example.tar.gz config

	dh_install
	dh_installdocs
	dh_installexamples
	dh_installchangelogs
	dh_installmenu
	dh_installcron
	dh_installman
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
	dh_makeshlibs
	dh_shlibdeps
	dh_gencontrol
	dh_installdeb
	dh_md5sums
	dh_builddeb -v


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

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