#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
#
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# This has to be exported to make some magic below work.
export DH_OPTIONS

include /usr/share/quilt/quilt.make

CFLAGS = -Wall -g

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

configure: configure-stamp
configure-stamp:
	dh_testdir
	touch configure-stamp

build: build-indep

build-arch:
build-indep: build-indep-stamp
build-indep-stamp: $(QUILT_STAMPFN) configure-stamp 

	touch build-indep-stamp

clean: unpatch
	dh_testdir
	dh_testroot
	rm -f build-indep-stamp
	dh_clean 

install: install-indep
install-indep:
	dh_testdir
	dh_testroot
	dh_clean -k -i 
	dh_installdirs -i
	dh_install -i
	mv debian/redet/usr/bin/redet.tcl debian/redet/usr/bin/redet

binary-common:
	dh_testdir
	dh_testroot
	dh_installchangelogs 
	dh_installdocs
	dh_installexamples
	dh_installmenu
	dh_installman
	dh_link
	dh_strip
	dh_compress 
	dh_fixperms
	dh_makeshlibs
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary-arch:
binary-indep: build-indep install-indep
	$(MAKE) -f debian/rules DH_OPTIONS=-i binary-common

binary: binary-indep
.PHONY: build clean binary-arch binary-indep binary install install-indep configure \
patch unpatch

