#!/usr/bin/make -f

PACKAGE = tinyirc

export DEB_BUILD_MAINT_OPTIONS  = hardening=+all
export DEB_CFLAGS_MAINT_APPEND  = -pedantic -Wall -DPOSIX -DDO_CTCP
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

man:
	# target: man - convert *.pod to manual page
	$(MAKE) -C debian -f pod2man.mk PACKAGE=$(PACKAGE) \
	PODCENTER="Misc" MANSECT=1 makeman

# For manual testing.
debug:
	gcc -DPOSIX  -O -DDEFAULTSERVER=\"irc.freenode.org\" -DDEFAULTPORT=6667 \
		-g tinyirc.c -o tinyirc -lncurses

override_dh_auto_build: man
	$(MAKE) tinyirc \
		CC='gcc' \
		CFLAGS='$(CPPFLAGS) $(CFLAGS) $(LDFLAGS)' \
		LIBS='-lncurses' \
		DEFINES='-DPOSIX -DDEFAULTSERVER=\"irc.freenode.org\" -DDEFAULTPORT=6667'

override_dh_installchangelogs:
	dh_installchangelogs announce

override_dh_auto_clean:
	# Skip. There is no such Makefile target

%:
	dh $@

.PHONY: man

# End of file
