#!/usr/bin/make -f
# Copyright © 1997-1999 Joey Hess <joeyh@debian.org>
# Copyright © 2004-2007, 2009, 2011 Guillem Jover <guillem@debian.org>

clean:
	dh_testdir
	dh_testroot
	
	$(MAKE) clean
	rm -f VGABIOS-*.bin
	
	dh_clean

build-indep:
	dh_testdir
	
	$(MAKE)

build-arch:
# Nothing to do.

build: build-indep build-arch

BIOSDIR := debian/vgabios/usr/share/vgabios/

install: build-indep
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs
	
	set -e; \
	for i in "" .cirrus .qxl .vmware; do \
		for j in "$$i" "$$i.debug"; do \
			install -m644 $(CURDIR)/VGABIOS-lgpl-latest$$j.bin \
			              $(BIOSDIR)/vgabios$$j.bin ; \
		done; \
	done

binary-indep: install
	dh_testdir
	dh_testroot
	dh_installdocs
	dh_installchangelogs ChangeLog
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary-arch:
# Nothing to do.

binary: binary-indep binary-arch

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