#!/usr/bin/make -f
# -*- makefile -*-
# Copyright 2017 Trevor SANDY

# output every command that modifies files on the build system.
export DH_VERBOSE = 1

# use Qt5
export QT_SELECT=qt5

%:
	dh $@

configure: configure-stamp
configure-stamp:
	dh_testdir

	# Start custom configuration command
	if [ -f ../SOURCES/complete.zip ] ; then 				\
		cp ../SOURCES/complete.zip mainApp/extras ; 		\
	else \
		echo "complete.zip not found!" ; 					\
	fi
	if [ -f ../SOURCES/lpub3dldrawunf.zip ] ; then 			\
		cp ../SOURCES/lpub3dldrawunf.zip mainApp/extras ; 	\
	else \
		echo "lpub3dldrawunf.zip not found!" ; 				\
	fi
override_dh_auto_configure:
	if [ `uname -m` = "x86_64" ] ; then						\
		/usr/lib/x86_64-linux-gnu/qt5/bin/qmake -makefile -nocache QMAKE_STRIP=: CONFIG+=release CONFIG+=deb ;	\
	else \
		/usr/lib/i386-linux-gnu/qt5/bin/qmake -makefile -nocache QMAKE_STRIP=: CONFIG+=release CONFIG+=deb ; 	\
	fi
	# End custom configuration command
	touch configure-stamp

build: configure-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f configure-stamp

	dh_clean

.PHONY: configure build clean
