Makefile revision 715e49c31b15c23c17a9ce3be42a75e7c48d4b78
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington# Makefile for the VirtualBox Linux Host Drivers.
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington# Copyright (C) 2008-2010 Oracle Corporation
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington# This file is part of VirtualBox Open Source Edition (OSE), as
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington# available from http://www.virtualbox.org. This file is free software;
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington# you can redistribute it and/or modify it under the terms of the GNU
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington# General Public License (GPL) as published by the Free Software
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington# Foundation, in version 2 as it comes in the "COPYING" file of the
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellingtonifneq ($(wildcard $(KBUILD_EXTMOD)/vboxnetflt/Makefile),)
7332e47e11ceb87928f801b925269aa6a91838b1David Lawrenceifneq ($(wildcard $(KBUILD_EXTMOD)/vboxnetadp/Makefile),)
7332e47e11ceb87928f801b925269aa6a91838b1David Lawrenceifneq ($(wildcard $(KBUILD_EXTMOD)/vboxpci/Makefile),)
7332e47e11ceb87928f801b925269aa6a91838b1David Lawrenceelse # ! KBUILD_EXTMOD
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington# convenience Makefile without DKMS
c2bc56dc65b4b103a5600565680eb5f33fa4c90bMark Andrews @echo "*** Building 'vboxdrv' module ***"
c2bc56dc65b4b103a5600565680eb5f33fa4c90bMark Andrews @$(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxdrv
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington @if [ -d vboxnetflt ]; then \
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington echo "*** Building 'vboxnetflt' module ***"; \
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxnetflt; \
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington @if [ -d vboxnetadp ]; then \
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington echo "*** Building 'vboxnetadp' module ***"; \
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxnetadp; \
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington @if [ -d vboxpci ]; then \
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington echo "*** Building 'vboxpci' module ***"; \
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxpci; \
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington @$(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxdrv install
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington @if [ -d vboxnetflt ]; then \
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxnetflt install; \
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington @if [ -d vboxnetadp ]; then \
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxnetadp install; \
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington @if [ -d vboxpci ]; then \
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxpci install; \
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington @if [ -d vboxnetflt ]; then \
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington @if [ -d vboxnetadp ]; then \
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington @if [ -d vboxpci ]; then \
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington rm -f vboxdrv.ko vboxnetflt.ko vboxnetadp.ko vboxpci.ko
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington @$(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxdrv check
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington @for module in vboxpci vboxnetadp vboxnetflt vboxdrv; do \
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington if grep "^$$module " /proc/modules >/dev/null; then \
1b4e6163bed546ca7f8ad186f3eabfebacc36bc1Brian Wellington echo "Removing previously installed $$module module"; \
532989b206894bdaf6de6cb883d2e31169c4bfacAndreas Gustafsson @for module in vboxdrv vboxnetflt vboxnetadp vboxpci; do \
532989b206894bdaf6de6cb883d2e31169c4bfacAndreas Gustafsson echo "Installing $$module module"; \