#! /usr/bin/make -f

#   Copyright 1994-98   joey@infodrom.north.de (Martin Schulze)
#		2001	Filip Van Raemdonck <mechanix@debian.org>
#             2010-16   Peter Pentchev <roam@ringlet.net>

# Aim for the top, adapt if anything should break on the buildds.
DEB_BUILD_MAINT_OPTIONS=	hardening=+all
export DEB_BUILD_MAINT_OPTIONS

# Large File Support
LFS_CPPFLAGS:=	$(shell getconf LFS_CFLAGS 2>/dev/null || echo "-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64")
LFS_LDFLAGS:=	$(shell getconf LFS_LDFLAGS 2>/dev/null || true)

DEB_CPPFLAGS_MAINT_APPEND=	${LFS_CPPFLAGS}
export DEB_CPPFLAGS_MAINT_APPEND

DEB_CFLAGS_MAINT_APPEND=	-Wall -W -pipe -std=c99 -pedantic -Wbad-function-cast \
		-Wcast-align -Wchar-subscripts -Winline \
		-Wmissing-prototypes -Wnested-externs -Wpointer-arith \
		-Wredundant-decls -Wshadow -Wwrite-strings
ifneq (,$(filter werror,$(DEB_BUILD_OPTIONS)))
	DEB_CFLAGS_MAINT_APPEND+=	-Werror
endif
export DEB_CFLAGS_MAINT_APPEND

DEB_LDFLAGS_MAINT_APPEND=	${LFS_LDFLAGS}
DEB_LDFLAGS_MAINT_APPEND+=	-Wl,--as-needed
export DEB_LDFLAGS_MAINT_APPEND

INSTPREFIX=debian/gtkcookie/usr
export INSTPREFIX

%:
	dh $@
