rules revision 917d66601860f75830cb684385ba7b4d73458bca
ed22c7109fc5dd9e1b7a5d0333bdc7ad2718e2abYuri Pankov# Copyright (C) 2006-2008 Sun Microsystems, Inc.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# This file is part of VirtualBox Open Source Edition (OSE), as
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# available from http://www.virtualbox.org. This file is free software;
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# you can redistribute it and/or modify it under the terms of the GNU
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# General Public License as published by the Free Software Foundation,
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
ed22c7109fc5dd9e1b7a5d0333bdc7ad2718e2abYuri Pankov# distribution. VirtualBox OSE is distributed in the hope that it will
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# be useful, but WITHOUT ANY WARRANTY of any kind.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#export DH_VERBOSE=1
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# possible overrides:
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# OSE=1 force VBOX_OSE
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# NOPARALLEL=1 compile with -j1
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# LINUX=<dir> compile vboxdrv against Linux found in <dir>
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# VERBOSE=1 verbose build
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# DEBUG=1 debug build
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# NOSUBVER=1 disable generation of the sub-version field (which is
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# either the subversion rev [if available] or the build date)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# NODOCS=1 don't build docs, use precompiled UserManual.pdf and
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# NOMODS=1 don't build any module
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# NOQT=1 don't build the Qt GUI
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# HEADLESS=1 build the headless version
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# STAGEDISO=<path> don't build the VBoxAdditions, use the precompiled .iso
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe ifeq ($(wildcard $(STAGEDISO)/VBoxGuestAdditions.iso),)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(error STAGEDISO='$(STAGEDISO)/VBoxGuestAdditions.iso' not found)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Hack: Xandros is actually Debian/sarge ... :(
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweifneq ($(wildcard /etc/xandros-desktop-version),)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe debrel := $(if $(shell which lsb_release),_$(shell lsb_release -si)_$(shell lsb_release -sc),unknown)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowedebcfgs := VBOX_PATH_PACKAGE_DOCS="\"/usr/share/doc/$(verpkg)\""
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Ubuntu dapper: gcc-4.0 does not work with recompiler, use gcc-3.4 instead
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Ubuntu gutsy: gcc-4.1 does not work for the webservices, use gcc-4.2 instead
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe cd $(vboxroot) && ./configure --odir=$(current)/debian $(if \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(ose),--ose,) $(if $(LINUX),--with-linux=$(LINUX),) $(if \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(filter _Ubuntu_dapper,$(debrel)),--with-gcc=gcc-3.4 --with-g++=g++-3.4,) $(if \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(filter _Ubuntu_gutsy,$(debrel)),--with-gcc=gcc-4.2 --with-g++=g++-4.2,) $(if \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(filter _xandros4.1 _ucs1.3,$(debrel)),--disable-sdl-ttf,) $(if \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(HEADLESS),--build-headless,) $(if $(DEBUG),--build-debug,)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowebuild: debian/configure-stamp debian/build-stamp
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(VERBOSE),--print-directory,--no-print-directory) $(if \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(if $(NODOCS),cp $(vboxroot)/prebuild/UserManual.pdf $(builddir)/bin,)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(if $(NODOCS),cp $(vboxroot)/prebuild/VirtualBox.chm $(builddir)/bin,)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(if $(STAGEDISO),cp $(STAGEDISO)/VBoxGuestAdditions.iso $(builddir)/bin/additions,)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(VERBOSE),--print-directory,--no-print-directory) $(if \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Build modules for every kernel we find in /lib/modules/*
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe make -C $(builddir)/bin/src/vboxdrv KERN_DIR=$$d/build MODULE_DIR=$$d clean && \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe make -C $(builddir)/bin/src/vboxdrv KBUILD_VERBOSE= KERN_DIR=$$d/build MODULE_DIR=$$d all && \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(builddir)/bin/src/vboxdrv/vboxdrv.ko $(moddir)/$$(basename $$d)/vboxdrv.ko && \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe make -C $(builddir)/bin/src/vboxnetflt KERN_DIR=$$d/build MODULE_DIR=$$d clean && \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe (cp $(builddir)/bin/src/vboxdrv/Module.symvers $(builddir)/bin/src/vboxnetflt || true) && \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe make -C $(builddir)/bin/src/vboxnetflt KBUILD_VERBOSE= KERN_DIR=$$d/build MODULE_DIR=$$d all && \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(builddir)/bin/src/vboxnetflt/vboxnetflt.ko $(moddir)/$$(basename $$d)/vboxnetflt.ko; \
dh_clean -k
sed \
install -D -g 0 -o 0 -m 0644 \
install -D -g 0 -o 0 -m 0644 \
dh_link \
sed \
dh_strip --keep-debug --exclude=libVBoxQtCore.so.4 --exclude=libVBoxQtGui.so.4 --exclude=libVBoxQtNetwork.so.4 --exclude=libqtaccessiblewidgets.so
for f in \
dh_gencontrol -- \