#!/usr/bin/make -f
CCX_VERSION=2.10
CCX_SRC=ccx_${CCX_VERSION}/src
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
DH_VERBOSE = 1

# see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/*
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/default.mk

UPSTREAM_CFLAGS = -Wall -I/usr/include/spooles -DARCH="Linux" -DSPOOLES -DARPACK -DMATRIXSTORAGE -DUSE_MT=1

%:
	dh $@ -D${CCX_SRC}

override_dh_auto_build:
	dh_auto_build -- CFLAGS="$(UPSTREAM_CFLAGS) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)"

override_dh_auto_install:
	cp -v ${CCX_SRC}/ccx_${CCX_VERSION} ${CCX_SRC}/ccx

override_dh_auto_clean:
	rm -f ${CCX_SRC}/*.o
	rm -f ${CCX_SRC}/*.a
	rm -f ${CCX_SRC}/ccx_${CCX_VERSION}
	rm -f ${CCX_SRC}/ccx
