#!/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 IsCombedTIVTCport.o externalfilters/IsCombedTIVTCport.cpp
	g++ -c -std=gnu++11 -fPIC ${CXXFLAGS} ${CPPFLAGS} -I. $(shell pkg-config --cflags vapoursynth) -o PlaneDifferenceFromPrevious.o externalfilters/PlaneDifferenceFromPrevious.cpp
	g++ -c -std=gnu++11 -fPIC ${CXXFLAGS} ${CPPFLAGS} -I. $(shell pkg-config --cflags vapoursynth) -o PluginInit.o externalfilters/PluginInit.cpp
	g++ -shared -fPIC ${LDFLAGS} -Wl,--as-needed -o libvautodein.so *.o

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

override_dh_clean:
	dh_clean libvautodein.so *.o
