#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

LDFLAGS+=-Wl,--as-needed
DESTDIR=$(CURDIR)/debian/paulstretch

%:
	dh $@

override_dh_auto_build:
	# ./compile_linux_fftw.sh with custom LDFLAGS
	fluid -c GUI.fl 
	fluid -c FreeEditUI.fl
	g++ $(CPPFLAGS) $(CXXFLAGS) GUI.cxx FreeEditUI.cxx `LC_ALL=C ls *.cpp Input/*.cpp Output/*.cpp` \
	  -o paulstretch \
	  $(LDFLAGS) \
	  `fltk-config --cflags` `fltk-config --ldflags` \
	  -DHAVE_JACK -DENABLE_RESAMPLING \
	  `pkg-config --cflags --libs jack samplerate` \
	  `pkg-config --cflags --libs fftw3f vorbisenc vorbisfile vorbis ogg mad mxml audiofile` \
	  -lportaudio -lpthread -lz

override_dh_installchangelogs:
	dh_installchangelogs readme.txt
