#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# SciPlot.c (1996-era K&R style) declares its private functions with empty
# parentheses, e.g. "static void Initialize();".  With gcc-14+/C23 (default
# -std=gnu23) an empty parameter list means the same as (void), which turns
# these declarations into hard errors (conflicting types, too many arguments,
# incompatible pointer types).  Build with -std=gnu17 to keep the pre-C23
# semantics this code was written for.
export CFLAGS := -std=gnu17 $(CFLAGS)

%:
	dh $@

override_dh_auto_install:
	dh_auto_install
	@echo Renaming executables to have sciplot- prefix.
	-cd debian/tmp/usr/bin \
	 && for f in *; do mv "$$f" "sciplot-$$f"; done \
	 || echo Ignoring rename error
