#!/usr/bin/make -f

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

%:
	dh $@

build: build-arch build-indep

build-arch:
	$(MAKE) -f makefile.shared

build-indep:
	$(MAKE) manual docs DESTDIR=$(CURDIR)/debian/tmp

override_dh_auto_install:
	$(MAKE) -f makefile.shared INSTALL_GROUP=root DESTDIR=$(CURDIR)/debian/tmp install

# Override if not processing -docs
ifeq (,$(findstring libtommath-docs, $(shell dh_listpackages)))
override_dh_install:
	dh_install --sourcedir=debian/tmp
endif

override_dh_clean:
	dh_clean tommath.out

override_dh_installchangelogs:
	dh_installchangelogs changes.txt

