1 | # $Id: Makefile.kmk 98195 2023-01-22 00:46:54Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Sub-Makefile for the Cross Platform Guest Addition Services.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2007-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 | # SPDX-License-Identifier: GPL-3.0-only
|
---|
26 | #
|
---|
27 |
|
---|
28 | SUB_DEPTH = ../../../../..
|
---|
29 | include $(KBUILD_PATH)/subheader.kmk
|
---|
30 |
|
---|
31 | #
|
---|
32 | # Incldue testcases.
|
---|
33 | #
|
---|
34 | include $(PATH_SUB_CURRENT)/testcase/Makefile.kmk
|
---|
35 |
|
---|
36 |
|
---|
37 | #
|
---|
38 | # Target lists.
|
---|
39 | #
|
---|
40 | PROGRAMS += VBoxService
|
---|
41 |
|
---|
42 |
|
---|
43 | #
|
---|
44 | # Globals?
|
---|
45 | #
|
---|
46 | # Enable the timesync service within VBoxService.
|
---|
47 | VBOX_WITH_VBOXSERVICE_TIMESYNC := 1
|
---|
48 |
|
---|
49 | # Busybox-like toolbox, embedded into VBoxService.
|
---|
50 | VBOX_WITH_VBOXSERVICE_TOOLBOX := 1
|
---|
51 |
|
---|
52 | # VM-management functions, like memory ballooning and statistics.
|
---|
53 | VBOX_WITH_VBOXSERVICE_MANAGEMENT := 1
|
---|
54 |
|
---|
55 | if1of ($(KBUILD_TARGET), linux)
|
---|
56 | # CPU hotplugging.
|
---|
57 | VBOX_WITH_VBOXSERVICE_CPUHOTPLUG := 1
|
---|
58 | endif
|
---|
59 |
|
---|
60 | # Page Sharing (Page Fusion).
|
---|
61 | if1of ($(KBUILD_TARGET), win)
|
---|
62 | VBOX_WITH_VBOXSERVICE_PAGE_SHARING := 1
|
---|
63 | endif
|
---|
64 |
|
---|
65 | ifdef VBOX_WITH_GUEST_PROPS
|
---|
66 | VBOX_WITH_VBOXSERVICE_VMINFO := 1
|
---|
67 | endif
|
---|
68 |
|
---|
69 | # Guest Control.
|
---|
70 | ifdef VBOX_WITH_GUEST_CONTROL
|
---|
71 | VBOX_WITH_VBOXSERVICE_CONTROL := 1
|
---|
72 | endif
|
---|
73 |
|
---|
74 | # Shared Clipboard.
|
---|
75 | ifdef VBOX_WITH_SHARED_CLIPBOARD
|
---|
76 | VBOX_WITH_VBOXSERVICE_CLIPBOARD := 1
|
---|
77 | endif
|
---|
78 |
|
---|
79 | # DRM Resize.
|
---|
80 | if "$(KBUILD_TARGET)" == "linux" && defined(VBOX_WITH_GUEST_PROPS)
|
---|
81 | # The DRM resizing code needs guest properties.
|
---|
82 | VBOX_WITH_VBOXSERVICE_DRMRESIZE := 1
|
---|
83 | endif
|
---|
84 |
|
---|
85 |
|
---|
86 | #
|
---|
87 | # VBoxService
|
---|
88 | #
|
---|
89 | VBoxService_TEMPLATE = VBoxGuestR3Exe
|
---|
90 |
|
---|
91 | VBoxService_DEFS = \
|
---|
92 | $(if $(VBOX_WITH_VBOXSERVICE_CONTROL),VBOX_WITH_VBOXSERVICE_CONTROL,) \
|
---|
93 | $(if $(VBOX_WITH_VBOXSERVICE_CPUHOTPLUG),VBOX_WITH_VBOXSERVICE_CPUHOTPLUG,) \
|
---|
94 | $(if $(VBOX_WITH_VBOXSERVICE_DRMRESIZE),VBOX_WITH_VBOXSERVICE_DRMRESIZE,) \
|
---|
95 | $(if $(VBOX_WITH_VBOXSERVICE_MANAGEMENT),VBOX_WITH_VBOXSERVICE_MANAGEMENT,) \
|
---|
96 | $(if $(VBOX_WITH_VBOXSERVICE_PAGE_SHARING),VBOX_WITH_VBOXSERVICE_PAGE_SHARING,) \
|
---|
97 | $(if $(VBOX_WITH_VBOXSERVICE_TIMESYNC),VBOX_WITH_VBOXSERVICE_TIMESYNC,) \
|
---|
98 | $(if $(VBOX_WITH_VBOXSERVICE_TOOLBOX),VBOX_WITH_VBOXSERVICE_TOOLBOX,) \
|
---|
99 | $(if $(VBOX_WITH_VBOXSERVICE_VMINFO),VBOX_WITH_VBOXSERVICE_VMINFO,) \
|
---|
100 | $(if $(VBOX_WITH_DBUS),VBOX_WITH_DBUS,) \
|
---|
101 | $(if $(VBOX_WITH_GUEST_CONTROL),VBOX_WITH_GUEST_CONTROL,) \
|
---|
102 | $(if $(VBOX_WITH_GUEST_PROPS),VBOX_WITH_GUEST_PROPS,) \
|
---|
103 | $(if $(VBOX_WITH_HGCM),VBOX_WITH_HGCM,)
|
---|
104 | ifdef VBOX_WITH_AUTOMATIC_DEFS_QUOTING
|
---|
105 | VBoxService_DEFS += VBOX_BUILD_TARGET="$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)"
|
---|
106 | else
|
---|
107 | VBoxService_DEFS += VBOX_BUILD_TARGET=\"$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)\"
|
---|
108 | endif
|
---|
109 | VBoxService_DEFS.win += _WIN32_WINNT=0x0501
|
---|
110 | VBoxService_DEFS.os2 = VBOX_WITH_HGCM
|
---|
111 |
|
---|
112 | VBoxService_SOURCES = \
|
---|
113 | VBoxService.cpp \
|
---|
114 | VBoxServiceUtils.cpp \
|
---|
115 | VBoxServiceStats.cpp
|
---|
116 |
|
---|
117 | ifdef VBOX_WITH_VBOXSERVICE_TIMESYNC
|
---|
118 | VBoxService_SOURCES += \
|
---|
119 | VBoxServiceTimeSync.cpp
|
---|
120 | endif
|
---|
121 |
|
---|
122 | ifdef VBOX_WITH_VBOXSERVICE_CLIPBOARD
|
---|
123 | VBoxService_DEFS.os2 += VBOX_WITH_VBOXSERVICE_CLIPBOARD VBOX_WITH_SHARED_CLIPBOARD
|
---|
124 | VBoxService_SOURCES.os2 += \
|
---|
125 | VBoxServiceClipboard-os2.cpp \
|
---|
126 | $(PATH_ROOT)/src/VBox/GuestHost/SharedClipboard/clipboard-common.cpp
|
---|
127 | endif
|
---|
128 |
|
---|
129 | ifdef VBOX_WITH_VBOXSERVICE_TOOLBOX
|
---|
130 | VBoxService_SOURCES += \
|
---|
131 | VBoxServiceToolBox.cpp
|
---|
132 | endif
|
---|
133 |
|
---|
134 | ifdef VBOX_WITH_VBOXSERVICE_CONTROL
|
---|
135 | VBoxService_SOURCES += \
|
---|
136 | VBoxServiceControl.cpp \
|
---|
137 | VBoxServiceControlProcess.cpp \
|
---|
138 | VBoxServiceControlSession.cpp
|
---|
139 | endif
|
---|
140 |
|
---|
141 | ifdef VBOX_WITH_VBOXSERVICE_MANAGEMENT
|
---|
142 | ifdef VBOX_WITH_MEMBALLOON
|
---|
143 | VBoxService_SOURCES += \
|
---|
144 | VBoxServiceBalloon.cpp
|
---|
145 | VBoxService_DEFS += VBOX_WITH_MEMBALLOON
|
---|
146 | endif
|
---|
147 | endif
|
---|
148 |
|
---|
149 | if1of ($(KBUILD_TARGET), win)
|
---|
150 | VBoxService_SOURCES += \
|
---|
151 | VBoxServicePageSharing.cpp
|
---|
152 | endif
|
---|
153 |
|
---|
154 | ifdef VBOX_WITH_VBOXSERVICE_VMINFO
|
---|
155 | VBoxService_SOURCES.win += \
|
---|
156 | VBoxServiceVMInfo-win.cpp
|
---|
157 | VBoxService_SOURCES += \
|
---|
158 | VBoxServiceVMInfo.cpp \
|
---|
159 | VBoxServicePropCache.cpp
|
---|
160 | endif
|
---|
161 |
|
---|
162 | ifdef VBOX_WITH_VBOXSERVICE_CPUHOTPLUG
|
---|
163 | VBoxService_SOURCES += \
|
---|
164 | VBoxServiceCpuHotPlug.cpp
|
---|
165 | endif
|
---|
166 |
|
---|
167 | ifdef VBOX_WITH_SHARED_FOLDERS
|
---|
168 | if1of ($(KBUILD_TARGET), linux os2 solaris win)
|
---|
169 | VBoxService_DEFS += VBOX_WITH_SHARED_FOLDERS
|
---|
170 | VBoxService_SOURCES += \
|
---|
171 | VBoxServiceAutoMount.cpp
|
---|
172 | VBoxService_SOURCES.linux += \
|
---|
173 | ../../linux/sharedfolders/vbsfmount.c
|
---|
174 | VBoxService_LIBS.win += \
|
---|
175 | Mpr.Lib
|
---|
176 | endif
|
---|
177 | endif
|
---|
178 |
|
---|
179 | VBoxService_SOURCES.win += \
|
---|
180 | VBoxService-win.cpp
|
---|
181 |
|
---|
182 | VBoxService_SOURCES.os2 += \
|
---|
183 | VBoxService-os2.def
|
---|
184 |
|
---|
185 | VBoxService_LDFLAGS.darwin = -framework IOKit
|
---|
186 |
|
---|
187 | VBoxService_LIBS += \
|
---|
188 | $(VBOX_LIB_IPRT_GUEST_R3) \
|
---|
189 | $(VBOX_LIB_VBGL_R3) \
|
---|
190 | $(VBOX_LIB_IPRT_GUEST_R3) # (The joy of unix linkers.)
|
---|
191 | ifdef VBOX_WITH_DBUS
|
---|
192 | if1of ($(KBUILD_TARGET), linux solaris) # FreeBSD?
|
---|
193 | VBoxService_LIBS += \
|
---|
194 | dl
|
---|
195 | endif
|
---|
196 | endif
|
---|
197 | VBoxService_LIBS.netbsd += crypt
|
---|
198 | ifdef VBOX_WITH_GUEST_PROPS
|
---|
199 | VBoxService_LIBS.win += \
|
---|
200 | Secur32.lib \
|
---|
201 | WtsApi32.lib \
|
---|
202 | Psapi.lib
|
---|
203 | VBoxService_LIBS.solaris += \
|
---|
204 | nsl \
|
---|
205 | kstat \
|
---|
206 | contract
|
---|
207 | endif
|
---|
208 |
|
---|
209 | ifdef VBOX_WITH_VBOXSERVICE_VMINFO
|
---|
210 | VBoxServiceVMInfo.cpp_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
|
---|
211 | VBoxServiceVMInfo.cpp_DEPS = $(VBOX_SVN_REV_KMK)
|
---|
212 | endif
|
---|
213 |
|
---|
214 | VBoxService_USES.win += vboximportchecker
|
---|
215 | VBoxService_VBOX_IMPORT_CHECKER.win.x86 = nt31
|
---|
216 | VBoxService_VBOX_IMPORT_CHECKER.win.amd64 = xp64
|
---|
217 |
|
---|
218 | $(call VBOX_SET_VER_INFO_EXE,VBoxService,VirtualBox Guest Additions Service,$(VBOX_WINDOWS_ICON_FILE)) # Version info / description.
|
---|
219 |
|
---|
220 | include $(FILE_KBUILD_SUB_FOOTER)
|
---|