#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.

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

ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)

CFLAGS = -Wall -g

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -O0
else
	CFLAGS += -O2
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
	INSTALL_PROGRAM += -s
endif

#CONFIGURE#

build: build-stamp

build-stamp:
	make all
	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	make clean
	rm -f build-stamp

	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	# Add here commands to install the package into debian/#PACKAGE#.
	install -m0755 gcc-3.3 debian/gcc-opt/usr/bin
	install -m0755 g++-3.3 debian/gcc-opt/usr/bin
	install -m0755 gcc-3.4 debian/gcc-opt/usr/bin
	install -m0755 g++-3.4 debian/gcc-opt/usr/bin
	install -m0755 gcc-4.0 debian/gcc-opt/usr/bin
	install -m0755 g++-4.0 debian/gcc-opt/usr/bin
	if [ -f gcc-opt.conf.${ARCH} ]; then \
	  install -m0644 gcc-opt.conf.${ARCH} debian/gcc-opt/usr/share/gcc-opt/gcc-opt.conf.dist; \
	else \
	  install -m0644 gcc-opt.conf debian/gcc-opt/usr/share/gcc-opt/gcc-opt.conf.dist; \
	fi

# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.

# Build architecture-dependent files here.
binary-arch: build install
	dh_testdir -a
	dh_testroot -a
	dh_installchangelogs -a #CHANGELOGS#
	dh_installdocs -a
	dh_installexamples -a
#	dh_install -a
#	dh_installmenu -a
#	dh_installdebconf	 -a
#	dh_installlogrotate -a
#	dh_installemacsen -a
#	dh_installpam -a
#	dh_installmime -a
#	dh_installinit -a
#	dh_installcron -a
#	dh_installinfo -a
	dh_installman -a
	dh_link -a
	dh_strip -a
	dh_compress -a
	dh_fixperms -a
#	dh_perl -a
#	dh_python -a
#	dh_makeshlibs -a
	dh_installdeb -a
	dh_shlibdeps -a
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

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