rules revision cb1c9aee152f51cd97c07794ca4e0441b2444b0c
3a666413480ef97101461705e1f47cbab0266301Brendan Mmiller# Copyright (C) 2006-2009 Sun Microsystems, Inc.
3a666413480ef97101461705e1f47cbab0266301Brendan Mmiller# This file is part of VirtualBox Open Source Edition (OSE), as
3a666413480ef97101461705e1f47cbab0266301Brendan Mmiller# available from http://www.virtualbox.org. This file is free software;
3a666413480ef97101461705e1f47cbab0266301Brendan Mmiller# you can redistribute it and/or modify it under the terms of the GNU
3a666413480ef97101461705e1f47cbab0266301Brendan Mmiller# General Public License as published by the Free Software Foundation,
3a666413480ef97101461705e1f47cbab0266301Brendan Mmiller# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
3a666413480ef97101461705e1f47cbab0266301Brendan Mmiller# distribution. VirtualBox OSE is distributed in the hope that it will
3a666413480ef97101461705e1f47cbab0266301Brendan Mmiller# be useful, but WITHOUT ANY WARRANTY of any kind.
3a666413480ef97101461705e1f47cbab0266301Brendan Mmiller#export DH_VERBOSE=1
3a666413480ef97101461705e1f47cbab0266301Brendan Mmiller# possible overrides:
a20f25a11beaf0445cc53f4d56537cef3d26281eBrendan Mmiller# OSE=1 force VBOX_OSE
f39dc15e901a18aaac2ef6ca0d668bff5d35a9e4Brendan Mmiller# NOPARALLEL=1 compile with -j1
f39dc15e901a18aaac2ef6ca0d668bff5d35a9e4Brendan Mmiller# LINUX=<dir> compile vboxdrv against Linux found in <dir>
21dcdac963f79c098a5ea1a2c5c5e109429c9786Brendan Miller# VERBOSE=1 verbose build
21dcdac963f79c098a5ea1a2c5c5e109429c9786Brendan Miller# DEBUG=1 debug build
088fa5d9eaa83bf4b3d59a64c0519f42a143aaa9Alin Brici# NOSUBVER=1 disable generation of the sub-version field (which is
bfd9faff49961e9db7b92f310d59923fd6234372Brendan Mmiller# either the subversion rev [if available] or the build date)
bfd9faff49961e9db7b92f310d59923fd6234372Brendan Mmiller# NODOCS=1 don't build docs, use precompiled UserManual.pdf and
3a666413480ef97101461705e1f47cbab0266301Brendan Mmiller# NOMODS=1 don't build any module
3a666413480ef97101461705e1f47cbab0266301Brendan Mmiller# NOQT=1 don't build the Qt GUI
3a666413480ef97101461705e1f47cbab0266301Brendan Mmiller# HEADLESS=1 build the headless version
bfd9faff49961e9db7b92f310d59923fd6234372Brendan Mmiller# NOWEBSVC=1 don't build the webservice API, default for OSE
bfd9faff49961e9db7b92f310d59923fd6234372Brendan Mmiller# STAGEDISO=<path> don't build the VBoxAdditions, use the precompiled .iso
3a666413480ef97101461705e1f47cbab0266301Brendan Mmiller# BLEEDING_EDGE=xyz
3a666413480ef97101461705e1f47cbab0266301Brendan MmillerNOWINE := $(if $(NODOCS),$(if $(STAGEDISO),1,),)$(ose)
a20f25a11beaf0445cc53f4d56537cef3d26281eBrendan Mmiller ifeq ($(wildcard $(STAGEDISO)/VBoxGuestAdditions.iso),)
a20f25a11beaf0445cc53f4d56537cef3d26281eBrendan Mmiller $(error STAGEDISO='$(STAGEDISO)/VBoxGuestAdditions.iso' not found)
a20f25a11beaf0445cc53f4d56537cef3d26281eBrendan Mmiller# Hack: Xandros is actually Debian/sarge ... :(
a20f25a11beaf0445cc53f4d56537cef3d26281eBrendan Mmillerifneq ($(wildcard /etc/xandros-desktop-version),)
3a666413480ef97101461705e1f47cbab0266301Brendan Mmiller debrel := $(if $(shell which lsb_release),_$(shell lsb_release -si)_$(shell lsb_release -sc),unknown)
3a666413480ef97101461705e1f47cbab0266301Brendan Mmiller# shipping Linux kernel modules with bleeding-edge releases doesn't make sense
80a21b2f138c5017c1d929d4879bfc686d6841ebBrendan Millerinstmod := $(if $(filter _Ubuntu_karmic _Debian_sid,$(debrel)),,1)
3a666413480ef97101461705e1f47cbab0266301Brendan Mmiller# Locations of custom built Qt libraries (see below)
bfd9faff49961e9db7b92f310d59923fd6234372Brendan Mmillerqtstdc5 := /home/vbox/Qt-4.4.3-stdc++5-$(arch)
bfd9faff49961e9db7b92f310d59923fd6234372Brendan Mmillerqtstdc6 := /home/vbox/Qt-4.4.3-stdc++6-$(arch)
bfd9faff49961e9db7b92f310d59923fd6234372Brendan Mmiller $(if $(ose),--ose,) $(if $(LINUX),--with-linux=$(LINUX),) \
80a21b2f138c5017c1d929d4879bfc686d6841ebBrendan Miller $(if $(filter _Ubuntu_dapper,$(debrel)),--with-gcc=gcc-3.4 --with-g++=g++-3.4,) \
bfd9faff49961e9db7b92f310d59923fd6234372Brendan Mmiller $(if $(filter _Ubuntu_gutsy,$(debrel)),--with-gcc=gcc-4.2 --with-g++=g++-4.2,) \
bfd9faff49961e9db7b92f310d59923fd6234372Brendan Mmiller $(if $(filter _xandros4.1 _ucs1.3 _Debian_sarge _Ubuntu_dapper,$(debrel)),--build-libxml2,) \
bfd9faff49961e9db7b92f310d59923fd6234372Brendan Mmiller $(if $(filter _xandros4.1 _ucs1.3 _Debian_sarge _Ubuntu_dapper,$(debrel)),--build-libxslt,) \
3a666413480ef97101461705e1f47cbab0266301Brendan Mmiller $(if $(filter _Debian_etch,$(debrel)),$(if $(ose),,--build-libcurl),) \
bfd9faff49961e9db7b92f310d59923fd6234372Brendan Mmiller $(if $(filter _Debian_sarge _xandros4.1 _ucs1.3,$(debrel)),--with-qt4-dir=$(qtstdc5)) \
0c5e7ab011ba63c40aeb6c924bb888b21e481f59Brendan Mmiller $(if $(filter _Debian_etch _Ubuntu_dapper _Ubuntu_edgy _Ubuntu_feisty _Ubuntu_gutsy _Ubuntu_hardy,$(debrel)),--with-qt4-dir=$(qtstdc6)) \
e7bcfc8fc3a59824ed58768c7ef24163fed628cfBrendan Mmiller $(if $(filter _xandros4.1 _ucs1.3,$(debrel)),--disable-sdl-ttf,) \
877835274f73615fe922911749e4de093fb26cceBrendan Mmiller $(if $(filter _Debian_sarge _Ubuntu_dapper _Ubuntu_edgy _xandros4.1 _ucs1.3,$(debrel)),--disable-pulse,) \
dh_clean -k
sed \
if [ -f $$d/vboxdrv.ko -a -f $$d/vboxnetflt.ko -a -f $$d/vboxnetadp.ko ]; then \
install -D -g 0 -o 0 -m 0644 \
install -D -g 0 -o 0 -m 0644 \
install -D -g 0 -o 0 -m 0644 \
dh_link \
sed \
dh_strip --keep-debug --exclude=libQtCoreVBox.so.4 --exclude=libQtGuiVBox.so.4 --exclude=libQtNetworkVBox.so.4 --exclude=libQtOpenGLVBox.so.4 --exclude=libqtaccessiblewidgets.so
for f in \
dh_gencontrol -- \