#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# wcc links against the non-PIC static libsframe.a shipped by libsframe-dev
# (pulled in via binutils-dev); its R_X86_64_32 relocations cannot be used in a
# PIE executable. Keep the upstream -fpie/-fPIC code generation but perform the
# final link non-PIE (appended last so it overrides the upstream -pie).
export CFLAGS := $(CFLAGS) -no-pie

override_dh_auto_install:
	@echo using dh_install manually	

override_dh_fixperms:
	chmod 644 debian/wcc/usr/share/wcc/scripts/debug
	dh_fixperms

override_dh_gencontrol:
	dh_gencontrol -- -Vwcc:Built-Using="$(shell dpkg-query --show -f '$${source:Package} (=$${source:Version}),' binutils-dev)"

%:
	dh $@
