1 | #
|
---|
2 | # Makefile for the VirtualBox FreeBSD Host Drivers.
|
---|
3 | #
|
---|
4 |
|
---|
5 | #
|
---|
6 | # Copyright (C) 2008-2019 Oracle Corporation
|
---|
7 | #
|
---|
8 | # This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
9 | # available from http://www.virtualbox.org. This file is free software;
|
---|
10 | # you can redistribute it and/or modify it under the terms of the GNU
|
---|
11 | # General Public License (GPL) as published by the Free Software
|
---|
12 | # Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
13 | # VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
14 | # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
15 | #
|
---|
16 | # The contents of this file may alternatively be used under the terms
|
---|
17 | # of the Common Development and Distribution License Version 1.0
|
---|
18 | # (CDDL) only, as it comes in the "COPYING.CDDL" file of the
|
---|
19 | # VirtualBox OSE distribution, in which case the provisions of the
|
---|
20 | # CDDL are applicable instead of those of the GPL.
|
---|
21 | #
|
---|
22 | # You may elect to license modified versions of this file under the
|
---|
23 | # terms and conditions of either the GPL or the CDDL or both.
|
---|
24 | #
|
---|
25 |
|
---|
26 | KBUILD_VERBOSE =
|
---|
27 |
|
---|
28 | all:
|
---|
29 | @echo "=== Building 'vboxdrv' module ==="
|
---|
30 | @$(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxdrv
|
---|
31 | @cp vboxdrv/vboxdrv.ko .
|
---|
32 | @echo
|
---|
33 | @if [ -d vboxnetflt ]; then \
|
---|
34 | if [ -f vboxdrv/Module.symvers ]; then \
|
---|
35 | cp vboxdrv/Module.symvers vboxnetflt; \
|
---|
36 | fi; \
|
---|
37 | echo "=== Building 'vboxnetflt' module ==="; \
|
---|
38 | $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxnetflt; \
|
---|
39 | cp vboxnetflt/vboxnetflt.ko .; \
|
---|
40 | echo; \
|
---|
41 | fi
|
---|
42 | @if [ -d vboxnetadp ]; then \
|
---|
43 | if [ -f vboxdrv/Module.symvers ]; then \
|
---|
44 | cp vboxdrv/Module.symvers vboxnetadp; \
|
---|
45 | fi; \
|
---|
46 | echo "=== Building 'vboxnetadp' module ==="; \
|
---|
47 | $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxnetadp; \
|
---|
48 | cp vboxnetadp/vboxnetadp.ko .; \
|
---|
49 | echo; \
|
---|
50 | fi
|
---|
51 |
|
---|
52 |
|
---|
53 | install:
|
---|
54 | @$(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxdrv install
|
---|
55 | @if [ -d vboxnetflt ]; then \
|
---|
56 | $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxnetflt install; \
|
---|
57 | fi
|
---|
58 | @if [ -d vboxnetadp ]; then \
|
---|
59 | $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxnetadp install; \
|
---|
60 | fi
|
---|
61 |
|
---|
62 | clean:
|
---|
63 | @$(MAKE) -C vboxdrv clean
|
---|
64 | @if [ -d vboxnetflt ]; then \
|
---|
65 | $(MAKE) -C vboxnetflt clean; \
|
---|
66 | fi
|
---|
67 | @if [ -d vboxnetadp ]; then \
|
---|
68 | $(MAKE) -C vboxnetadp clean; \
|
---|
69 | fi
|
---|
70 | rm -f vboxdrv.ko vboxnetflt.ko vboxnetadp.ko
|
---|
71 |
|
---|
72 | load:
|
---|
73 | @for module in vboxnetadp vboxnetflt vboxdrv; do \
|
---|
74 | if kldstat -n "$$module" >/dev/null; then \
|
---|
75 | echo "Removing previously installed $$module module"; \
|
---|
76 | /sbin/kldunload $$module; \
|
---|
77 | fi; \
|
---|
78 | done
|
---|
79 | @for module in vboxdrv vboxnetflt vboxnetadp; do \
|
---|
80 | if test -f $$module.ko; then \
|
---|
81 | echo "Installing $$module module"; \
|
---|
82 | /sbin/kldload ./$$module.ko; \
|
---|
83 | fi; \
|
---|
84 | done
|
---|