VirtualBox

source: vbox/trunk/src/VBox/Additions/common/VBoxGuest/Makefile.kmk@ 72352

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

VBoxGuestNt3.sys: Use the regular driver for NT3 too.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 9.3 KB
Line 
1# $Id: Makefile.kmk 70350 2017-12-26 17:24:43Z vboxsync $
2## @file
3# Makefile for the Cross Platform Guest Additions Driver.
4#
5
6#
7# Copyright (C) 2007-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
30# Include sub-makefile.
31include $(PATH_SUB_CURRENT)/lib/Makefile.kmk
32
33
34if1of ($(KBUILD_TARGET), darwin freebsd haiku netbsd os2 solaris win)
35 #
36 # VBoxGuest - The Guest Additions Driver.
37 #
38 SYSMODS += VBoxGuest
39 VBoxGuest_TEMPLATE = VBOXGUESTR0
40 VBoxGuest_NAME.freebsd = vboxguest
41 VBoxGuest_NAME.haiku = vboxguest
42 VBoxGuest_NAME.netbsd = vboxguest
43 VBoxGuest_NAME.solaris = vboxguest
44 VBoxGuest_INST.darwin = $(INST_ADDITIONS)VBoxGuest.kext/Contents/MacOS/
45 ifdef VBOX_SIGN_ADDITIONS # See Additions/WINNT/Makefile.kmk?
46 VBoxGuest_INSTTYPE.win = none
47 VBoxGuest_DEBUG_INSTTYPE.win = both
48 endif
49 VBoxGuest_DEFS.haiku = VBOX_SVN_REV=$(VBOX_SVN_REV) _KERNEL_MODE=1
50 VBoxGuest_DEFS.solaris = VBOX_SVN_REV=$(VBOX_SVN_REV)
51 VBoxGuest_DEFS.win = VBOX_GUESTDRV_WITH_RELEASE_LOGGER
52 VBoxGuest_DEFS.win.x86 = TARGET_NT4 TARGET_NT3 RT_WITHOUT_NOCRT_WRAPPERS
53 VBoxGuest_DEFS.darwin = VBOX_GUESTDRV_WITH_RELEASE_LOGGER
54 ifeq ($(KBUILD_TYPE),release)
55 # Allow stopping/removing the driver without a reboot
56 # in debug mode; this is very useful for testing the shutdown stuff!
57 VBoxGuest_DEFS.win += VBOX_REBOOT_ON_UNINSTALL
58 endif
59 ifdef VBOX_WITH_GUEST_BUGCHECK_DETECTION
60 VBoxGuest_DEFS.win += VBOX_WITH_GUEST_BUGCHECK_DETECTION
61 endif
62 #VBoxGuest_DEFS.win += LOG_ENABLED LOG_TO_BACKDOOR
63 VBoxGuest_DEFS.win += \
64 $(if $(VBOX_WITH_DPC_LATENCY_CHECKER),VBOX_WITH_DPC_LATENCY_CHECKER,)
65 VBoxGuest_DEPS.solaris += $(VBOX_SVN_REV_KMK)
66 VBoxGuest_DEPS.haiku += $(VBOX_SVN_REV_HEADER)
67 VBoxGuest_DEPS.freebsd += $(VBOX_SVN_REV_HEADER)
68 VBoxGuest_DEPS.netbsd += $(VBOX_SVN_REV_HEADER)
69 VBoxGuest_DEPS.darwin += $(VBOX_SVN_REV_HEADER)
70 VBoxGuest_DEFS = VBGL_VBOXGUEST VBOX_WITH_HGCM
71 VBoxGuest_INCS = .
72 VBoxGuest_INCS.freebsd = $(VBoxGuest_0_OUTDIR) $(PATH_STAGE)/gen-sys-hdrs
73 VBoxGuest_INCS.netbsd = $(VBoxGuest_0_OUTDIR) netbsd
74 ifeq ($(KBUILD_HOST),solaris)
75 VBoxGuest_LDFLAGS.solaris += -N misc/ctf
76 else
77 VBoxGuest_SOURCES.solaris = solaris/deps.asm
78 VBoxGuest_solaris/deps.asm_ASFLAGS = -f bin -g null
79 endif
80 ifneq ($(KBUILD_TARGET),os2)
81 ifeq ($(KBUILD_TARGET),win)
82 VBoxGuest_LDFLAGS.x86 = -Entry:DriverEntry@8
83 VBoxGuest_LDFLAGS.amd64 = -Entry:DriverEntry
84 ifeq ($(KBUILD_TARGET_ARCH),x86)
85 VBoxGuest_SDKS = ReorderCompilerIncs $(VBOX_WINDDK_GST_NT4)
86 VBoxGuest_LIBS = \
87 $(VBOX_LIB_VBGL_R0BASE) \
88 $(VBOX_LIB_IPRT_GUEST_R0) \
89 $(PATH_SDK_$(VBOX_WINDDK_GST_NT4)_LIB)/exsup.lib \
90 $(PATH_SDK_$(VBOX_WINDDK_GST_NT4)_LIB)/int64.lib \
91 $(PATH_SDK_$(VBOX_WINDDK_GST_NT4)_LIB)/ntoskrnl.lib \
92 $(PATH_SDK_$(VBOX_WINDDK_GST_NT4)_LIB)/hal.lib
93 else
94 VBoxGuest_LIBS = \
95 $(PATH_SDK_$(VBOX_WINDDK_GST)_LIB)/ntoskrnl.lib \
96 $(PATH_SDK_$(VBOX_WINDDK_GST)_LIB)/hal.lib
97 endif
98 VBoxGuest_USES.win += vboximportchecker
99 VBoxGuest_VBOX_IMPORT_CHECKER.win.x86 = nt31/r0
100 VBoxGuest_VBOX_IMPORT_CHECKER.win.amd64 = xp64/r0
101 endif # win
102 ifn1of ($(KBUILD_TARGET), linux freebsd netbsd solaris haiku)
103 VBoxGuest_SOURCES = VBoxGuest-$(KBUILD_TARGET).cpp
104 else
105 VBoxGuest_SOURCES = VBoxGuest-$(KBUILD_TARGET).c
106 VBoxGuest_$(KBUILD_TARGET).c_DEPS = $(VBOX_SVN_REV_HEADER)
107 ifeq ($(KBUILD_TARGET),freebsd)
108 VBoxGuest-$(KBUILD_TARGET).c_CFLAGS = -Wno-sign-compare # /usr/src/sys/sys/vmmeter.h: In function 'vm_paging_needed'
109 endif
110 endif
111 VBoxGuest_SOURCES += \
112 VBoxGuest.cpp
113 VBoxGuest_SOURCES.win += \
114 win/VBoxGuest.rc
115 VBoxGuest_SOURCES.win.x86 += \
116 ../../../Runtime/common/string/strcmp.asm \
117 ../../../Runtime/common/string/strchr.asm \
118 ../../../Runtime/r0drv/nt/nt3fakes-r0drv-nt.cpp \
119 ../../../Runtime/r0drv/nt/nt3fakesA-r0drv-nt.asm
120 VBoxGuest_LIBS += \
121 $(VBOX_LIB_VBGL_R0BASE) \
122 $(VBOX_LIB_IPRT_GUEST_R0)
123 VBoxGuest_ORDERDEPS.freebsd = \
124 $(PATH_STAGE)/gen-sys-hdrs/pci_if.h \
125 $(PATH_STAGE)/gen-sys-hdrs/bus_if.h \
126 $(PATH_STAGE)/gen-sys-hdrs/device_if.h
127 ifeq ($(KBUILD_TARGET),haiku)
128 # Haiku drivers cannot export symbols for other drivers, but modules can.
129 # Therefore vboxguest is a module containing the ring-0 guest lib, and vboxdev/vboxsf
130 # use this module to access the guest lib
131 SYSMODS += VBoxDev
132 VBoxDev_TEMPLATE = VBOXGUESTR0
133 VBoxDev_NAME = vboxdev
134 VBoxDev_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV) _KERNEL_MODE=1 VBGL_VBOXGUEST VBOX_WITH_HGCM IN_RING0
135 VBoxDev_SOURCES = VBoxDev-haiku.c VBoxGuest-haiku-stubs.c
136 endif
137 else # OS/2:
138 # The library order is crucial, so a bit of trickery is necessary.
139 # A library is used to make sure that VBoxGuestA-os2.asm is first in the link. (temporary hack?)
140 VBoxGuest_SOURCES = \
141 VBoxGuestA-os2.asm \
142 VBoxGuest-os2.def
143 #VBoxGuest_LDFLAGS = -s -t -v
144 VBoxGuest_LIBS = \
145 $(TARGET_VBoxGuestLibOs2Hack) \
146 $(VBOX_LIB_VBGL_R0BASE) \
147 $(VBOX_LIB_IPRT_GUEST_R0) \
148 $(VBOX_GCC_LIBGCC) \
149 end
150 ## When debugging init with kDrvTest:
151 #VBoxGuest_NAME = VBoxGst
152
153 # see
154 LIBRARIES += VBoxGuestLibOs2Hack
155 VBoxGuestLibOs2Hack_TEMPLATE = VBOXGUESTR0LIB
156 VBoxGuestLibOs2Hack_INSTTYPE = none
157 VBoxGuestLibOs2Hack_DEFS = $(VBoxGuest_DEFS)
158 VBoxGuestLibOs2Hack_INCS = \
159 . \
160 $(PATH_ROOT)/src/VBox/Runtime/include # for the os2ddk
161 VBoxGuestLibOs2Hack_SOURCES = \
162 VBoxGuest-os2.cpp \
163 VBoxGuest.cpp
164 endif # OS/2
165
166 VBoxGuest.cpp_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
167endif # enabled
168
169
170ifeq ($(KBUILD_TARGET), darwin)
171 # Files necessary to make a darwin kernel extension bundle.
172 INSTALLS += VBoxGuest.kext
173 VBoxGuest.kext_INST = $(INST_ADDITIONS)/VBoxGuest.kext/Contents/
174 VBoxGuest.kext_SOURCES = $(VBoxGuest.kext_0_OUTDIR)/Info.plist
175 VBoxGuest.kext_CLEAN = $(VBoxGuest.kext_0_OUTDIR)/Info.plist
176
177$$(VBoxGuest.kext_0_OUTDIR)/Info.plist: \
178 $(PATH_SUB_CURRENT)/darwin/Info.plist \
179 $(VBOX_VERSION_MK) | $$(dir $$@)
180 $(call MSG_GENERATE,VBoxGuest,$@,$<)
181 $(QUIET)$(RM) -f $@
182 $(QUIET)$(SED) \
183 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
184 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
185 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
186 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
187 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
188 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
189 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
190 --output $@ \
191 $<
192endif # darwin
193
194
195ifeq ($(KBUILD_TARGET),linux)
196 #
197 # Install the source files and script(s).
198 #
199 include $(PATH_SUB_CURRENT)/linux/files_vboxguest
200 # sources and stuff.
201 INSTALLS += vboxguest-src
202 vboxguest-src_INST = $(INST_ADDITIONS)src/vboxguest/
203 vboxguest-src_MODE = a+r,u+w
204 vboxguest-src_SOURCES = $(subst ",,$(FILES_VBOXGUEST_NOBIN))
205
206 INSTALLS += vboxguest-scripts
207 vboxguest-scripts_INST = $(INST_ADDITIONS)src/
208 vboxguest-scripts_MODE = a+rx,u+w
209 vboxguest-scripts_SOURCES = ../../../HostDrivers/linux/build_in_tmp
210
211 # scripts.
212 INSTALLS += vboxguest-sh
213 vboxguest-sh_INST = $(INST_ADDITIONS)src/vboxguest/
214 vboxguest-sh_MODE = a+rx,u+w
215 vboxguest-sh_SOURCES = $(subst ",,$(FILES_VBOXGUEST_BIN))
216
217 #
218 # Build test for the Guest Additions kernel module (kmk check).
219 #
220 if defined(VBOX_WITH_TESTCASES) \
221 && !defined(VBOX_ONLY_SDK) \
222 && !defined(VBOX_ONLY_DOCS) \
223 && !defined(VBOX_ONLY_VALIDATIONKIT) \
224 && !defined(VBOX_WITHOUT_LINUX_TEST_BUILDS) \
225 && "$(KBUILD_TARGET)" == "linux" \
226 && "$(KBUILD_HOST_ARCH)" == "$(KBUILD_TARGET_ARCH)"
227 ifneq ($(KERN_DIR),)
228 save_symvers = vboxguest-src
229 $(foreach module, vboxguest-src, $(evalcall2 VBOX_LINUX_GENERATE_KMOD_TEST))
230 endif
231 endif
232endif # Linux
233
234ifeq ($(KBUILD_TARGET),freebsd)
235 #
236 # Install the source files and script(s).
237 #
238 include $(PATH_SUB_CURRENT)/freebsd/files_vboxguest
239 # sources and stuff.
240 INSTALLS += vboxguest-src
241 vboxguest-src_INST = $(INST_ADDITIONS)src/vboxguest/
242 vboxguest-src_MODE = a+r,u+w
243 vboxguest-src_SOURCES = $(subst ",,$(FILES_VBOXGUEST_NOBIN))
244
245endif # FreeBSD
246
247ifeq ($(KBUILD_TARGET),win)
248 #
249 # VBoxGuestInst - The installer.
250 #
251 PROGRAMS.win.x86 += VBoxGuestInstNT
252 VBoxGuestInstNT_TEMPLATE = VBoxGuestR3Exe
253 VBoxGuestInstNT_SOURCES = win/VBoxGuestInst.cpp
254 VBoxGuestInstNT_USES = vboximportchecker
255 VBoxGuestInstNT_VBOX_IMPORT_CHECKER.win.x86 = nt31
256endif
257
258
259#
260# Helper script.
261#
262INSTALLS.solaris += VBoxGuestLoad
263VBoxGuestLoad_TEMPLATE = VBOXGUESTR0
264VBoxGuestLoad_EXEC_SOURCES = solaris/load.sh
265
266
267include $(FILE_KBUILD_SUB_FOOTER)
268
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