#!/usr/bin/make -f # # Based on the work by Marcus Brinkmann # Rewritten by Guillem Jover # Rewritten to use `dh' by Pino Toscano # export DEB_CFLAGS_MAINT_PREPEND := -Wall -pipe include /usr/share/dpkg/architecture.mk %: dh $@ -Bbuild NATIVE_ARCHS=i386 hurd-i386 kfreebsd-i386 ifeq ($(DEB_HOST_GNU_TYPE),$(DEB_TARGET_GNU_TYPE)) CONFIGURE_OPTIONS = \ --program-prefix=$(DEB_TARGET_GNU_TYPE)- ARCHS=$(NATIVE_ARCHS) define d_a $(shell dpkg-architecture -a$1 -A$1 -q$2 2> /dev/null) endef else CONFIGURE_OPTIONS = \ --build=$(DEB_BUILD_GNU_TYPE) \ --host=$(DEB_HOST_GNU_TYPE) \ --target=$(DEB_TARGET_GNU_TYPE) CROSSDEP=:$(DEB_TARGET_ARCH) ARCHS=$(DEB_TARGET_ARCH) # The cross compiler at this stage does not have these in its standard include export TARGET_CPPFLAGS = -I/usr/include -I/usr/include/$(DEB_TARGET_GNU_TYPE) -I/usr/include/$(DEB_TARGET_MULTIARCH) define d_a $($2) endef endif debian/control: debian/control.stamp debian/control.stamp: debian/control.in debian/control.native.in debian/control.target.in debian/rules sed -e 's/@crossdep@/$(CROSSDEP)/' < debian/control.in > debian/control echo "#Note: XXX this file is generated from .in files, see debian/rules" >> debian/control ifeq ($(DEB_HOST_GNU_TYPE),$(DEB_TARGET_GNU_TYPE)) cat debian/control.native.in >> debian/control endif $(foreach a,$(ARCHS), \ sed -e 's/@target@/$(call d_a,$a,DEB_TARGET_GNU_TYPE)/' \ -e 's/@debtarget@/$(call d_a,$a,DEB_TARGET_ARCH)/' \ -e 's/@debhost@/$(call d_a,$a,DEB_HOST_ARCH)/' \ < debian/control.target.in >> debian/control ; ) touch $@ override_dh_auto_configure: dh_auto_configure -Bbuild -- \ --libexecdir=/usr/lib/mig/ \ $(CONFIGURE_OPTIONS) ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_TARGET_GNU_TYPE)) build-arch: debian/control.stamp build-indep: build: build-indep build-arch endif override_dh_auto_install: dh_auto_install --destdir=debian/tmp override_dh_install: dh_install dh_install -pmig-$(DEB_TARGET_GNU_TYPE) /usr/lib/mig/$(DEB_TARGET_GNU_TYPE)-migcom dh_install -pmig-$(DEB_TARGET_GNU_TYPE) /usr/bin/$(DEB_TARGET_GNU_TYPE)-mig override_dh_gencontrol: dh_gencontrol -- -V"mig:host=mig-$(DEB_HOST_GNU_TYPE)" override_dh_auto_clean: dh_auto_clean rm -rf build-aux debian/control.stamp