#!/usr/bin/make -f
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.

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

CROSS_PREFIX := powerpc-linux-gnu-
CFLAGS = -Wall -g

ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -O0
else
	CFLAGS += -O2
endif

build-arch:

build-indep:
	dh_testdir
	
	$(MAKE) CROSS_COMPILE="$(CROSS_PREFIX)" CFLAGS="$(CFLAGS)"

build: build-arch build-indep

clean:
	dh_testdir
	dh_testroot
	
	$(MAKE) clean CROSS_COMPILE="$(CROSS_PREFIX)"
	$(RM) ppc_rom.bin
	
	dh_clean

binary-arch: build-arch
# Nothing to do

binary-indep: build-indep
	dh_testdir
	dh_testroot
	dh_prep
	
	dh_installdirs
	dh_installchangelogs Changelog
	dh_installdocs
	dh_install
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary: binary-indep binary-arch

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