#!/usr/bin/make -f
# -*- makefile -*-

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

DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

override_dh_auto_configure:
	cp -f /usr/share/misc/config.guess .
	cp -f /usr/share/misc/config.sub .
	CFLAGS="$(CFLAGS)" dh_auto_configure -- \
	       --with-html-dir=\$${prefix}/share/doc/enca/html \
	       --libexecdir=\$${prefix}/lib \
	       --with-librecode \
	       --with-libiconv \
		   --disable-static \
	       --disable-rpath

override_dh_strip:
	dh_strip --dbg-package=libenca-dbg

build: build-arch build-indep
build-arch: build-stamp
build-indep: build-stamp

build-stamp:
	dh build
	touch $@

clean:
	dh clean

install: build
	dh install

# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do here

# Build architecture-dependent files here.
binary-arch: build install
	dh binary-arch

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