Makefile revision 8ac4ac6569dd1377414fbf9369516addbb47b789
98N/A#
98N/A# Makefile for the VirtualBox Linux Guest Drivers.
98N/A#
98N/A
493N/A#
98N/A#
98N/A# Copyright (C) 2009-2010 Oracle Corporation
98N/A#
98N/A# This file is part of VirtualBox Open Source Edition (OSE), as
98N/A# available from http://www.virtualbox.org. This file is free software;
98N/A# you can redistribute it and/or modify it under the terms of the GNU
98N/A# General Public License (GPL) as published by the Free Software
98N/A# Foundation, in version 2 as it comes in the "COPYING" file of the
98N/A# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
98N/A# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
98N/A#
98N/A
98N/Aifneq ($(KBUILD_EXTMOD),)
98N/A
98N/A# DKMS
98N/A
98N/Aobj-m = vboxguest/ vboxsf/ vboxvideo/
98N/A
98N/Aelse # ! KBUILD_EXTMOD
98N/A
98N/AKBUILD_VERBOSE =
98N/A
98N/Aall:
98N/A @echo "*** Building 'vboxguest' module ***"
98N/A @$(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxguest
98N/A @if [ -f vboxguest/vboxguest.ko ]; then \
98N/A cp vboxguest/vboxguest.ko .; \
493N/A else \
98N/A cp vboxguest/vboxguest.o .; \
98N/A fi
98N/A @echo
493N/A @if [ -d vboxsf ]; then \
98N/A if [ -f vboxguest/Module.symvers ]; then \
98N/A cp vboxguest/Module.symvers vboxsf; \
493N/A fi; \
98N/A echo "*** Building 'vboxsf' module ***"; \
98N/A $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxsf; \
98N/A if [ -f vboxsf/vboxsf.ko ]; then \
98N/A cp vboxsf/vboxsf.ko .; \
98N/A else \
98N/A cp vboxsf/vboxsf.o .; \
493N/A fi; \
493N/A echo; \
98N/A fi
98N/A @if [ -d vboxvideo ]; then \
if [ -f vboxguest/Module.symvers ]; then \
cp vboxguest/Module.symvers vboxvideo; \
fi; \
echo "*** Building 'vboxvideo' module ***"; \
$(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxvideo; \
if [ -f vboxvideo/vboxvideo.ko ]; then \
cp vboxvideo/vboxvideo.ko .; \
else \
cp vboxvideo/vboxvideo.o .; \
fi; \
echo; \
fi
install:
@$(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxguest install
@if [ -d vboxsf ]; then \
$(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxsf install; \
fi
@if [ -d vboxvideo ]; then \
$(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxvideo install; \
fi
clean:
@$(MAKE) -C vboxguest clean
@if [ -d vboxsf ]; then \
$(MAKE) -C vboxsf clean; \
fi
@if [ -d vboxvideo ]; then \
$(MAKE) -C vboxvideo clean; \
fi
rm -f vboxguest.*o vboxsf.*o vboxvideo.*o
check:
@$(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxguest check
load:
@/sbin/rmmod vboxvideo || true
@/sbin/rmmod vboxvfs || true
@/sbin/rmmod vboxsf || true
@/sbin/rmmod vboxguest || true
@/sbin/insmod vboxguest.ko
@if [ -f vboxsf.ko ]; then /sbin/insmod vboxsf.ko; fi
@if [ -f vboxvideo.ko ]; then /sbin/insmod vboxvideo.ko; fi
endif # ! KBUILD_EXTMOD