#!/usr/bin/make -f

PACKAGE = tinyirc

export DEB_BUILD_MAINT_OPTIONS  = hardening=+all
export DEB_CFLAGS_MAINT_APPEND  = -pedantic -Wall \
 -DPOSIX -DDO_CTCP -DCURSES -DHAVE_NCURSES -std=gnu99

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:
	$(CC) -std=gnu99 -g \
	        -DPOSIX \
		-DCURSES \
		-DHAVE_NCURSES \
		-DHAVE_TIME \
		-DDEFAULTSERVER=\"irc.freenode.org\" \
		-DDEFAULTPORT=6667 \
		tinyirc.c -o tinyirc \
		-lncurses

override_dh_auto_build: man
	dh_auto_build -- \
		tinyirc \
		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
