Makefile revision df8125e892bb3613b87c0852affe4578a8edb749
2ronwalf#
2ronwalf# Makefile for the VirtualBox Linux Host Drivers.
2ronwalf#
2ronwalf
2ronwalf#
2ronwalf#
2ronwalf# Copyright (C) 2008-2010 Oracle Corporation
2ronwalf#
2ronwalf# This file is part of VirtualBox Open Source Edition (OSE), as
2ronwalf# available from http://www.virtualbox.org. This file is free software;
2ronwalf# you can redistribute it and/or modify it under the terms of the GNU
2ronwalf# General Public License (GPL) as published by the Free Software
2ronwalf# Foundation, in version 2 as it comes in the "COPYING" file of the
2ronwalf# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
2ronwalf# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
2ronwalf#
2ronwalf
2ronwalfifneq ($(KBUILD_EXTMOD),)
2ronwalf
2ronwalf# DKMS
2ronwalf
2ronwalfobj-m = vboxdrv/
2ronwalfifneq ($(wildcard $(KBUILD_EXTMOD)/vboxnetflt/Makefile),)
2ronwalf obj-m += vboxnetflt/
2ronwalfendif
2ronwalfifneq ($(wildcard $(KBUILD_EXTMOD)/vboxnetadp/Makefile),)
2ronwalf obj-m += vboxnetadp/
2ronwalfendif
2ronwalfifneq ($(wildcard $(KBUILD_EXTMOD)/vboxpci/Makefile),)
2ronwalf obj-m += vboxpci/
2ronwalfendif
2ronwalfelse # ! KBUILD_EXTMOD
2ronwalf
2ronwalf# convenience Makefile without DKMS
2ronwalf
2ronwalfKBUILD_VERBOSE =
2ronwalf
2ronwalfall:
2ronwalf @echo "*** Building 'vboxdrv' module ***"
2ronwalf @$(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxdrv
2ronwalf @cp vboxdrv/vboxdrv.ko .
2ronwalf @echo
2ronwalf @if [ -d vboxnetflt ]; then \
2ronwalf if [ -f vboxdrv/Module.symvers ]; then \
2ronwalf cp vboxdrv/Module.symvers vboxnetflt; \
2ronwalf fi; \
2ronwalf echo "*** Building 'vboxnetflt' module ***"; \
2ronwalf $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxnetflt; \
2ronwalf cp vboxnetflt/vboxnetflt.ko .; \
2ronwalf echo; \
2ronwalf fi
2ronwalf @if [ -d vboxnetadp ]; then \
2ronwalf if [ -f vboxdrv/Module.symvers ]; then \
2ronwalf cp vboxdrv/Module.symvers vboxnetadp; \
2ronwalf fi; \
2ronwalf echo "*** Building 'vboxnetadp' module ***"; \
2ronwalf $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxnetadp; \
2ronwalf cp vboxnetadp/vboxnetadp.ko .; \
2ronwalf echo; \
2ronwalf fi
2ronwalf @if [ -d vboxpci ]; then \
2ronwalf if [ -f vboxdrv/Module.symvers ]; then \
2ronwalf cp vboxdrv/Module.symvers vboxpci; \
2ronwalf fi; \
2ronwalf echo "*** Building 'vboxpci' module ***"; \
2ronwalf $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxpci; \
2ronwalf cp vboxpci/vboxpci.ko .; \
2ronwalf echo; \
2ronwalf fi
2ronwalf
2ronwalf
2ronwalfinstall:
2ronwalf @$(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxdrv install
2ronwalf @if [ -d vboxnetflt ]; then \
2ronwalf $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxnetflt install; \
2ronwalf fi
2ronwalf @if [ -d vboxnetadp ]; then \
2ronwalf $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxnetadp install; \
2ronwalf fi
2ronwalf @if [ -d vboxpci ]; then \
2ronwalf $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxpci install; \
2ronwalf fi
2ronwalf
2ronwalfclean:
2ronwalf @$(MAKE) -C vboxdrv clean
2ronwalf @if [ -d vboxnetflt ]; then \
2ronwalf $(MAKE) -C vboxnetflt clean; \
2ronwalf fi
2ronwalf @if [ -d vboxnetadp ]; then \
2ronwalf $(MAKE) -C vboxnetadp clean; \
2ronwalf fi
2ronwalf @if [ -d vboxpci ]; then \
2ronwalf $(MAKE) -C vboxpci clean; \
2ronwalf fi
2ronwalf rm -f vboxdrv.ko vboxnetflt.ko vboxnetadp.ko vboxpci.ko
2ronwalf
2ronwalfunload:
2ronwalf @for module in vboxpci vboxnetadp vboxnetflt vboxdrv; do \
2ronwalf if grep "^$$module " /proc/modules >/dev/null; then \
4daenzerorama echo "Removing previously installed $$module module"; \
2ronwalf /sbin/rmmod $$module; \
2ronwalf fi; \
2ronwalf done
3daenzerorama
3daenzeroramaload: unload
2ronwalf @for module in vboxdrv vboxnetflt vboxnetadp vboxpci; do \
2ronwalf if test -f $$module.ko; then \
2ronwalf echo "Installing $$module module"; \
2ronwalf /sbin/insmod $$module.ko; \
2ronwalf fi; \
2ronwalf done
4daenzerorama
2ronwalfendif # ! KBUILD_EXTMOD
2ronwalf