1 | # $Id: Makefile.kmk 38082 2011-07-20 14:26:24Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Sub-Makefile for the support library and the drivers/modules/kexts it uses.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2006-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 | # 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 |
|
---|
27 | SUB_DEPTH = ../../../..
|
---|
28 | include $(KBUILD_PATH)/subheader.kmk
|
---|
29 |
|
---|
30 | #
|
---|
31 | # Targets
|
---|
32 | #
|
---|
33 | LIBRARIES += SUPR3 SUPR3Static SUPR3HardenedStatic
|
---|
34 | ifndef VBOX_ONLY_DOCS
|
---|
35 | if1of ($(VBOX_LDR_FMT), pe lx)
|
---|
36 | LIBRARIES += SUPR0
|
---|
37 | endif
|
---|
38 | endif
|
---|
39 | if !defined(VBOX_ONLY_DOCS) \
|
---|
40 | && !defined(VBOX_ONLY_EXTPACKS) \
|
---|
41 | && !defined(VBOX_ONLY_TESTSUITE)
|
---|
42 | ifdef VBOX_WITH_SUPSVC
|
---|
43 | PROGRAMS += VBoxSupSvc
|
---|
44 | endif
|
---|
45 | ifdef VBOX_WITH_VBOXDRV
|
---|
46 | LIBRARIES += SUPR0IdcClient
|
---|
47 | SYSMODS.freebsd += vboxdrv
|
---|
48 | SYSMODS.linux += vboxdrv
|
---|
49 | SYSMODS.win += VBoxDrv
|
---|
50 | SYSMODS.os2 += VBoxDrv
|
---|
51 | SYSMODS.solaris += vboxdrv
|
---|
52 | endif
|
---|
53 | INSTALLS.linux += vboxdrv-mod vboxdrv-sh vboxdrv-dkms
|
---|
54 | INSTALLS.freebsd += vboxdrv-mod vboxdrv-sh
|
---|
55 |
|
---|
56 | #
|
---|
57 | # Include sub-makefile(s).
|
---|
58 | #
|
---|
59 | include $(PATH_SUB_CURRENT)/testcase/Makefile.kmk
|
---|
60 |
|
---|
61 | #
|
---|
62 | # Populate FILES_VBOXDRV_NOBIN and FILES_VBOXDRV_BIN
|
---|
63 | #
|
---|
64 | ifeq ($(KBUILD_TARGET),linux)
|
---|
65 | include $(PATH_SUB_CURRENT)/linux/files_vboxdrv
|
---|
66 | endif
|
---|
67 | ifeq ($(KBUILD_TARGET),freebsd)
|
---|
68 | include $(PATH_SUB_CURRENT)/freebsd/files_vboxdrv
|
---|
69 | endif
|
---|
70 | endif # !VBOX_ONLY_DOCS && !VBOX_ONLY_EXTPACKS && !VBOX_ONLY_TESTSUITE
|
---|
71 |
|
---|
72 |
|
---|
73 | #
|
---|
74 | # The Ring-3 Support Library (this is linked into the IPRT dll, VBoxRT).
|
---|
75 | #
|
---|
76 | ifneq ($(filter l4%,$(KBUILD_TARGET) $(BUILD_TARGET_SUB)),)
|
---|
77 | # L4 has trouble with -pedantic. It also make trouble when inlining is not enabled.
|
---|
78 | SUPR3_TEMPLATE = VBOXR3NP
|
---|
79 | else
|
---|
80 | SUPR3_TEMPLATE = VBOXR3
|
---|
81 | endif
|
---|
82 | SUPR3_DEFS = \
|
---|
83 | IN_SUP_R3 IN_RT_R3 \
|
---|
84 | $(if $(VBOX_WITH_SUPSVC),VBOX_WITH_SUPSVC) \
|
---|
85 | $(if $(VBOX_WITH_MAIN),VBOX_WITH_MAIN,)
|
---|
86 | SUPR3_INCS := $(PATH_SUB_CURRENT)
|
---|
87 | SUPR3_INCS.l4 = $(L4_INCDIR)
|
---|
88 | SUPR3_SOURCES = \
|
---|
89 | SUPLib.cpp \
|
---|
90 | SUPLibSem.cpp \
|
---|
91 | SUPR3HardenedIPRT.cpp \
|
---|
92 | SUPR3HardenedVerify.cpp \
|
---|
93 | $(KBUILD_TARGET)/SUPLib-$(KBUILD_TARGET).cpp
|
---|
94 |
|
---|
95 | #
|
---|
96 | # Static version of SUPR3.
|
---|
97 | #
|
---|
98 | SUPR3Static_TEMPLATE = VBOXR3STATIC
|
---|
99 | SUPR3Static_EXTENDS = SUPR3
|
---|
100 |
|
---|
101 | #
|
---|
102 | # The static part of the hardened support library (ring-3).
|
---|
103 | #
|
---|
104 | SUPR3HardenedStatic_TEMPLATE = VBOXR3HARDENEDLIB
|
---|
105 | SUPR3HardenedStatic_DEFS = IN_SUP_HARDENED_R3
|
---|
106 | SUPR3HardenedStatic_DEFS += \
|
---|
107 | $(if $(VBOX_WITH_SUPSVC),VBOX_WITH_SUPSVC,) \
|
---|
108 | $(if $(VBOX_WITH_MAIN),VBOX_WITH_MAIN,)
|
---|
109 | SUPR3HardenedStatic_INCS = .
|
---|
110 | SUPR3HardenedStatic_SOURCES = \
|
---|
111 | SUPR3HardenedMain.cpp \
|
---|
112 | SUPR3HardenedVerify.cpp \
|
---|
113 | $(KBUILD_TARGET)/SUPLib-$(KBUILD_TARGET).cpp
|
---|
114 |
|
---|
115 | #
|
---|
116 | # VBoxSupSvc - The system wide service/daemon.
|
---|
117 | #
|
---|
118 | VBoxSupSvc_TEMPLATE = VBOXR3EXE
|
---|
119 | VBoxSupSvc_SOURCES = \
|
---|
120 | SUPSvc.cpp \
|
---|
121 | SUPSvcGlobal.cpp \
|
---|
122 | $(KBUILD_TARGET)/SUPSvc-$(KBUILD_TARGET).cpp
|
---|
123 | if1of ($(KBUILD_TARGET), win)
|
---|
124 | VBoxSupSvc_SOURCES += \
|
---|
125 | SUPSvcGrant.cpp
|
---|
126 | endif
|
---|
127 | ifn1of ($(KBUILD_TARGET), win)
|
---|
128 | VBoxSupSvc_SOURCES += \
|
---|
129 | SUPSvcMain-posix.cpp
|
---|
130 | endif
|
---|
131 | VBoxSupSvc_LIBS = \
|
---|
132 | $(LIB_RUNTIME)
|
---|
133 |
|
---|
134 |
|
---|
135 | #
|
---|
136 | # SUPR0 - The Ring-0 Import / Thunk library.
|
---|
137 | #
|
---|
138 | SUPR0_TEMPLATE = VBoxR0
|
---|
139 | ifeq ($(VBOX_LDR_FMT),pe)
|
---|
140 | SUPR0_SOURCES += SUPR0.def
|
---|
141 | endif
|
---|
142 | ifeq ($(VBOX_LDR_FMT),lx)
|
---|
143 | SUPR0_SOURCES += $$(SUPR0_0_OUTDIR)/SUPR0.def
|
---|
144 | $$(SUPR0_0_OUTDIR)/SUPR0.def: $(PATH_SUB_CURRENT)/SUPR0.def | $$(dir $$@)
|
---|
145 | $(SED) \
|
---|
146 | -e 's/^[ \t][ \t]*\([gA-Z]\)/ _\1/' \
|
---|
147 | -e 's/[ \t]DATA[ \t]*/ /' \
|
---|
148 | -e 's/g_pSUPGlobalInfoPage/g_SUPGlobalInfoPage/' \
|
---|
149 | --output [email protected]\
|
---|
150 | $<
|
---|
151 | $(MV) -f [email protected] $@
|
---|
152 | endif
|
---|
153 |
|
---|
154 |
|
---|
155 | #
|
---|
156 | # SUPR0IdcClient - The Ring-0 IDC client driver library.
|
---|
157 | #
|
---|
158 | SUPR0IdcClient_TEMPLATE = VBOXR0DRV
|
---|
159 | SUPR0IdcClient_DEFS = IN_RT_R0 IN_SUP_R0 IN_SUP_STATIC
|
---|
160 | SUPR0IdcClient_SDKS.win = W2K3DDK WINPSDKINCS
|
---|
161 | SUPR0IdcClient_SOURCES.$(KBUILD_TARGET) = \
|
---|
162 | $(KBUILD_TARGET)/SUPR0IdcClient-$(KBUILD_TARGET).c
|
---|
163 | SUPR0IdcClient_SOURCES = \
|
---|
164 | SUPR0IdcClient.c \
|
---|
165 | SUPR0IdcClientComponent.c \
|
---|
166 | SUPR0IdcClientStubs.c
|
---|
167 |
|
---|
168 |
|
---|
169 | if !defined(VBOX_ONLY_DOCS) \
|
---|
170 | && !defined(VBOX_ONLY_EXTPACKS) \
|
---|
171 | && !defined(VBOX_ONLY_TESTSUITE)
|
---|
172 |
|
---|
173 | #
|
---|
174 | # VBoxDrv.sys - The Windows driver.
|
---|
175 | #
|
---|
176 | ## @todo consolidate all the targets into a single mess.
|
---|
177 | ifeq ($(KBUILD_TARGET),win)
|
---|
178 | VBoxDrv_TEMPLATE = VBOXR0DRV
|
---|
179 | ifdef VBOX_SIGNING_MODE
|
---|
180 | VBoxDrv_NOINST = true
|
---|
181 | endif
|
---|
182 | VBoxDrv_DEFS = IN_RT_R0 IN_SUP_R0 SUPDRV_WITH_RELEASE_LOGGER
|
---|
183 | ifdef VBOX_WITHOUT_NATIVE_R0_LOADER
|
---|
184 | VBoxDrv_DEFS += VBOX_WITHOUT_NATIVE_R0_LOADER
|
---|
185 | endif
|
---|
186 | ifdef VBOX_WITH_VMMR0_DISABLE_PREEMPTION
|
---|
187 | VBoxDrv_DEFS += VBOX_WITH_VMMR0_DISABLE_PREEMPTION
|
---|
188 | endif
|
---|
189 | VBoxDrv_SDKS = W2K3DDK WINPSDKINCS
|
---|
190 | VBoxDrv_INCS := $(PATH_SUB_CURRENT)
|
---|
191 | VBoxDrv_SOURCES = \
|
---|
192 | win/SUPDrv-win.cpp \
|
---|
193 | win/SUPDrvA-win.asm \
|
---|
194 | SUPDrv.c \
|
---|
195 | SUPDrvSem.c \
|
---|
196 | win/VBoxDrv.rc
|
---|
197 | VBoxDrv_LDFLAGS.x86 = -Entry:DriverEntry@8
|
---|
198 | VBoxDrv_LDFLAGS.amd64 = -Entry:DriverEntry
|
---|
199 | VBoxDrv_LIBS = \
|
---|
200 | $(PATH_SDK_W2K3DDK_LIB)/ntoskrnl.lib \
|
---|
201 | $(PATH_SDK_W2K3DDK_LIB)/hal.lib \
|
---|
202 | $(PATH_STAGE_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB)
|
---|
203 |
|
---|
204 |
|
---|
205 | INSTALLS += VBoxDrv-inf
|
---|
206 | VBoxDrv-inf_INST = $(INST_BIN)
|
---|
207 | VBoxDrv-inf_MODE = a+r,u+w
|
---|
208 | VBoxDrv-inf_SOURCES = \
|
---|
209 | $(PATH_TARGET)/VBoxDrvCat.dir/VBoxDrv.inf
|
---|
210 | VBoxDrv-inf_CLEAN = $(VBoxDrv-inf_SOURCES)
|
---|
211 | VBoxDrv-inf_BLDDIRS = $(PATH_TARGET)/VBoxDrvCat.dir
|
---|
212 |
|
---|
213 | $(PATH_TARGET)/VBoxDrvCat.dir/VBoxDrv.inf: $(PATH_SUB_CURRENT)/win/VBoxDrv.inf $(MAKEFILE_CURRENT) | $$(dir $$@)
|
---|
214 | $(call MSG_GENERATE,VBoxDrv-inf,$@,$<)
|
---|
215 | $(call VBOX_EDIT_INF_FN,$<,$@)
|
---|
216 |
|
---|
217 | ifdef VBOX_SIGNING_MODE
|
---|
218 | VBoxDrv-inf_SOURCES += \
|
---|
219 | $(PATH_TARGET)/VBoxDrvCat.dir/VBoxDrv.sys \
|
---|
220 | $(PATH_TARGET)/VBoxDrvCat.dir/VBoxDrv.cat
|
---|
221 |
|
---|
222 | $(PATH_TARGET)/VBoxDrvCat.dir/VBoxDrv.sys: $$(VBoxDrv_1_TARGET) | $$(dir $$@)
|
---|
223 | $(INSTALL) -m 644 $< $(@D)
|
---|
224 |
|
---|
225 | $(PATH_TARGET)/VBoxDrvCat.dir/VBoxDrv.cat: \
|
---|
226 | $(PATH_TARGET)/VBoxDrvCat.dir/VBoxDrv.inf \
|
---|
227 | $(PATH_TARGET)/VBoxDrvCat.dir/VBoxDrv.sys
|
---|
228 | $(call MSG_TOOL,Inf2Cat,VBoxDrv-inf,$@,$<)
|
---|
229 | $(call VBOX_MAKE_CAT_FN, $(@D),$@)
|
---|
230 | endif # signing
|
---|
231 | endif # win
|
---|
232 |
|
---|
233 |
|
---|
234 | #
|
---|
235 | # vboxdrv.ko - The Linux Kernel Module (syntax check only).
|
---|
236 | #
|
---|
237 | ifeq ($(KBUILD_TARGET),linux)
|
---|
238 | vboxdrv_TEMPLATE = VBOXR0DRV
|
---|
239 | vboxdrv_NOINST = true
|
---|
240 | vboxdrv_DEFS = KBUILD_MODNAME=KBUILD_STR\(vboxdrv\) KBUILD_BASENAME=KBUILD_STR\(vboxdrv\) MODULE IN_RT_R0 IN_SUP_R0 CONFIG_VBOXDRV_AS_MISC
|
---|
241 | ifdef VBOX_LINUX_VERSION_2_4
|
---|
242 | vboxdrv_DEFS += EXPORT_SYMTAB
|
---|
243 | endif
|
---|
244 | vboxdrv_INCS := \
|
---|
245 | $(PATH_SUB_CURRENT) \
|
---|
246 | $(PATH_ROOT)/src/VBox/Runtime/r0drv/linux
|
---|
247 | vboxdrv_LIBS = $(PATH_STAGE_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB)
|
---|
248 | vboxdrv_LIBS.debug = $(vboxdrv_LIBS) $(VBOX_GCC_LIBGCC)
|
---|
249 | vboxdrv_SOURCES = \
|
---|
250 | $(KBUILD_TARGET)/SUPDrv-$(KBUILD_TARGET).c \
|
---|
251 | SUPDrv.c \
|
---|
252 | SUPDrvSem.c
|
---|
253 | ifndef VBOX_LINUX_VERSION_2_4
|
---|
254 | vboxdrv_SOURCES += \
|
---|
255 | $(KBUILD_TARGET)/SUPDrv-$(KBUILD_TARGET).mod.c
|
---|
256 | endif
|
---|
257 |
|
---|
258 |
|
---|
259 | #
|
---|
260 | # Targets for installing the linux sources.
|
---|
261 | #
|
---|
262 | vboxdrv-mod_INST = bin/src/vboxdrv/
|
---|
263 | vboxdrv-mod_MODE = a+r,u+w
|
---|
264 | vboxdrv-mod_SOURCES = $(subst ",,$(FILES_VBOXDRV_NOBIN)) #"
|
---|
265 | vboxdrv-mod_SOURCES += \
|
---|
266 | $(vboxdrv-mod_0_OUTDIR)/Makefile
|
---|
267 | vboxdrv-mod_CLEAN = \
|
---|
268 | $(vboxdrv-mod_0_OUTDIR)/Makefile
|
---|
269 |
|
---|
270 | vboxdrv-sh_INST = bin/src/vboxdrv/
|
---|
271 | vboxdrv-sh_MODE = a+rx,u+w
|
---|
272 | vboxdrv-sh_SOURCES = $(subst ",,$(FILES_VBOXDRV_BIN)) #"
|
---|
273 | vboxdrv-sh_SOURCES += \
|
---|
274 | $(vboxdrv-sh_0_OUTDIR)/build_in_tmp \
|
---|
275 | $(PATH_ROOT)/src/VBox/HostDrivers/linux/do_Module.symvers
|
---|
276 | vboxdrv-sh_CLEAN = \
|
---|
277 | $(PATH_TARGET)/vboxdrv-sh-1.dep \
|
---|
278 | $(vboxdrv-sh_0_OUTDIR)/build_in_tmp
|
---|
279 |
|
---|
280 | # Scripts needed for building the kernel modules
|
---|
281 |
|
---|
282 | $$(vboxdrv-sh_0_OUTDIR)/build_in_tmp: \
|
---|
283 | $(PATH_ROOT)/src/VBox/HostDrivers/linux/build_in_tmp \
|
---|
284 | $(VBOX_VERSION_STAMP) \
|
---|
285 | | $$(dir $$@)
|
---|
286 | $(call MSG_TOOL,Creating,,$@)
|
---|
287 | $(QUIET)$(SED) \
|
---|
288 | -e "s;_VERSION_;${VBOX_VERSION_STRING};g" \
|
---|
289 | -e "s;_MODULE_;vboxdrv;g" \
|
---|
290 | -e "s;_BUILDTYPE_;${KBUILD_TYPE};g" --output $@ $<
|
---|
291 | $(QUIET)chmod 0755 $@
|
---|
292 |
|
---|
293 | includedep $(PATH_TARGET)/vboxdrv-sh-1.dep
|
---|
294 | $$(vboxdrv-mod_0_OUTDIR)/Makefile: \
|
---|
295 | $(PATH_SUB_CURRENT)/linux/Makefile \
|
---|
296 | $$(if $$(eq $$(Support/linux/Makefile_VBOX_HARDENED),$$(VBOX_WITH_HARDENING)),,FORCE) \
|
---|
297 | | $$(dir $$@)
|
---|
298 | $(call MSG_TOOL,Creating,,$@)
|
---|
299 | ifndef VBOX_WITH_HARDENING
|
---|
300 | $(QUIET)$(SED) -e "s;-DVBOX_WITH_HARDENING;;g" --output $@ $<
|
---|
301 | else
|
---|
302 | $(QUIET)$(CP) -f $< $@
|
---|
303 | endif
|
---|
304 | %$(QUIET2)$(RM) -f -- $(PATH_TARGET)/vboxdrv-sh-1.dep
|
---|
305 | %$(QUIET2)$(APPEND) '$(PATH_TARGET)/vboxdrv-sh-1.dep' 'Support/linux/Makefile_VBOX_HARDENED=$(VBOX_WITH_HARDENING)'
|
---|
306 |
|
---|
307 | endif # real linux
|
---|
308 |
|
---|
309 |
|
---|
310 |
|
---|
311 | #
|
---|
312 | # VBoxDrv.kext - The Darwin Kernel Extension.
|
---|
313 | #
|
---|
314 | ifeq ($(KBUILD_TARGET),darwin)
|
---|
315 | # Leopard (x86) and Snow Leopard (x86/amd64)
|
---|
316 | SYSMODS += VBoxDrv
|
---|
317 | VBoxDrv_TEMPLATE = VBOXR0DRV
|
---|
318 | VBoxDrv_INST = $(INST_VBOXDRV)Contents/MacOS/
|
---|
319 | VBoxDrv_DEFS := VBOX_WITH_HOST_VMX IN_RT_R0 IN_SUP_R0 SUPDRV_WITH_RELEASE_LOGGER VBOX_SVN_REV=$(VBOX_SVN_REV)
|
---|
320 | VBoxDrv_DEFS.debug = DEBUG_DARWIN_GIP
|
---|
321 | VBoxDrv_INCS = . $(VBoxDrv_0_OUTDIR)
|
---|
322 | VBoxDrv_LIBS = $(PATH_STAGE_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB)
|
---|
323 | #VBoxDrv_LDFLAGS = -v -Wl,-whyload -Wl,-v -Wl,-whatsloaded
|
---|
324 | VBoxDrv_SOURCES = \
|
---|
325 | SUPDrv.c \
|
---|
326 | SUPDrvSem.c \
|
---|
327 | $(KBUILD_TARGET)/SUPDrv-$(KBUILD_TARGET).cpp
|
---|
328 |
|
---|
329 | ifdef VBOX_WITH_DTRACE_R0DRV
|
---|
330 | VBoxDrv_DEFS += VBOX_WITH_DTRACE
|
---|
331 | VBoxDrv_INTERMEDIATES += $(VBoxDrv_0_OUTDIR)/SUPDrv-dtrace.h
|
---|
332 | VBoxDrv_CLEAN += $(VBoxDrv_0_OUTDIR)/SUPDrv-dtrace.h $(VBoxDrv_0_OUTDIR)/SUPDrv-dtrace.tmp
|
---|
333 | $$(VBoxDrv_0_OUTDIR)/SUPDrv-dtrace.h: $(PATH_SUB_CURRENT)/SUPDrv-dtrace.d | $$(dir $$@)
|
---|
334 | dtrace -C -h -o [email protected] -s $<
|
---|
335 | $(SED) -e '/<unistd\.h>/d' [email protected] --output $@
|
---|
336 | $(RM) -f [email protected]
|
---|
337 | endif
|
---|
338 |
|
---|
339 | INSTALLS += VBoxDrv.kext
|
---|
340 | VBoxDrv.kext_INST = $(INST_VBOXDRV)Contents/
|
---|
341 | VBoxDrv.kext_SOURCES = $(VBoxDrv.kext_0_OUTDIR)/Info.plist
|
---|
342 | VBoxDrv.kext_CLEAN = $(VBoxDrv.kext_0_OUTDIR)/Info.plist
|
---|
343 |
|
---|
344 | $$(VBoxDrv.kext_0_OUTDIR)/Info.plist: \
|
---|
345 | $(PATH_SUB_CURRENT)/darwin/Info.plist \
|
---|
346 | $(VBOX_VERSION_MK) | $$(dir $$@)
|
---|
347 | $(call MSG_GENERATE,VBoxDrv,$@,$<)
|
---|
348 | $(QUIET)$(RM) -f $@
|
---|
349 | $(QUIET)$(SED) \
|
---|
350 | -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
|
---|
351 | -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
|
---|
352 | -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
|
---|
353 | -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
|
---|
354 | -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
|
---|
355 | -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
|
---|
356 | -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
|
---|
357 | --output $@ \
|
---|
358 | $<
|
---|
359 |
|
---|
360 | # Common manual loader script.
|
---|
361 | INSTALLS += Scripts
|
---|
362 | Scripts_INST = $(INST_DIST)
|
---|
363 | Scripts_SOURCES = \
|
---|
364 | darwin/load.sh
|
---|
365 |
|
---|
366 | endif # darwin
|
---|
367 | ifeq ($(KBUILD_TARGET),os2)
|
---|
368 |
|
---|
369 | #
|
---|
370 | # VBoxDrv.sys - The OS/2 driver.
|
---|
371 | #
|
---|
372 | VBoxDrv_TEMPLATE = VBOXR0DRV
|
---|
373 | VBoxDrv_DEFS = IN_RT_R0 IN_SUP_R0
|
---|
374 | VBoxDrv_INCS := $(PATH_SUB_CURRENT)
|
---|
375 | #VBoxDrv_LDFLAGS = -s -t -v
|
---|
376 | VBoxDrv_SOURCES = \
|
---|
377 | os2/SUPDrvA-os2.asm \
|
---|
378 | os2/SUPDrv-os2.def
|
---|
379 | VBoxDrv_LIBS = \
|
---|
380 | $(VBoxDrvLib_1_TARGET) \
|
---|
381 | $(PATH_STAGE_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB) \
|
---|
382 | $(VBOX_GCC_LIBGCC) \
|
---|
383 | end
|
---|
384 |
|
---|
385 | # temp hack to ensure that SUPDrvA-os2.asm is first in the link.
|
---|
386 | LIBRARIES += VBoxDrvLib
|
---|
387 | VBoxDrvLib_TEMPLATE = VBOXR0DRV
|
---|
388 | VBoxDrvLib_NOINST = 1
|
---|
389 | VBoxDrvLib_DEFS = IN_RT_R0 IN_SUP_R0
|
---|
390 | VBoxDrvLib_INCS := \
|
---|
391 | . \
|
---|
392 | $(PATH_ROOT)/src/VBox/Runtime/include
|
---|
393 | VBoxDrvLib_SOURCES = \
|
---|
394 | os2/SUPDrv-os2.cpp \
|
---|
395 | SUPDrv.c \
|
---|
396 | SUPDrvSem.c
|
---|
397 |
|
---|
398 | endif # os2
|
---|
399 | ifeq ($(KBUILD_TARGET),freebsd)
|
---|
400 |
|
---|
401 | #
|
---|
402 | # vboxdrv.ko - The FreeBSD Kernel Module.
|
---|
403 | #
|
---|
404 | vboxdrv_TEMPLATE = VBOXR0DRV
|
---|
405 | vboxdrv_DEFS = IN_RT_R0 IN_SUP_R0 SUPDRV_WITH_RELEASE_LOGGER VBOX_SVN_REV=$(VBOX_SVN_REV)
|
---|
406 | vboxdrv_INCS := $(PATH_SUB_CURRENT)
|
---|
407 | vboxdrv_LIBS = $(PATH_STAGE_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB)
|
---|
408 | vboxdrv_SOURCES := \
|
---|
409 | $(KBUILD_TARGET)/SUPDrv-$(KBUILD_TARGET).c \
|
---|
410 | $(PATH_SUB_CURRENT)/$(KBUILD_TARGET)/SUPDrv-$(KBUILD_TARGET).def \
|
---|
411 | SUPDrv.c \
|
---|
412 | SUPDrvSem.c
|
---|
413 | ## @todo the SUPDrv-freebsd.def is most probably gonna break it and require build system hacking...
|
---|
414 |
|
---|
415 | #
|
---|
416 | # Targets for installing the freebsd sources.
|
---|
417 | #
|
---|
418 | vboxdrv-mod_INST = bin/src/vboxdrv/
|
---|
419 | vboxdrv-mod_MODE = a+r,u+w
|
---|
420 | vboxdrv-mod_SOURCES = $(subst ",,$(FILES_VBOXDRV_NOBIN)) #"
|
---|
421 | vboxdrv-mod_SOURCES += \
|
---|
422 | $(vboxdrv-mod_0_OUTDIR)/Makefile
|
---|
423 | vboxdrv-mod_CLEAN = \
|
---|
424 | $(vboxdrv-mod_0_OUTDIR)/Makefile
|
---|
425 |
|
---|
426 | $$(vboxdrv-mod_0_OUTDIR)/Makefile: \
|
---|
427 | $(PATH_SUB_CURRENT)/freebsd/Makefile \
|
---|
428 | $$(if $$(eq $$(Support/freebsd/Makefile_VBOX_HARDENED),$$(VBOX_WITH_HARDENING)),,FORCE) \
|
---|
429 | | $$(dir $$@)
|
---|
430 | $(call MSG_TOOL,Creating,,$@)
|
---|
431 | ifndef VBOX_WITH_HARDENING
|
---|
432 | $(QUIET)$(SED) -e "s;-DVBOX_WITH_HARDENING;;g" --output $@ $<
|
---|
433 | else
|
---|
434 | $(QUIET)$(CP) -f $< $@
|
---|
435 | endif
|
---|
436 |
|
---|
437 | endif # freebsd
|
---|
438 | ifeq ($(KBUILD_TARGET),solaris)
|
---|
439 |
|
---|
440 | #
|
---|
441 | # vboxdrv.o - The Solaris Kernel Module.
|
---|
442 | #
|
---|
443 | vboxdrv_TEMPLATE = VBOXR0DRV
|
---|
444 | vboxdrv_DEFS = IN_RT_R0 IN_SUP_R0 SUPDRV_WITH_RELEASE_LOGGER VBOX_SVN_REV=$(VBOX_SVN_REV)
|
---|
445 | ifdef VBOX_WITH_NETFLT
|
---|
446 | vboxdrv_DEFS += VBOX_WITH_NETFLT
|
---|
447 | endif
|
---|
448 | ifdef VBOX_WITH_NATIVE_SOLARIS_LOADING
|
---|
449 | vboxdrv_DEFS += VBOX_WITH_NATIVE_SOLARIS_LOADING
|
---|
450 | endif
|
---|
451 | vboxdrv_DEPS += $(VBOX_SVN_REV_KMK)
|
---|
452 | vboxdrv_INCS := $(PATH_SUB_CURRENT)
|
---|
453 | vboxdrv_LIBS = $(PATH_STAGE_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB)
|
---|
454 | vboxdrv_SOURCES = \
|
---|
455 | $(KBUILD_TARGET)/SUPDrv-$(KBUILD_TARGET).c \
|
---|
456 | SUPDrv.c \
|
---|
457 | SUPDrvSem.c
|
---|
458 | vboxdrv_LDFLAGS += -N misc/ctf
|
---|
459 |
|
---|
460 | endif # solaris
|
---|
461 |
|
---|
462 | #
|
---|
463 | # SUPDrv.c needs the VBOX_SVN_REV.
|
---|
464 | #
|
---|
465 | SUPDrv.c_DEFS += VBOX_SVN_REV=$(VBOX_SVN_REV)
|
---|
466 |
|
---|
467 |
|
---|
468 | endif # !VBOX_ONLY_DOCS && !VBOX_ONLY_EXTPACKS && !VBOX_ONLY_TESTSUITE
|
---|
469 | include $(KBUILD_PATH)/subfooter.kmk
|
---|
470 |
|
---|