#!/usr/bin/make -f
# $MirOS: contrib/hosted/tg/deb/kwalletcli/deb-kde4/rules,v 1.5 2010/07/19 20:39:21 tg Exp $
#-
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.

KDE_VER=4

CC ?= gcc
CXX ?= g++

# CXXFLAGS default to CFLAGS, so this is okay
CFLAGS = -Wall -g

ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -O0
else
	CFLAGS += -O2
endif

MAKE_INVOCATION=\
	env CC='${CC}' CXX='${CXX}' CFLAGS='${CFLAGS}' ${MAKE} \
	    -f GNUmakefile KDE_VER=${KDE_VER}

build: .build_done

.build_done:
	dh_testdir
	${MAKE_INVOCATION}
	touch $@

clean:
	dh_testdir
	${MAKE_INVOCATION} clean
	-rm -f .build_done debian/copyright
	cat debian/copyright.hdr LICENCE >debian/copyright
	dh_clean

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

# Build architecture-dependent files here.
binary-arch: build
	dh_testdir
	dh_testroot
	dh_installdirs
	${MAKE_INVOCATION} DESTDIR=$$(pwd)/debian/kwalletcli install
	dh_installchangelogs
	dh_installdocs
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

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