rules revision f1acc1e99894e016bd1a6ee65c56b3fc064fa4eb
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China#!/usr/bin/make -f
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China# Copyright (C) 2006-2011 Oracle Corporation
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China# This file is part of VirtualBox Open Source Edition (OSE), as
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China# available from http://www.virtualbox.org. This file is free software;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China# you can redistribute it and/or modify it under the terms of the GNU
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China# General Public License as published by the Free Software Foundation,
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China# distribution. VirtualBox OSE is distributed in the hope that it will
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China# be useful, but WITHOUT ANY WARRANTY of any kind.
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China# NOTE: if you make changes to this file, please check if the updates should
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China# be also applied to the publicly visible debian/rules file.
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China#export DH_VERBOSE=1
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing Chinaexport DH_COMPAT=4
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China# possible overrides:
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China# OSE=1 force VBOX_OSE
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China# NOPARALLEL=1 compile with -j1
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China# LINUX=<dir> compile vboxdrv against Linux found in <dir>
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China# VERBOSE=1 verbose build
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China# DEBUG=1 debug build
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China# NOSUBVER=1 disable generation of the sub-version field (which is
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China# either the subversion rev [if available] or the build date)
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China# NODOCS=1 don't build docs, use precompiled UserManual.pdf and
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China# VirtualBox.chm from $HOME
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China# NOMODS=1 don't build any module
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China# NOQT=1 don't build the Qt GUI
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China# EFI include the EFI binary from prebuild
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China# VERSUFFIX=<suffix> set a particular package version suffix (e.g. _customer)
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China# HEADLESS=1 build the headless version
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China# NOWEBSVC=1 don't build the webservice API, default for OSE
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China# STAGEDISO=<path> don't build the VBoxAdditions, use the precompiled .iso
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China# PKGDIR=<path> where to store the final package(s)
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China# BLEEDING_EDGE=xyz
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing Chinapackage := virtualbox
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing Chinaverpkg := virtualbox-4.1
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing Chinacurrent := $(shell pwd)
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing Chinavboxroot := $(shell cd ../../../..; pwd)
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing Chinapkgdir := $(if $(PKGDIR),$(PKGDIR),$(shell cd ../../../../..; pwd))
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing Chinabuilddir := $(current)/debian/builddir
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing Chinamoddir := $(current)/debian/modules
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing Chinaarch := $(shell dpkg --print-architecture)
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing Chinaverfile := $(builddir)/version-generated.mk
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing Chinaose := $(if $(OSE),1,$(if $(wildcard $(vboxroot)/src/VBox/RDP/server),,1))
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China-include $(vboxroot)/SVN_REVISION
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing Chinasvnrev :=$(if $(svn_revision),$(svn_revision),0)
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing ChinaNOQT ?= $(HEADLESS)
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing ChinaNOWEBSVC ?= $(ose)
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing ChinaNOWINE := $(if $(NODOCS),$(if $(STAGEDISO),1,),)
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing Chinaifneq ($(wildcard $(verfile)),)
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing Chinainclude $(verfile)
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing Chinaver := $(VBOX_VERSION_STRING)
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing Chinasvnver := $(if $(NOSUBVER),,$(if $(svn_revision),-$(svn_revision),$(shell if \
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China svn info > /dev/null 2>&1; then \
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China svn info|sed -e "s/^Revision: \(.*\)/-\1/;t;d"; else \
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China date +"-%Y%m%d"; fi)))
7014882c6a3672fd0e5d60200af8643ae53c5928Richard Lowedebver :=$(subst _ALPHA,~alpha,$(subst _BETA,~beta,$(subst _OSE,~ose,$(ver))))$(svnver)$(if \
7014882c6a3672fd0e5d60200af8643ae53c5928Richard Lowe $(BLEEDING_EDGE),-$(BLEEDING_EDGE),)$(VERSUFFIX)$(if \
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing Chinaifneq ($(STAGEDISO),)
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China ifeq ($(wildcard $(STAGEDISO)/VBoxGuestAdditions.iso),)
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China $(error STAGEDISO='$(STAGEDISO)/VBoxGuestAdditions.iso' not found)
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing Chinadebrel := $(if $(shell which lsb_release),_$(shell lsb_release -si)_$(shell lsb_release -sc),unknown)
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China# shipping Linux kernel modules with bleeding-edge releases doesn't make sense
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing Chinainstmod := $(if $(filter _Ubuntu_lucid _Ubuntu_maverick _Ubuntu_natty _Ubuntu_oneiric _Debian_sid,$(debrel)),,1)
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing Chinaifneq ($(MAKECMDGOALS),clean)
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China debdist := $(strip $(shell grep $(debrel) $(current)/distributions_deb | cut -d'=' -f2))
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China ifeq ($(debdist),)
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China $(error package distribution not detected (debrel=$(debrel)))
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China# Location of custom built Qt libraries (see below)
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing Chinaqtstdc6 := /home/vbox/Qt-4.7.4-stdc++6-$(arch)
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing Chinacfg_flags := $(if $(NOQT),--disable-qt,) \
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China $(if $(ose),--ose,) $(if $(LINUX),--with-linux=$(LINUX),) \
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China $(if $(filter _Ubuntu_hardy,$(debrel)),--with-qt4-dir=$(qtstdc6)) \
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China $(if $(HEADLESS),--build-headless,) \
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China $(if $(DEBUG),--build-debug,) \
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China $(if $(NOWINE),,--setup-wine) \
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China $(if $(NOWEBSVC),,--enable-webservice)
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing Chinabld_flags := AUTOCFG=$(current)/debian/AutoConfig.kmk \
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China LOCALCFG=$(current)/debian/LocalConfig.kmk \
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China PATH_OUT=$(current)/debian/builddir \
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China VBOX_WITHOUT_EXTPACK_PUEL_PACKING=1 \
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China VBOX_DO_STRIP= \
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China VBOX_DO_STRIP_MODULES= \
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China VBOX_WITH_MULTIVERSION_PYTHON= \
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China VBOX_PATH_PACKAGE_DOCS="\"/usr/share/doc/$(verpkg)\"" \
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China $(if $(ose),,VBOX_WITH_DOCS_CHM=1) \
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China VBOX_PACKAGE_DIST=$(debdist) \
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China VBOX_SVN_REV=$(svnrev) \
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China $(if $(NODOCS),VBOX_WITH_DOCS= ,)\
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China $(if $(VERBOSE),--print-directory KBUILD_VERBOSE=2,--no-print-directory) \
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China $(if $(STAGEDISO),VBOX_WITHOUT_ADDITIONS=1,) \
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China $(if $(BLEEDING_EDGE),VBOX_BLEEDING_EDGE=$(BLEEDING_EDGE),) \
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China $(if $(filter _Ubuntu_hardy,$(debrel)),,VBOX_WITH_SYSFS_BY_DEFAULT=1)
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing Chinaconfigure: debian/configure-stamp
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing Chinadebian/configure-stamp:
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China cd $(vboxroot) && ./configure --odir=$(current)/debian $(cfg_flags)
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China touch debian/configure-stamp
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing Chinabuild: debian/configure-stamp debian/build-stamp
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing Chinadebian/build-stamp $(verfile):
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China . debian/env.sh && kmk -C $(vboxroot) $(bld_flags) $(if $(NOPARALLEL),-j1,) all
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China $(if $(NODOCS),cp $(vboxroot)/prebuild/UserManual*.pdf $(builddir)/bin,)
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China $(if $(NODOCS),cp $(vboxroot)/prebuild/VirtualBox*.chm $(builddir)/bin,)
dh_clean -k
rmdir $$i; \
sed \
if [ -f $$d/vboxdrv.ko -a -f $$d/vboxnetflt.ko -a -f $$d/vboxnetadp.ko -a -f $$d/vboxpci.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 \
install -D -g 0 -o 0 -m 0644 \
dh_link \
sed \
sed \
$(vboxroot)/src/VBox/Installer/linux/vboxballoonctrl-service.sh.in > debian/vboxballoonctrl-service.init
sed \
-e '/#include installer-common.sh/ {' \
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 \
# for some reason, the Qt libraries couldn't be found on newer releases (e.g. Ubuntu hardy)
dh_gencontrol -- \