1 | # $Id: Makefile.kmk 63108 2016-08-06 16:47:06Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Sub-Makefile for the Cross Platform Guest Addition Services.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2007-2016 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 |
|
---|
18 | SUB_DEPTH = ../../../../..
|
---|
19 | include $(KBUILD_PATH)/subheader.kmk
|
---|
20 |
|
---|
21 | #
|
---|
22 | # Incldue testcases.
|
---|
23 | #
|
---|
24 | include $(PATH_SUB_CURRENT)/testcase/Makefile.kmk
|
---|
25 |
|
---|
26 | #
|
---|
27 | # Target lists.
|
---|
28 | #
|
---|
29 | PROGRAMS += VBoxService
|
---|
30 | PROGRAMS.win.x86 += VBoxServiceNT
|
---|
31 |
|
---|
32 | # Enable the timesync service within VBoxService.
|
---|
33 | VBOX_WITH_VBOXSERVICE_TIMESYNC := 1
|
---|
34 |
|
---|
35 | # Busybox-like toolbox, embedded into VBoxService.
|
---|
36 | VBOX_WITH_VBOXSERVICE_TOOLBOX := 1
|
---|
37 |
|
---|
38 | # VM-management functions, like memory ballooning and statistics.
|
---|
39 | VBOX_WITH_VBOXSERVICE_MANAGEMENT := 1
|
---|
40 |
|
---|
41 | if1of ($(KBUILD_TARGET), linux)
|
---|
42 | # CPU hotplugging.
|
---|
43 | VBOX_WITH_VBOXSERVICE_CPUHOTPLUG := 1
|
---|
44 | endif
|
---|
45 |
|
---|
46 | if1of ($(KBUILD_TARGET), win)
|
---|
47 | # Page Sharing (Page Fusion).
|
---|
48 | VBOX_WITH_VBOXSERVICE_PAGE_SHARING := 1
|
---|
49 | endif
|
---|
50 |
|
---|
51 | ifdef VBOX_WITH_GUEST_PROPS
|
---|
52 | VBOX_WITH_VBOXSERVICE_VMINFO := 1
|
---|
53 | endif
|
---|
54 |
|
---|
55 | ifdef VBOX_WITH_GUEST_CONTROL
|
---|
56 | # Guest Control.
|
---|
57 | VBOX_WITH_VBOXSERVICE_CONTROL := 1
|
---|
58 | endif
|
---|
59 |
|
---|
60 | #
|
---|
61 | # VBoxService
|
---|
62 | #
|
---|
63 | if "$(KBUILD_TARGET)" == "win" || defined(VBOX_WITH_MASOCHISTIC_WARNINGS) ## @todo use VBoxGuestR3Exe everywhere
|
---|
64 | VBoxService_TEMPLATE = VBoxGuestR3Exe
|
---|
65 | else
|
---|
66 | VBoxService_TEMPLATE = NewVBoxGuestR3Exe
|
---|
67 | endif
|
---|
68 |
|
---|
69 | # Define features to be activate.
|
---|
70 | VBoxService_DEFS += \
|
---|
71 | $(if $(VBOX_WITH_VBOXSERVICE_CONTROL),VBOX_WITH_VBOXSERVICE_CONTROL,) \
|
---|
72 | $(if $(VBOX_WITH_VBOXSERVICE_CPUHOTPLUG),VBOX_WITH_VBOXSERVICE_CPUHOTPLUG,) \
|
---|
73 | $(if $(VBOX_WITH_VBOXSERVICE_MANAGEMENT),VBOX_WITH_VBOXSERVICE_MANAGEMENT,) \
|
---|
74 | $(if $(VBOX_WITH_VBOXSERVICE_PAGE_SHARING),VBOX_WITH_VBOXSERVICE_PAGE_SHARING,) \
|
---|
75 | $(if $(VBOX_WITH_VBOXSERVICE_TIMESYNC),VBOX_WITH_VBOXSERVICE_TIMESYNC,) \
|
---|
76 | $(if $(VBOX_WITH_VBOXSERVICE_TOOLBOX),VBOX_WITH_VBOXSERVICE_TOOLBOX,) \
|
---|
77 | $(if $(VBOX_WITH_VBOXSERVICE_VMINFO),VBOX_WITH_VBOXSERVICE_VMINFO,)
|
---|
78 |
|
---|
79 | # Import global defines.
|
---|
80 | VBoxService_DEFS += \
|
---|
81 | $(if $(VBOX_WITH_DBUS),VBOX_WITH_DBUS,) \
|
---|
82 | $(if $(VBOX_WITH_GUEST_CONTROL),VBOX_WITH_GUEST_CONTROL,) \
|
---|
83 | $(if $(VBOX_WITH_GUEST_PROPS),VBOX_WITH_GUEST_PROPS,) \
|
---|
84 | $(if $(VBOX_WITH_HGCM),VBOX_WITH_HGCM,)
|
---|
85 |
|
---|
86 | VBoxService_DEFS += \
|
---|
87 | VBOX_BUILD_TARGET=\"$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)\"
|
---|
88 | VBoxService_DEFS.win += _WIN32_WINNT=0x0501
|
---|
89 | VBoxService_DEFS.os2 = VBOX_WITH_HGCM VBOX_WITH_VBOXSERVICE_CLIPBOARD
|
---|
90 |
|
---|
91 | ifdef VBOX_WITH_SHARED_FOLDERS
|
---|
92 | # darwin freebsd
|
---|
93 | if1of ($(KBUILD_TARGET), linux solaris)
|
---|
94 | VBoxService_DEFS += VBOX_WITH_SHARED_FOLDERS
|
---|
95 | endif
|
---|
96 | endif
|
---|
97 |
|
---|
98 | VBoxService_SOURCES = \
|
---|
99 | VBoxService.cpp \
|
---|
100 | VBoxServiceUtils.cpp \
|
---|
101 | VBoxServiceStats.cpp
|
---|
102 |
|
---|
103 | ifdef VBOX_WITH_VBOXSERVICE_TIMESYNC
|
---|
104 | VBoxService_SOURCES += \
|
---|
105 | VBoxServiceTimeSync.cpp
|
---|
106 | endif
|
---|
107 |
|
---|
108 | ifdef VBOX_WITH_VBOXSERVICE_TOOLBOX
|
---|
109 | VBoxService_SOURCES += \
|
---|
110 | VBoxServiceToolBox.cpp
|
---|
111 | endif
|
---|
112 |
|
---|
113 | ifdef VBOX_WITH_VBOXSERVICE_CONTROL
|
---|
114 | VBoxService_SOURCES += \
|
---|
115 | VBoxServiceControl.cpp \
|
---|
116 | VBoxServiceControlProcess.cpp \
|
---|
117 | VBoxServiceControlSession.cpp
|
---|
118 | endif
|
---|
119 |
|
---|
120 | ifdef VBOX_WITH_VBOXSERVICE_MANAGEMENT
|
---|
121 | VBoxService_SOURCES += \
|
---|
122 | VBoxServiceBalloon.cpp
|
---|
123 | VBoxService_DEFS += $(if $(VBOX_WITH_MEMBALLOON),VBOX_WITH_MEMBALLOON,)
|
---|
124 | endif
|
---|
125 |
|
---|
126 | if1of ($(KBUILD_TARGET), win)
|
---|
127 | VBoxService_SOURCES += \
|
---|
128 | VBoxServicePageSharing.cpp
|
---|
129 | endif
|
---|
130 |
|
---|
131 | ifdef VBOX_WITH_VBOXSERVICE_VMINFO
|
---|
132 | VBoxService_SOURCES.win += \
|
---|
133 | VBoxServiceVMInfo-win.cpp
|
---|
134 | VBoxService_SOURCES += \
|
---|
135 | VBoxServiceVMInfo.cpp \
|
---|
136 | VBoxServicePropCache.cpp
|
---|
137 | endif
|
---|
138 |
|
---|
139 | ifdef VBOX_WITH_VBOXSERVICE_CPUHOTPLUG
|
---|
140 | VBoxService_SOURCES += \
|
---|
141 | VBoxServiceCpuHotPlug.cpp
|
---|
142 | endif
|
---|
143 |
|
---|
144 | ifdef VBOX_WITH_SHARED_FOLDERS
|
---|
145 | if1of ($(KBUILD_TARGET), linux solaris)
|
---|
146 | VBoxService_SOURCES += \
|
---|
147 | VBoxServiceAutoMount.cpp
|
---|
148 | VBoxService_SOURCES.linux += \
|
---|
149 | ../../linux/sharedfolders/vbsfmount.c
|
---|
150 | endif
|
---|
151 | endif
|
---|
152 |
|
---|
153 | VBoxService_SOURCES.win += \
|
---|
154 | VBoxService-win.rc \
|
---|
155 | VBoxService-win.cpp
|
---|
156 |
|
---|
157 | VBoxService_SOURCES.os2 = \
|
---|
158 | VBoxService-os2.def \
|
---|
159 | VBoxServiceClipboard-os2.cpp
|
---|
160 |
|
---|
161 | VBoxService_LDFLAGS.darwin = -framework IOKit
|
---|
162 |
|
---|
163 | VBoxService_LIBS += \
|
---|
164 | $(VBOX_LIB_IPRT_GUEST_R3) \
|
---|
165 | $(VBOX_LIB_VBGL_R3) \
|
---|
166 | $(VBOX_LIB_IPRT_GUEST_R3) # (The joy of unix linkers.)
|
---|
167 | if1of ($(KBUILD_TARGET), linux)
|
---|
168 | VBoxService_LIBS += \
|
---|
169 | crypt
|
---|
170 | endif
|
---|
171 | ifdef VBOX_WITH_DBUS
|
---|
172 | if1of ($(KBUILD_TARGET), linux solaris) # FreeBSD?
|
---|
173 | VBoxService_LIBS += \
|
---|
174 | dl
|
---|
175 | endif
|
---|
176 | endif
|
---|
177 | ifdef VBOX_WITH_GUEST_PROPS
|
---|
178 | VBoxService_LIBS.win += \
|
---|
179 | Secur32.lib \
|
---|
180 | WtsApi32.lib \
|
---|
181 | Psapi.lib
|
---|
182 | VBoxService_LIBS.solaris += \
|
---|
183 | nsl \
|
---|
184 | kstat \
|
---|
185 | contract
|
---|
186 | endif
|
---|
187 |
|
---|
188 | #
|
---|
189 | # VBoxServiceNT - NT4 version of VBoxService.
|
---|
190 | #
|
---|
191 | VBoxServiceNT_TEMPLATE = VBoxGuestR3Exe
|
---|
192 | VBoxServiceNT_EXTENDS = VBoxService
|
---|
193 | VBoxServiceNT_DEFS.win = _WIN32_WINNT=0x0400 TARGET_NT4 VBOX_WITH_VBOXSERVICE_MANAGEMENT
|
---|
194 |
|
---|
195 | VBoxServiceVMInfo.cpp_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
|
---|
196 | VBoxServiceVMInfo.cpp_DEPS = $(VBOX_SVN_REV_KMK)
|
---|
197 |
|
---|
198 | #
|
---|
199 | # The icon is configurable.
|
---|
200 | #
|
---|
201 | VBoxService-win.rc_INCS = $(VBoxService_0_OUTDIR)
|
---|
202 | VBoxService-win.rc_DEPS = $(VBoxService_0_OUTDIR)/VBoxService-win-icon.rc
|
---|
203 | VBoxService-win.rc_CLEAN = $(VBoxService_0_OUTDIR)/VBoxService-win-icon.rc
|
---|
204 |
|
---|
205 | # Icon include file.
|
---|
206 | $$(VBoxService_0_OUTDIR)/VBoxService-win-icon.rc: $(VBOX_WINDOWS_ADDITIONS_ICON_FILE) $$(VBoxService_DEFPATH)/Makefile.kmk | $$(dir $$@)
|
---|
207 | $(RM) -f $@
|
---|
208 | $(APPEND) $@ 'IDI_VIRTUALBOX ICON DISCARDABLE "$(subst /,\\,$(VBOX_WINDOWS_ADDITIONS_ICON_FILE))"'
|
---|
209 |
|
---|
210 | include $(FILE_KBUILD_SUB_FOOTER)
|
---|
211 |
|
---|