#!/usr/bin/make -f # debian/rules for the Debian mesa package # Copyright © 2006 Thierry Reding # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 CFLAGS = -Wall -g ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS))) CFLAGS += -O0 else CFLAGS += -O2 endif ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) MAKEFLAGS += -j$(NUMJOBS) endif DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH) DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH) DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS) DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) DEB_HOST_GNU_CPU ?= $(shell dpkg-architecture -qDEB_HOST_GNU_CPU) DEB_BUILD_DIR ?= $(CURDIR)/obj-$(DEB_BUILD_GNU_TYPE) ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE)) confflags += --build=$(DEB_HOST_GNU_TYPE) else confflags += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) endif # choose which configurations to build include debian/scripts/choose-configs # build the following configurations by default CONFIGS = $(SWX11_GLU_CONFIGS) \ dri \ osmesa \ osmesa-static \ osmesa16 \ osmesa16-static \ osmesa32 \ osmesa32-static STAMP_DIR = debian/stamp STAMP = $(STAMP_DIR)/$(DEB_BUILD_GNU_TYPE) BUILD_STAMPS = $(addprefix $(STAMP)-build-, $(CONFIGS)) QUILT_STAMPFN = $(STAMP_DIR)/patch include /usr/share/quilt/quilt.make # temporary until we figure out what to build confflags += --disable-gallium confflags-common = \ --disable-egl \ --disable-glu \ --disable-glut \ --disable-glw \ CFLAGS="$(CFLAGS)" DRI_DRIVERS = swrast # hurd doesn't do direct rendering ifeq ($(DEB_HOST_ARCH_OS), hurd) DIRECT_RENDERING = --disable-driglx-direct else DIRECT_RENDERING = --enable-driglx-direct ifeq ($(DEB_HOST_ARCH), lpia) DRI_DRIVERS += i915 i965 else ifneq ($(DEB_HOST_ARCH), s390) DRI_DRIVERS += mach64 mga r128 r200 r300 r600 radeon savage tdfx ifeq ($(DEB_HOST_GNU_CPU), i486) DRI_DRIVERS += i810 i915 i965 sis unichrome else ifeq ($(DEB_HOST_GNU_CPU), x86_64) DRI_DRIVERS += i915 i965 sis unichrome else ifeq ($(DEB_HOST_ARCH), sparc) DRI_DRIVERS += ffb else ifeq ($(DEB_HOST_ARCH), sparc64) DRI_DRIVERS += ffb endif endif endif confflags-dri = \ --with-driver=dri \ --with-dri-drivers="$(DRI_DRIVERS)" \ --with-demos=xdemos \ --libdir=/usr/lib/glx \ --with-dri-driverdir=/usr/lib/dri \ --enable-glx-tls \ $(DIRECT_RENDERING) \ $(confflags-common) confflags-osmesa = \ --with-driver=osmesa \ --with-demos= \ $(confflags-common) confflags-osmesa-static = \ --with-driver=osmesa \ --enable-static \ --with-demos= \ $(confflags-common) confflags-osmesa16 = \ --with-driver=osmesa \ --with-osmesa-bits=16 \ --with-demos= \ $(confflags-common) confflags-osmesa16-static = \ --with-driver=osmesa \ --with-osmesa-bits=16 \ --enable-static \ --with-demos= \ $(confflags-common) confflags-osmesa32 = \ --with-driver=osmesa \ --with-osmesa-bits=32 \ --with-demos= \ $(confflags-common) confflags-osmesa32-static = \ --with-driver=osmesa \ --with-osmesa-bits=32 \ --enable-static \ --with-demos= \ $(confflags-common) confflags-swx11+glu = \ --with-driver=xlib \ --disable-gl-osmesa \ --with-demos= \ --disable-egl \ --disable-glut \ --enable-motif \ CFLAGS="$(CFLAGS)" confflags-swx11+glu-static = \ --with-driver=xlib \ --disable-gl-osmesa \ --enable-static \ --with-demos= \ --disable-egl \ --disable-glut \ --enable-motif \ CFLAGS="$(CFLAGS)" confflags-swx11+glu-i386-i686 = \ --with-driver=xlib \ --disable-gl-osmesa \ --with-demos= \ --disable-glut \ --disable-egl \ --enable-motif \ --libdir=/usr/lib/i686/cmov \ CFLAGS="$(CFLAGS) -march=i686" configure: $(QUILT_STAMPFN) configure.ac autoreconf -vfi # list the configurations that will built configs: @echo Building the following configurations: $(CONFIGS) $(STAMP_DIR)/stamp: dh_testdir mkdir -p $(STAMP_DIR) >$@ $(QUILT_STAMPFN): $(STAMP_DIR)/stamp build: $(BUILD_STAMPS) $(STAMP)-build-%: configure dh_testdir mkdir -p $(DEB_BUILD_DIR)/$* find $(CURDIR)/* -maxdepth 0 -not -path '$(DEB_BUILD_DIR)*' | \ xargs cp -rlf -t $(DEB_BUILD_DIR)/$* cd $(DEB_BUILD_DIR)/$* && \ ../../configure --prefix=/usr --mandir=\$${prefix}/share/man \ --infodir=\$${prefix}/share/info --sysconfdir=/etc \ --localstatedir=/var $(confflags) $(confflags-$*) cd $(DEB_BUILD_DIR)/$* && $(MAKE) touch $@ install: build # Add here commands to install the package into debian/tmp dh_testdir dh_testroot dh_clean -k dh_installdirs set -e; for config in $(CONFIGS); do \ $(MAKE) -C $(DEB_BUILD_DIR)/$$config DESTDIR=$(CURDIR)/debian/tmp install; \ done clean: unpatch dh_testdir dh_testroot rm -rf .pc rm -f config.cache config.log config.status rm -f */config.cache */config.log */config.status rm -f conftest* */conftest* rm -rf autom4te.cache */autom4te.cache rm -rf obj-* rm -rf configure config.guess config.sub config.h.in rm -rf $$(find -name Makefile.in) rm -rf aclocal.m4 missing depcomp install-sh ltmain.sh rm -rf $(STAMP_DIR) dh_clean # Build architecture-independent files here. binary-indep: install # Build architecture-dependent files here. binary-arch: install dh_testdir dh_testroot dh_installchangelogs -s dh_installchangelogs -pmesa-common-dev ChangeLog dh_installdocs -s dh_installexamples -s dh_install -s --sourcedir=debian/tmp --list-missing dh_installman -s dh_lintian -s dh_link -s dh_strip -plibgl1-mesa-swx11 --dbg-package=libgl1-mesa-swx11-dbg dh_strip -plibgl1-mesa-glx --dbg-package=libgl1-mesa-glx-dbg dh_strip -plibgl1-mesa-dri --dbg-package=libgl1-mesa-dri-dbg dh_strip -s dh_compress -s dh_fixperms -s dh_makeshlibs -s dh_installdeb -s dh_shlibdeps -s dh_gencontrol -s dh_md5sums -s dh_builddeb -s binary: binary-indep binary-arch .PHONY: configs build clean binary-indep binary-arch binary install