#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# 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
export DH_OPTIONS

CFLAGS=-g
export CFLAGS
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
  IGNORE_SPEED=yes
  export IGNORE_SPEED
endif

# shared library versions, option 1
version=0.39
major=0

build: build-arch build-indep
build-indep:
	dh_testdir
	$(MAKE) manual docs
build-arch:
	dh_testdir
	$(MAKE) -f makefile.shared

clean:
	dh_testdir
	dh_testroot
	$(MAKE) clean
	dh_clean tommath.out

install: build-arch
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs
	$(MAKE) -f makefile.shared INSTALL_GROUP=root DESTDIR=$(CURDIR)/debian/tmp install

# Build architecture-independent files here.
binary-indep: DH_OPTIONS=-i
binary-indep: build-indep
	dh_testdir
	dh_testroot
	dh_installchangelogs changes.txt
	dh_installdocs
	dh_installexamples
	dh_install
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

# Build architecture-dependent files here.
binary-arch: DH_OPTIONS=-a
binary-arch: build-arch install
	dh_testdir
	dh_testroot
	dh_installchangelogs changes.txt
	dh_installdocs
	dh_installexamples
	dh_install --sourcedir=debian/tmp
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
	dh_makeshlibs
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

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