#!/usr/bin/make -f
# -*- makefile -*-

# Upstream CFLAGS line. Kept here just for info. "-fPIC -c" are required.
UPSTREAM_CFLAGS = -fPIC -O2 -c -g -Wall -Wformat-security -fno-strict-aliasing

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

CFLAGS  += $(UPSTREAM_CFLAGS)
LDFLAGS += --shared

%:
	dh $@

override_dh_auto_build:
	cp -i debian/Upstream.Changelog changelog
	cp -i debian/encfs.pam-config debian/encfs
	dh_auto_build -- 'LD=$$(CC)' CFLAGS="$(CFLAGS) $(CPPFLAGS)" LDFLAGS="$(LDFLAGS)"

override_dh_auto_clean:
	rm -f changelog debian/encfs
	dh_auto_clean
