#!/usr/bin/make -f

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

clean:
	dh_testdir
	[ ! -f wmSun/Makefile ] || $(MAKE) -C wmSun clean
	dh_clean
	rm -f build-stamp

build:  build-stamp
build-stamp:
	dh_testdir
	$(MAKE) -C wmSun
	touch build-stamp

binary: binary-arch

binary-indep:

binary-arch: build
	dh_testdir
	dh_testroot
	dh_prep
	dh_install
	dh_installdocs TODO changelog
	dh_installman wmSun/wmSun.1
	dh_installchangelogs
	dh_installmenu
	dh_link usr/bin/wmSun usr/bin/wmsun
	dh_link usr/share/man/man1/wmSun.1.gz usr/share/man/man1/wmsun.1.gz
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

.PHONY: clean binary-indep binary-arch binary
