#!/usr/bin/make -f
# Made with the aid of debhelper by by Joey Hess,
# based on the sample debian/rules file for GNU hello by Ian Jackson.
#
# This is free software; see the GNU General Public Licence
# version 2 or later for copying conditions.  There is NO warranty.
#
# Modified to suit yodl-2.00 by Frank B. Brokken <f.b.brokken@rc.rug.nl>

SHELL = /bin/sh

export DEB_BUILD_HARDENING=1

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


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

unexport NAME

configure: configure-stamp
configure-stamp:
	dh_testdir
	# Add here commands to configure the package.
	touch configure-stamp

clean:
	dh_testdir
	dh_testroot

	# Cleanup old stuff:
	./build clean

	dh_clean build-stamp install-stamp debian/substvars

build: build-arch build-indep
build-arch: build-stamp
build-stamp: configure-stamp
	dh_testdir

	# Compile the package:
	./build programs
	./build macros
	./build man

	touch build-stamp

build-indep: build-stamp
	./build manual

install: install-stamp

install-stamp: build-stamp
	dh_testdir
	dh_testroot
	dh_prep 
	dh_installdirs

	# Install the package below debian/yodl:
	./build install programs    debian/yodl
	./build install macros      debian/yodl
	./build install man         debian/yodl
	./build install docs        debian/yodl

	touch $@

install-indep:
	./build install manual debian/yodl-doc

# Build architecture-independent files here.
binary-indep: build-indep install-indep
	dh_testdir -i
	dh_testroot -i
	dh_installdocs -i
	dh_installinfo -i
	dh_installchangelogs -i
	dh_link -i
	dh_compress -i
	dh_fixperms -i
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

# Build architecture-dependent files here.
binary-arch: build-arch install
	dh_testdir -pyodl
	dh_testroot -pyodl
	dh_installdocs -pyodl
	dh_installinfo -pyodl
	dh_installchangelogs -pyodl
	dh_strip -pyodl
	dh_compress -pyodl
	dh_fixperms -pyodl
	dh_installdeb -pyodl
	dh_shlibdeps -pyodl
	dh_gencontrol -pyodl
	dh_md5sums -pyodl
	dh_builddeb -pyodl

print-version:
	@@echo "Debian version:                  $(DEBVERSION)"
	@@echo "Upstream version:                $(UPVERSION)"

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





