#!/usr/bin/make -f

%:
	dh $@ --parallel

override_dh_auto_build:
	g++ -c -std=gnu++11 -fPIC ${CXXFLAGS} ${CPPFLAGS} -I. $(shell pkg-config --cflags vapoursynth) -o processplane.o src/processplane.c
	g++ -c -std=gnu++11 -fPIC ${CXXFLAGS} ${CPPFLAGS} -I. $(shell pkg-config --cflags vapoursynth) -fpermissive -o main.o src/main.c 
	g++ -shared -fPIC ${LDFLAGS} -Wl,--as-needed -o libtemplinearapproximate.so *.o

override_dh_install:
	dh_install libtemplinearapproximate.so usr/lib/$(DEB_HOST_MULTIARCH)/vapoursynth
	dh_install MCDenoise.py $(shell python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")

override_dh_clean:
	dh_clean libtemplinearapproximate.so *.o
