#!/usr/bin/make -f

export LDFLAGS+=-Wl,--as-needed
export CFLAGS+=-Wall -g -fno-exceptions -fomit-frame-pointer

ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -O0
else
	CFLAGS += -O2
endif

%:
	dh $@ --parallel --with autoreconf

override_dh_auto_configure:
	dh_auto_configure -- --with-pic

override_dh_autoreconf:
	dh_autoreconf --as-needed

override_dh_auto_install:
	dh_auto_install -- prefix=/usr destdir=debian/amsynth
	mv debian/amsynth/usr/bin/amSynth \
		debian/amsynth/usr/bin/amsynth
