#!/usr/bin/make -f # Gecode for Debian/GNU # Guido Tack # needed if dpkg-buildpackage is not used export DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) # cross-compilation ifeq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE)) configure_options += --build $(DEB_BUILD_GNU_TYPE) else configure_options += --host $(DEB_HOST_GNU_TYPE) --build $(DEB_BUILD_GNU_TYPE) endif # generic Debian directories DEB_BASE_DIR = $(CURDIR) DEB_DEBIAN_DIR = $(DEB_BASE_DIR)/debian DEB_SOURCE_DIR = $(DEB_BASE_DIR) DEB_BUILD_DIR = $(DEB_DEBIAN_DIR)/BUILD DEB_INSTALL_DIR = $(DEB_DEBIAN_DIR)/INSTALL # generic targets configure: configure-stamp configure-stamp: dh_testdir -mkdir $(DEB_BUILD_DIR) cd $(DEB_BUILD_DIR) && \ $(DEB_SOURCE_DIR)/configure --prefix=/usr $(configure_options) echo > $@ build: build-stamp build-stamp: configure-stamp dh_testdir cd $(DEB_BUILD_DIR) && $(MAKE) echo > $@ install: install-stamp install-stamp: build-stamp dh_testdir dh_testroot dh_clean dh_installdirs -mkdir $(DEB_INSTALL_DIR) cd $(DEB_BUILD_DIR) && $(MAKE) install DESTDIR=$(DEB_INSTALL_DIR) echo > $@ clean: dh_testdir dh_testroot rm -f configure-stamp build-stamp install-stamp rm -rf $(DEB_BUILD_DIR) $(DEB_INSTALL_DIR) -$(MAKE) distclean dh_clean # package-specific targets binary-arch: build install dh_testdir dh_testroot dh_install --sourcedir=$(DEB_INSTALL_DIR) dh_installdocs dh_installchangelogs dh_strip dh_compress dh_fixperms dh_installdeb dh_makeshlibs -V dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb binary: binary-arch .PHONY: configure build install clean binary-arch binary