1 | # $Id: Makefile.kmk 98103 2023-01-17 14:15:46Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Sub-Makefile for the PCI passthru driver (VBoxPci).
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2011-2023 Oracle and/or its affiliates.
|
---|
8 | #
|
---|
9 | # This file is part of VirtualBox base platform packages, as
|
---|
10 | # available from https://www.virtualbox.org.
|
---|
11 | #
|
---|
12 | # This program is free software; you can redistribute it and/or
|
---|
13 | # modify it under the terms of the GNU General Public License
|
---|
14 | # as published by the Free Software Foundation, in version 3 of the
|
---|
15 | # License.
|
---|
16 | #
|
---|
17 | # This program is distributed in the hope that it will be useful, but
|
---|
18 | # WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
20 | # General Public License for more details.
|
---|
21 | #
|
---|
22 | # You should have received a copy of the GNU General Public License
|
---|
23 | # along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
24 | #
|
---|
25 | # The contents of this file may alternatively be used under the terms
|
---|
26 | # of the Common Development and Distribution License Version 1.0
|
---|
27 | # (CDDL), a copy of it is provided in the "COPYING.CDDL" file included
|
---|
28 | # in the VirtualBox distribution, in which case the provisions of the
|
---|
29 | # CDDL are applicable instead of those of the GPL.
|
---|
30 | #
|
---|
31 | # You may elect to license modified versions of this file under the
|
---|
32 | # terms and conditions of either the GPL or the CDDL or both.
|
---|
33 | #
|
---|
34 | # SPDX-License-Identifier: GPL-3.0-only OR CDDL-1.0
|
---|
35 | #
|
---|
36 |
|
---|
37 | SUB_DEPTH = ../../../..
|
---|
38 | include $(KBUILD_PATH)/subheader.kmk
|
---|
39 | if1of ($(KBUILD_TARGET), linux)
|
---|
40 |
|
---|
41 | ifdef VBOX_WITH_VBOXDRV
|
---|
42 | #
|
---|
43 | # The driver.
|
---|
44 | #
|
---|
45 | SYSMODS += VBoxPci
|
---|
46 | VBoxPci_TEMPLATE = VBOXR0DRV
|
---|
47 | VBoxPci_INST = $(INST_VBOXPCI)$(if $(eq $(KBUILD_TARGET),darwin),Contents/MacOS/)
|
---|
48 | VBoxPci_NAME.linux = vboxpci
|
---|
49 | VBoxPci_DEFS = IN_RT_R0 VBOX_SVN_REV=$(VBOX_SVN_REV) IN_SUP_STATIC
|
---|
50 | VBoxPci_INCS = \
|
---|
51 | .
|
---|
52 | VBoxPci_SOURCES = \
|
---|
53 | VBoxPci.c
|
---|
54 | VBoxPci_LIBS += \
|
---|
55 | $(PATH_STAGE_LIB)/SUPR0IdcClient$(VBOX_SUFF_LIB)
|
---|
56 | endif
|
---|
57 |
|
---|
58 | #
|
---|
59 | # Install the sources.
|
---|
60 | #
|
---|
61 | include $(PATH_SUB_CURRENT)/linux/files_vboxpci
|
---|
62 | INSTALLS += VBoxPci-src
|
---|
63 | VBoxPci-src_INST = bin/src/vboxpci/
|
---|
64 | VBoxPci-src_SOURCES = \
|
---|
65 | $(subst $(DQUOTE),,$(VBOX_VBOXPCI_SOURCES)) \
|
---|
66 | $(VBoxPci-src_0_OUTDIR)/Makefile
|
---|
67 | VBoxPci-src_CLEAN = \
|
---|
68 | $(VBoxPci-src_0_OUTDIR)/Makefile \
|
---|
69 | $(PATH_TARGET)/VBoxPciSrc-src-1.dep \
|
---|
70 |
|
---|
71 | # Generate the scripts needed for building the kernel module.
|
---|
72 |
|
---|
73 | includedep $(PATH_TARGET)/VBoxPci-src-1.dep
|
---|
74 | $$(VBoxPci-src_0_OUTDIR)/Makefile: \
|
---|
75 | $(PATH_SUB_CURRENT)/linux/Makefile \
|
---|
76 | $$(if $$(eq $$(VBoxPci/linux/Makefile_VBOX_HARDENED),$$(VBOX_WITH_HARDENING)),,FORCE) \
|
---|
77 | | $$(dir $$@)
|
---|
78 | $(QUIET)$(RM) -f -- $@
|
---|
79 | ifndef VBOX_WITH_HARDENING
|
---|
80 | $(QUIET)$(SED) -e "s;VBOX_WITH_HARDENING;;g" --output $@ $<
|
---|
81 | else
|
---|
82 | $(QUIET)$(CP) -f $< $@
|
---|
83 | endif
|
---|
84 | %$(QUIET2)$(APPEND) -t '$(PATH_TARGET)/VBoxPci-src-1.dep' 'VBoxPci/linux/Makefile_VBOX_HARDENED=$(VBOX_WITH_HARDENING)'
|
---|
85 |
|
---|
86 | #
|
---|
87 | # Build test for the linux host kernel modules.
|
---|
88 | #
|
---|
89 | $(evalcall2 VBOX_LINUX_KMOD_TEST_BUILD_RULE_FN,VBoxPci-src,vboxdrv-src,)
|
---|
90 |
|
---|
91 | endif # Supported platform.
|
---|
92 | include $(FILE_KBUILD_SUB_FOOTER)
|
---|
93 |
|
---|