VirtualBox

source: vbox/trunk/src/VBox/HostDrivers/VBoxNetAdp/Makefile.kmk@ 72004

Last change on this file since 72004 was 72004, checked in by vboxsync, 7 years ago

Installer/win,HostDrivers/*/win: Ship two different .cat files, one for W10 w/ MS blessing and a pre-W10 that we created+signed during build.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 7.4 KB
Line 
1# $Id: Makefile.kmk 72004 2018-04-24 14:40:13Z vboxsync $
2## @file
3# Sub-Makefile for the Network Adapter Driver (VBoxNetAdp).
4#
5
6#
7# Copyright (C) 2009-2017 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# The contents of this file may alternatively be used under the terms
18# of the Common Development and Distribution License Version 1.0
19# (CDDL) only, as it comes in the "COPYING.CDDL" file of the
20# VirtualBox OSE distribution, in which case the provisions of the
21# CDDL are applicable instead of those of the GPL.
22#
23# You may elect to license modified versions of this file under the
24# terms and conditions of either the GPL or the CDDL or both.
25#
26
27SUB_DEPTH = ../../../..
28include $(KBUILD_PATH)/subheader.kmk
29
30if1of ($(KBUILD_TARGET), solaris darwin freebsd)
31 #
32 # VBoxNetAdp - Virtual Network Adapter
33 # Note! On Solaris the name has to be <= 8 chars long.
34 #
35 ifdef VBOX_WITH_VBOXDRV
36 SYSMODS += VBoxNetAdp
37 VBoxNetAdp_TEMPLATE = VBOXR0DRV
38 VBoxNetAdp_INST = $(INST_VBOXNETADP)$(if $(eq $(KBUILD_TARGET),darwin),Contents/MacOS/)
39 VBoxNetAdp_DEBUG_INST.darwin= $(patsubst %/,%,$(INST_VBOXNETADP))
40 VBoxNetAdp_NAME.solaris = vboxnet
41 VBoxNetAdp_NAME.freebsd = vboxnetadp
42 VBoxNetAdp_DEPS.solaris += $(VBOX_SVN_REV_KMK)
43 VBoxNetAdp_DEFS = IN_RT_R0 VBOX_SVN_REV=$(VBOX_SVN_REV) IN_SUP_STATIC
44 #VBoxNetAdp_LDFLAGS.darwin = -v -Wl,-whyload -Wl,-v -Wl,-whatsloaded
45 VBoxNetAdp_LDFLAGS.solaris += -N misc/gld -N drv/vboxdrv
46 VBoxNetAdp_INCS = \
47 .
48 VBoxNetAdp_SOURCES.darwin = \
49 darwin/VBoxNetAdp-darwin.cpp \
50 VBoxNetAdp.c
51 VBoxNetAdp_SOURCES.solaris = \
52 solaris/VBoxNetAdp-solaris.c
53 VBoxNetAdp_SOURCES.freebsd = \
54 freebsd/VBoxNetAdp-freebsd.c \
55 VBoxNetAdp.c
56 VBoxNetAdp_SOURCES =
57 #VBoxNetAdp_SOURCES = \
58 # VBoxNetAdp.c
59 VBoxNetAdp_LIBS += \
60 $(PATH_STAGE_LIB)/SUPR0IdcClient$(VBOX_SUFF_LIB)
61 endif
62endif
63
64#
65# Darwin extras.
66#
67ifeq ($(KBUILD_TARGET),darwin)
68 INSTALLS += VBoxNetAdp.kext
69 VBoxNetAdp.kext_INST = $(INST_VBOXNETADP)Contents/
70 VBoxNetAdp.kext_SOURCES = $(VBoxNetAdp.kext_0_OUTDIR)/Contents/Info.plist
71 VBoxNetAdp.kext_CLEAN = $(VBoxNetAdp.kext_0_OUTDIR)/Contents/Info.plist
72 VBoxNetAdp.kext_BLDDIRS = $(VBoxNetAdp.kext_0_OUTDIR)/Contents/
73
74$$(VBoxNetAdp.kext_0_OUTDIR)/Contents/Info.plist: $(PATH_SUB_CURRENT)/darwin/Info.plist $(VBOX_VERSION_MK) | $$(dir $$@)
75 $(call MSG_GENERATE,VBoxNetAdp,$@,$<)
76 $(QUIET)$(RM) -f $@
77 $(QUIET)$(SED) \
78 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
79 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
80 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
81 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
82 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
83 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
84 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
85 --output $@ \
86 $<
87
88 $(evalcall2 VBOX_TEST_SIGN_KEXT,VBoxNetAdp)
89
90 INSTALLS.darwin += Scripts-darwin-adp
91 Scripts-darwin-adp_INST = $(INST_DIST)
92 Scripts-darwin-adp_EXEC_SOURCES = \
93 darwin/loadnetadp.sh
94endif # darwin
95
96ifeq ($(KBUILD_TARGET),win)
97 #
98 # VBoxNetAdp6.sys - The VirtualBox Adapter miniport driver.
99 #
100 SYSMODS.win += VBoxNetAdp6
101 VBoxNetAdp6_TEMPLATE = VBOXR0DRV
102 if defined(VBOX_SIGNING_MODE)
103 VBoxNetAdp6_INSTTYPE.win = none
104 VBoxNetAdp6_DEBUG_INSTTYPE.win = both
105 endif
106 VBoxNetAdp6_DEFS = IN_RT_R0 IN_SUP_STATIC
107 VBoxNetAdp6_INCS := $(PATH_SUB_CURRENT)
108 VBoxNetAdp6_SDKS = ReorderCompilerIncs $(VBOX_WINDDK_WLH) $(VBOX_WINPSDK)INCS
109 VBoxNetAdp6_SOURCES = \
110 win/VBoxNetAdp-win.cpp \
111 win/VBoxNetAdp-win.rc
112 VBoxNetAdp6_DEFS += NDIS_MINIPORT_DRIVER NDIS_WDM=1 BINARY_COMPATIBLE=0
113 VBoxNetAdp6_DEFS += NDIS60_MINIPORT=1 NDIS60=1
114 VBoxNetAdp6_LDFLAGS.win.x86 = -Entry:DriverEntry@8
115 VBoxNetAdp6_LDFLAGS.win.amd64 = -Entry:DriverEntry
116 VBoxNetAdp6_LIBS.win = \
117 $(PATH_SDK_$(VBOX_WINDDK)_LIB)/ntoskrnl.lib \
118 $(PATH_SDK_$(VBOX_WINDDK)_LIB)/hal.lib \
119 $(PATH_SDK_$(VBOX_WINDDK)_LIB)/ndis.lib \
120 $(PATH_STAGE_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB)
121 VBoxNetAdp6_LIBS = \
122 $(PATH_STAGE_LIB)/SUPR0IdcClient$(VBOX_SUFF_LIB)
123
124
125 INSTALLS.win += VBoxNetAdp6-inf
126 VBoxNetAdp6-inf_INST = $(INST_BIN)
127 VBoxNetAdp6-inf_MODE = a+r,u+w
128 VBoxNetAdp6-inf_SOURCES = \
129 $(PATH_TARGET)/VBoxNetAdp6Cat.dir/VBoxNetAdp6.inf
130 VBoxNetAdp6-inf_CLEAN = $(VBoxNetAdp6-inf_SOURCES)
131 VBoxNetAdp6-inf_BLDDIRS = $(PATH_TARGET)/VBoxNetAdp6Cat.dir
132
133$(PATH_TARGET)/VBoxNetAdp6Cat.dir/VBoxNetAdp6.inf: $(PATH_SUB_CURRENT)/win/VBoxNetAdp6.inf $(MAKEFILE_CURRENT) | $$(dir $$@)
134 $(call MSG_GENERATE,VBoxNetAdp6-inf,$@,$<)
135 $(call VBOX_EDIT_INF_FN,$<,$@)
136
137 ifdef VBOX_SIGNING_MODE
138VBoxNetAdp6-inf_SOURCES += \
139 $(PATH_TARGET)/VBoxNetAdp6Cat.dir/VBoxNetAdp6.sys \
140 $(PATH_TARGET)/VBoxNetAdp6Cat.dir/VBoxNetAdp6.cat \
141 $(PATH_TARGET)/VBoxNetAdp6Cat.dir/VBoxNetAdp6.cat=>VBoxNetAdp6-PreW10.cat
142
143$(PATH_TARGET)/VBoxNetAdp6Cat.dir/VBoxNetAdp6.sys: $$(VBoxNetAdp6_1_TARGET) | $$(dir $$@)
144 $(INSTALL) -m 644 $< $(@D)
145
146$(PATH_TARGET)/VBoxNetAdp6Cat.dir/VBoxNetAdp6.cat: \
147 $(PATH_TARGET)/VBoxNetAdp6Cat.dir/VBoxNetAdp6.sys \
148 $(PATH_TARGET)/VBoxNetAdp6Cat.dir/VBoxNetAdp6.inf
149 $(call MSG_TOOL,Inf2Cat,VBoxNetFlt-inf,$@,$<)
150 $(call VBOX_MAKE_CAT_FN, $(@D),$@)
151
152 endif # ifdef VBOX_SIGNING_MODE
153
154endif #ifeq ($(KBUILD_TARGET), win)
155
156ifeq ($(KBUILD_TARGET),linux)
157 #
158 # Install source files for compilation on Linux.
159 # files_vboxnetadp defines VBOX_VBOXNETADP_SOURCES.
160 #
161 INSTALLS += VBoxNetAdp-src
162 include $(PATH_SUB_CURRENT)/linux/files_vboxnetadp
163 VBoxNetAdp-src_INST = bin/src/vboxnetadp/
164 VBoxNetAdp-src_SOURCES = \
165 $(subst $(DQUOTE),,$(VBOX_VBOXNETADP_SOURCES)) \
166 $(VBoxNetAdp-src_0_OUTDIR)/Makefile
167 VBoxNetAdp-src_CLEAN = \
168 $(VBoxNetAdp-src_0_OUTDIR)/Makefile \
169 $(PATH_TARGET)/VBoxNetAdp-src-1.dep \
170
171 # Scripts needed for building the kernel modules
172 includedep $(PATH_TARGET)/VBoxNetAdp-src-1.dep
173$$(VBoxNetAdp-src_0_OUTDIR)/Makefile: \
174 $(PATH_SUB_CURRENT)/linux/Makefile \
175 $$(if $$(eq $$(VBoxNetAdp/linux/Makefile_VBOX_HARDENED),$$(VBOX_WITH_HARDENING)),,FORCE) \
176 | $$(dir $$@)
177 $(QUIET)$(RM) -f -- $@
178 ifndef VBOX_WITH_HARDENING
179 $(QUIET)$(SED) -e "s;-DVBOX_WITH_HARDENING;;g" --output $@ $<
180 else
181 $(QUIET)$(CP) -f $< $@
182 endif
183 %$(QUIET2)$(APPEND) -t '$(PATH_TARGET)/VBoxNetAdp-src-1.dep' 'VBoxNetAdp/linux/Makefile_VBOX_HARDENED=$(VBOX_WITH_HARDENING)'
184
185
186endif # linux
187
188ifeq ($(KBUILD_TARGET),freebsd)
189 #
190 # Install source files for compilation on FreeBSD.
191 # files_vboxnetadp defines VBOX_VBOXNETADP_SOURCES.
192 #
193 INSTALLS += VBoxNetAdp-src
194 include $(PATH_SUB_CURRENT)/freebsd/files_vboxnetadp
195 VBoxNetAdp-src_INST = bin/src/vboxnetadp/
196 VBoxNetAdp-src_SOURCES = \
197 $(subst $(DQUOTE),,$(VBOX_VBOXNETADP_SOURCES)) \
198 $(VBoxNetAdp-src_0_OUTDIR)/Makefile
199 VBoxNetAdp-src_CLEAN = \
200 $(VBoxNetAdp-src_0_OUTDIR)/Makefile \
201
202$$(VBoxNetAdp-src_0_OUTDIR)/Makefile: \
203 $(PATH_SUB_CURRENT)/freebsd/Makefile \
204 $$(if $$(eq $$(VBoxNetAdp/freebsd/Makefile_VBOX_HARDENED),$$(VBOX_WITH_HARDENING)),,FORCE) \
205 | $$(dir $$@)
206 $(QUIET)$(RM) -f -- $@
207 ifndef VBOX_WITH_HARDENING
208 $(QUIET)$(SED) -e "s;-DVBOX_WITH_HARDENING;;g" --output $@ $<
209 else
210 $(QUIET)$(CP) -f $< $@
211 endif
212
213endif # freebsd
214
215include $(FILE_KBUILD_SUB_FOOTER)
216
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