#!/usr/bin/make -f

package = unhtml

CC = gcc
CFLAGS = -g -Wall

ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
  CFLAGS += -O2
endif

build:
	$(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS)"
	touch build

clean:
	dh_clean
	rm -f build
	-$(MAKE) clean

binary-indep: build

binary-arch: build
	dh_clean
	dh_installdirs usr/bin
	install unhtml `pwd`/debian/$(package)/usr/bin
	dh_installdocs Readme.html Readme.txt
	dh_installman unhtml.1
	dh_installchangelogs
	dh_strip
	dh_compress
	dh_fixperms
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary: binary-indep binary-arch

.PHONY: binary binary-arch binary-indep clean
