#!/usr/bin/make -f

CFLAGS = -Wall -g

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

configure:

build: build-stamp

build-stamp:
	dh_testdir
	$(MAKE)
	touch $@

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

install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs
	install -m644 -D wien.png $(CURDIR)/debian/ubahn/opt/ubahn/wien.png
	install -m644 -D ubahn.png $(CURDIR)/debian/ubahn/usr/share/icons/hicolor/scalable/apps/ubahn.png
	install -m644 -D ubahn.desktop $(CURDIR)/debian/ubahn/usr/share/applications/hildon/ubahn.desktop
	install -m755 -D ubahn $(CURDIR)/debian/ubahn/opt/ubahn/ubahn

binary-indep: build install

binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installchangelogs
	dh_link
	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 configure
