#!/usr/bin/make -f

#export DH_VERBOSE=1

export CFLAGS := $(shell dpkg-buildflags --get CFLAGS)
CFLAGS += -std=c99 -D_POSIX_C_SOURCE=2
export LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS)

# Upstream's makefile doesn't respect DESTDIR, but it's simple
# enough so we just handle it here.
override_dh_auto_install:
	install -m0755 xplot debian/xplot-xplot.org/usr/bin/xplot.org
	install -m0755 tcpdump2xplot.pl debian/xplot-xplot.org/usr/bin/tcpdump2xplot
	install -m0644 xplot.1 debian/xplot-xplot.org/usr/share/man/man1/xplot.org.1

execute_after_dh_clean:
	-rm -f Makefile config.h config.log config.status

%:
	dh $@
