#!/usr/bin/make -f
#
# @package      phantomjs
# @file         rules
# @author       Nicholas J. Kisseberth <nkissebe@purdue.edu>
# @copyright    Copyright (c) 2014 HUBzero Foundation, LLC.
# @license      http://www.gnu.org/licenses/lgpl-3.0.html LGPLv3
#
# Copyright (c) 2014 HUBzero Foundation, LLC.
#
# This file is part of: The HUBzero(R) Platform for Scientific Collaboration
#
# The HUBzero(R) Platform for Scientific Collaboration (HUBzero) is free
# software: you can redistribute it and/or modify it under the terms of
# the GNU Lesser General Public License as published by the Free Software
# Foundation, either version 3 of the License, or (at your option) any
# later version.
#
# HUBzero is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
# HUBzero is a registered trademark of HUBzero Foundation, LLC.
#

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

$(info ########## Goals: $(MAKECMDGOALS) ##########)

configure:
	@echo "########## configure ##########"
	dh_testdir
	>$@

build: configure
	@echo "########## build ##########"
	dh_testdir
	$(MAKE) build
	>$@

clean:
	@echo "########## clean ##########"
	dh_testdir
	dh_testroot
	rm -f build configure
	$(MAKE) clean
	dh_clean 

install: build
	@echo "########## install ##########"
	dh_testdir
	dh_testroot
	dh_prep 
	dh_installdirs
	$(MAKE) DESTDIR=$(CURDIR)/debian/phantomjs install
	rm $(CURDIR)/debian/phantomjs/usr/share/doc/phantomjs/LICENSE.BSD

binary-indep:
	@echo "########## binary-indep ##########"

binary-arch: install
	@echo "########## binary-arch ##########"
	dh_testdir -a
	dh_testroot -a
	dh_installchangelogs -a
	dh_installdocs -a
	dh_installexamples -a
	dh_install -a
	dh_installlogrotate -a
	dh_installman -a
	dh_link -a
	dh_strip -a
	dh_lintian -a
	dh_compress -a
	dh_fixperms -a
	dh_installdeb -a
	dh_shlibdeps -a
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

binary: binary-indep binary-arch
	@echo "########## binary ##########"

.PHONY: clean binary-indep binary-arch binary install

