VirtualBox

source: vbox/trunk/src/VBox/Additions/linux/Makefile@ 66077

Last change on this file since 66077 was 66077, checked in by vboxsync, 8 years ago

Additions/linux: fail if compiling the vboxsf kernel module fails but intentionally do not fail if compiling the vboxvideo kernel module fails (e.g. too old build environment)

  • Property svn:eol-style set to native
File size: 2.8 KB
Line 
1#
2# Makefile for the VirtualBox Linux Guest Drivers.
3#
4
5#
6#
7# Copyright (C) 2009-2012 Oracle Corporation
8#
9# This file is part of VirtualBox Open Source Edition (OSE), as
10# available from http://www.virtualbox.org. This file is free software;
11# you can redistribute it and/or modify it under the terms of the GNU
12# General Public License (GPL) as published by the Free Software
13# Foundation, in version 2 as it comes in the "COPYING" file of the
14# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16#
17
18ifneq ($(KBUILD_EXTMOD),)
19
20# Building from kBuild (make -C <kernel_directory> M=`pwd`).
21# KBUILD_EXTMOD is set to $(M) in this case.
22
23obj-m = vboxguest/ vboxsf/ vboxvideo/
24
25else # ! KBUILD_EXTMOD
26
27KBUILD_VERBOSE =
28
29all:
30 @echo "*** Building 'vboxguest' module ***"
31 @$(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxguest
32 @if [ -f vboxguest/vboxguest.ko ]; then \
33 cp vboxguest/vboxguest.ko .; \
34 else \
35 cp vboxguest/vboxguest.o .; \
36 fi
37 @echo
38 @if [ -d vboxsf ]; then \
39 if [ -f vboxguest/Module.symvers ]; then \
40 cp vboxguest/Module.symvers vboxsf; \
41 fi; \
42 echo "*** Building 'vboxsf' module ***"; \
43 $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxsf || exit 1; \
44 if [ -f vboxsf/vboxsf.ko ]; then \
45 cp vboxsf/vboxsf.ko .; \
46 else \
47 cp vboxsf/vboxsf.o .; \
48 fi; \
49 echo; \
50 fi
51 @if [ -d vboxvideo ]; then \
52 if [ -f vboxguest/Module.symvers ]; then \
53 cp vboxguest/Module.symvers vboxvideo; \
54 fi; \
55 echo "*** Building 'vboxvideo' module ***"; \
56 $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxvideo || \
57 (echo; echo "Building of vboxvideo failed, ignoring!"; echo); \
58 if [ -f vboxvideo/vboxvideo.ko ]; then \
59 cp vboxvideo/vboxvideo.ko .; \
60 elif [ -f vboxvideo/vboxvideo.o ]; then \
61 cp vboxvideo/vboxvideo.o .; \
62 fi; \
63 echo; \
64 fi
65
66install:
67 @$(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxguest install
68 @if [ -d vboxsf ]; then \
69 $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxsf install; \
70 fi
71 @if [ -d vboxvideo ]; then \
72 $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxvideo install; \
73 fi
74
75clean:
76 @$(MAKE) -C vboxguest clean
77 @if [ -d vboxsf ]; then \
78 $(MAKE) -C vboxsf clean; \
79 fi
80 @if [ -d vboxvideo ]; then \
81 $(MAKE) -C vboxvideo clean; \
82 fi
83 rm -f vboxguest.*o vboxsf.*o vboxvideo.*o
84
85check:
86 @$(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxguest check
87
88load:
89 @/sbin/rmmod vboxvideo || true
90 @/sbin/rmmod vboxvfs || true
91 @/sbin/rmmod vboxsf || true
92 @/sbin/rmmod vboxguest || true
93 @/sbin/insmod vboxguest.ko
94 @if [ -f vboxsf.ko ]; then /sbin/insmod vboxsf.ko; fi
95 @if [ -f vboxvideo.ko ]; then /sbin/insmod vboxvideo.ko; fi
96
97endif # ! KBUILD_EXTMOD
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette