#!/usr/bin/make -f

CPPFLAGS = -I/usr/include/opencv/
EXAMPLEPKG = libdecodeqr-examples

%:
	dh $@ --with quilt

override_dh_clean:
	- $(MAKE) -C src distclean
	rm -rf src/Makefile src/libdecodeqr/Makefile src/sample/Makefile src/sample/simple/Makefile src/sample/webcam/Makefile src/test/Makefile
	rm -rf modules/python/src2/hdr_parser.pyc

	dh_clean

override_dh_auto_configure:
	dh_auto_configure --sourcedirectory=src

override_dh_auto_build:
	$(MAKE) -C src DESTDIR=$(CURDIR)/debian/tmp

	dh_auto_build

override_dh_auto_install:
	dh_auto_install --sourcedirectory=src

override_dh_install:
	# Install QR image files
	install -d $(CURDIR)/debian/tmp/usr/share/doc/$(EXAMPLEPKG)/img
	install -m 755 $(CURDIR)/img/* $(CURDIR)/debian/tmp/usr/share/doc/$(EXAMPLEPKG)/img
	
	dh_install --sourcedir=debian/tmp
