#!/usr/bin/make -f
# -*- makefile -*-

# The magic debhelper rule
%:
	dh --with-python2 $@

# Uncomment this to turn on verbose mode.
# export DH_VERBOSE=1

override_dh_auto_build:
	find examples -type f -exec chmod 644 {} \;
	cd build/qt4/terralib && qmake QMAKE_CXXFLAGS=-fpermissive terralib.pro  && $(MAKE) 
	cd build/qt4/te_functions && qmake QMAKE_CXXFLAGS=-fpermissive te_functions.pro  && $(MAKE) 
	cd build/qt4/te_utils && qmake QMAKE_CXXFLAGS=-fpermissive te_utils.pro  && $(MAKE) 
	ar rcs libterralib.a Release/linux-g++/obj/terralib/*.o
	ar rcs libte_functions.a Release/linux-g++/obj/te_functions/*.o
	ar rcs libte_utils.a Release/linux-g++/obj/te_utils/*.o

override_dh_clean:
	dh_clean
	rm -f lib*.a
	rm -rf Release
	find . -name '.cvsignore' -exec rm {} \;
	$(MAKE) -C build/qt4/terralib distclean || echo "terralib already clean"
	$(MAKE) -C build/qt4/te_utils distclean || echo "te_utils already clean"
	$(MAKE) -C build/qt4/te_functions distclean || echo "te_functions already clean"

