1 | #
|
---|
2 | # Makefile for the VirtualBox FreeBSD Host Drivers.
|
---|
3 | #
|
---|
4 |
|
---|
5 | #
|
---|
6 | #
|
---|
7 | # Copyright (C) 2008-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 | KBUILD_VERBOSE =
|
---|
19 |
|
---|
20 | all:
|
---|
21 | @echo "*** Building 'vboxdrv' module ***"
|
---|
22 | @$(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxdrv
|
---|
23 | @cp vboxdrv/vboxdrv.ko .
|
---|
24 | @echo
|
---|
25 | @if [ -d vboxnetflt ]; then \
|
---|
26 | if [ -f vboxdrv/Module.symvers ]; then \
|
---|
27 | cp vboxdrv/Module.symvers vboxnetflt; \
|
---|
28 | fi; \
|
---|
29 | echo "*** Building 'vboxnetflt' module ***"; \
|
---|
30 | $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxnetflt; \
|
---|
31 | cp vboxnetflt/vboxnetflt.ko .; \
|
---|
32 | echo; \
|
---|
33 | fi
|
---|
34 | @if [ -d vboxnetadp ]; then \
|
---|
35 | if [ -f vboxdrv/Module.symvers ]; then \
|
---|
36 | cp vboxdrv/Module.symvers vboxnetadp; \
|
---|
37 | fi; \
|
---|
38 | echo "*** Building 'vboxnetadp' module ***"; \
|
---|
39 | $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxnetadp; \
|
---|
40 | cp vboxnetadp/vboxnetadp.ko .; \
|
---|
41 | echo; \
|
---|
42 | fi
|
---|
43 |
|
---|
44 |
|
---|
45 | install:
|
---|
46 | @$(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxdrv install
|
---|
47 | @if [ -d vboxnetflt ]; then \
|
---|
48 | $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxnetflt install; \
|
---|
49 | fi
|
---|
50 | @if [ -d vboxnetadp ]; then \
|
---|
51 | $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxnetadp install; \
|
---|
52 | fi
|
---|
53 |
|
---|
54 | clean:
|
---|
55 | @$(MAKE) -C vboxdrv clean
|
---|
56 | @if [ -d vboxnetflt ]; then \
|
---|
57 | $(MAKE) -C vboxnetflt clean; \
|
---|
58 | fi
|
---|
59 | @if [ -d vboxnetadp ]; then \
|
---|
60 | $(MAKE) -C vboxnetadp clean; \
|
---|
61 | fi
|
---|
62 | rm -f vboxdrv.ko vboxnetflt.ko vboxnetadp.ko
|
---|
63 |
|
---|
64 | load:
|
---|
65 | @for module in vboxnetadp vboxnetflt vboxdrv; do \
|
---|
66 | if kldstat -n "$$module" >/dev/null; then \
|
---|
67 | echo "Removing previously installed $$module module"; \
|
---|
68 | /sbin/kldunload $$module; \
|
---|
69 | fi; \
|
---|
70 | done
|
---|
71 | @for module in vboxdrv vboxnetflt vboxnetadp; do \
|
---|
72 | if test -f $$module.ko; then \
|
---|
73 | echo "Installing $$module module"; \
|
---|
74 | /sbin/kldload ./$$module.ko; \
|
---|
75 | fi; \
|
---|
76 | done
|
---|