#!/usr/bin/make -f
# $Id: rules,v 1.3 2004/06/29 20:27:02 alpha Exp $
#
# Copyright (c) 1999-2004 Darius Rad
#
# This file is part of the OpenOtto project.
#
# OpenOtto is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#

CC = gcc
CFLAGS = -g -Wall

ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
  CFLAGS += -O2
endif

#export DH_VERBOSE=1

clean:
	dh_testdir
	dh_clean
	rm -f build
	-$(MAKE) -i distclean

install: build
	dh_clean
	dh_installdirs
	$(MAKE) prefix=$(CURDIR)/debian/tmp/usr \
		mandir=$(CURDIR)/debian/tmp/usr/share/man \
		infodir=$(CURDIR)/debian/tmp/usr/share/info \
		install

build:
#	./configure --prefix=/usr
	$(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS)"
	touch build

binary-indep: install
	dh_testdir -i
	dh_testroot -i
	dh_installdirs -i
	dh_installdocs -i
	dh_installchangelogs -i
	dh_installcron -i
	dh_installlogcheck -i
	dh_installlogrotate -i
	dh_install -i
#	dh_strip -i
#	dh_makeshlibs -i
	dh_compress -i
	dh_fixperms -i
	dh_installdeb -i
	dh_shlibdeps -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

binary-arch: install
# no architecture dependent packages

# Below here is fairly generic really

binary:	binary-indep binary-arch

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