#!/usr/bin/make -f
# -*- makefile -*-
# debian/rules for gtk-chtheme

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-stamp 
build-stamp: configure-stamp 
	dh_testdir
	$(MAKE)
	#docbook-to-man debian/gtk-chtheme.sgml > gtk-chtheme.1
	touch $@

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp configure-stamp
	$(MAKE) clean
	dh_clean 

install: build
	dh_testdir
	dh_testroot
	dh_clean -k 
	dh_installdirs usr/bin usr/share/pixmaps usr/share/applications
	dh_install debian/gtk-chtheme.desktop usr/share/applications
	# I know, I know, why not using dh_install ?
	# A: dh_install can't rename files. That bastard! It ruined off all beauty :)
	cp stock_menu_about.xpm  $(CURDIR)/debian/gtk-chtheme/usr/share/pixmaps/gtk-chtheme.xpm	
	$(MAKE) DESTDIR=$(CURDIR)/debian/gtk-chtheme install

# Build architecture-independent files here.
binary-indep: build install
# Blank here :)

# Build architecture-dependent files here.
binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installchangelogs ChangeLog
	dh_installdocs
	dh_installman gtk-chtheme.1
	dh_installmenu
	dh_link
	dh_strip
	dh_fixperms
	dh_compress
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

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