1 | #
|
---|
2 | # Makefile for the VirtualBox Linux Guest Drivers.
|
---|
3 | #
|
---|
4 |
|
---|
5 | #
|
---|
6 | #
|
---|
7 | # Copyright (C) 2009-2010 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 |
|
---|
18 | ifneq ($(KBUILD_EXTMOD),)
|
---|
19 |
|
---|
20 | # DKMS
|
---|
21 |
|
---|
22 | obj-m = vboxguest/ vboxsf/ vboxvideo/
|
---|
23 |
|
---|
24 | else # ! KBUILD_EXTMOD
|
---|
25 |
|
---|
26 | KBUILD_VERBOSE =
|
---|
27 |
|
---|
28 | all:
|
---|
29 | @echo "*** Building 'vboxguest' module ***"
|
---|
30 | @$(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxguest
|
---|
31 | @if [ -f vboxguest/vboxguest.ko ]; then \
|
---|
32 | cp vboxguest/vboxguest.ko .; \
|
---|
33 | else \
|
---|
34 | cp vboxguest/vboxguest.o .; \
|
---|
35 | fi
|
---|
36 | @echo
|
---|
37 | @if [ -d vboxsf ]; then \
|
---|
38 | if [ -f vboxguest/Module.symvers ]; then \
|
---|
39 | cp vboxguest/Module.symvers vboxsf; \
|
---|
40 | fi; \
|
---|
41 | echo "*** Building 'vboxsf' module ***"; \
|
---|
42 | $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxsf; \
|
---|
43 | if [ -f vboxsf/vboxsf.ko ]; then \
|
---|
44 | cp vboxsf/vboxsf.ko .; \
|
---|
45 | else \
|
---|
46 | cp vboxsf/vboxsf.o .; \
|
---|
47 | fi; \
|
---|
48 | fi
|
---|
49 |
|
---|
50 |
|
---|
51 | install:
|
---|
52 | @$(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxguest install
|
---|
53 | @if [ -d vboxsf ]; then \
|
---|
54 | $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxsf install; \
|
---|
55 | fi
|
---|
56 |
|
---|
57 | clean:
|
---|
58 | @$(MAKE) -C vboxguest clean
|
---|
59 | @if [ -d vboxsf ]; then \
|
---|
60 | $(MAKE) -C vboxsf clean; \
|
---|
61 | fi
|
---|
62 | rm -f vboxguest.*o vboxsf.*o
|
---|
63 |
|
---|
64 | load:
|
---|
65 | @/sbin/rmmod vboxvfs || true
|
---|
66 | @/sbin/rmmod vboxsf || true
|
---|
67 | @/sbin/rmmod vboxguest || true
|
---|
68 | @/sbin/insmod vboxguest.ko
|
---|
69 | @if [ -f vboxsf.ko ]; then /sbin/insmod vboxsf.ko; fi
|
---|
70 |
|
---|
71 | endif # ! KBUILD_EXTMOD
|
---|