VirtualBox

source: vbox/trunk/src/VBox/Additions/common/VBoxService/Makefile.kmk@ 63206

Last change on this file since 63206 was 63108, checked in by vboxsync, 8 years ago

GA/common,Config.kmk: Use strict kBuild templates for building all the NT GA bits.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.8 KB
Line 
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
18SUB_DEPTH = ../../../../..
19include $(KBUILD_PATH)/subheader.kmk
20
21#
22# Incldue testcases.
23#
24include $(PATH_SUB_CURRENT)/testcase/Makefile.kmk
25
26#
27# Target lists.
28#
29PROGRAMS += VBoxService
30PROGRAMS.win.x86 += VBoxServiceNT
31
32# Enable the timesync service within VBoxService.
33VBOX_WITH_VBOXSERVICE_TIMESYNC := 1
34
35# Busybox-like toolbox, embedded into VBoxService.
36VBOX_WITH_VBOXSERVICE_TOOLBOX := 1
37
38# VM-management functions, like memory ballooning and statistics.
39VBOX_WITH_VBOXSERVICE_MANAGEMENT := 1
40
41if1of ($(KBUILD_TARGET), linux)
42 # CPU hotplugging.
43 VBOX_WITH_VBOXSERVICE_CPUHOTPLUG := 1
44endif
45
46if1of ($(KBUILD_TARGET), win)
47 # Page Sharing (Page Fusion).
48 VBOX_WITH_VBOXSERVICE_PAGE_SHARING := 1
49endif
50
51ifdef VBOX_WITH_GUEST_PROPS
52 VBOX_WITH_VBOXSERVICE_VMINFO := 1
53endif
54
55ifdef VBOX_WITH_GUEST_CONTROL
56 # Guest Control.
57 VBOX_WITH_VBOXSERVICE_CONTROL := 1
58endif
59
60#
61# VBoxService
62#
63if "$(KBUILD_TARGET)" == "win" || defined(VBOX_WITH_MASOCHISTIC_WARNINGS) ## @todo use VBoxGuestR3Exe everywhere
64VBoxService_TEMPLATE = VBoxGuestR3Exe
65else
66VBoxService_TEMPLATE = NewVBoxGuestR3Exe
67endif
68
69# Define features to be activate.
70VBoxService_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.
80VBoxService_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
86VBoxService_DEFS += \
87 VBOX_BUILD_TARGET=\"$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)\"
88VBoxService_DEFS.win += _WIN32_WINNT=0x0501
89VBoxService_DEFS.os2 = VBOX_WITH_HGCM VBOX_WITH_VBOXSERVICE_CLIPBOARD
90
91ifdef VBOX_WITH_SHARED_FOLDERS
92 # darwin freebsd
93 if1of ($(KBUILD_TARGET), linux solaris)
94 VBoxService_DEFS += VBOX_WITH_SHARED_FOLDERS
95 endif
96endif
97
98VBoxService_SOURCES = \
99 VBoxService.cpp \
100 VBoxServiceUtils.cpp \
101 VBoxServiceStats.cpp
102
103ifdef VBOX_WITH_VBOXSERVICE_TIMESYNC
104 VBoxService_SOURCES += \
105 VBoxServiceTimeSync.cpp
106endif
107
108ifdef VBOX_WITH_VBOXSERVICE_TOOLBOX
109 VBoxService_SOURCES += \
110 VBoxServiceToolBox.cpp
111endif
112
113ifdef VBOX_WITH_VBOXSERVICE_CONTROL
114 VBoxService_SOURCES += \
115 VBoxServiceControl.cpp \
116 VBoxServiceControlProcess.cpp \
117 VBoxServiceControlSession.cpp
118endif
119
120ifdef VBOX_WITH_VBOXSERVICE_MANAGEMENT
121 VBoxService_SOURCES += \
122 VBoxServiceBalloon.cpp
123 VBoxService_DEFS += $(if $(VBOX_WITH_MEMBALLOON),VBOX_WITH_MEMBALLOON,)
124endif
125
126if1of ($(KBUILD_TARGET), win)
127 VBoxService_SOURCES += \
128 VBoxServicePageSharing.cpp
129endif
130
131ifdef VBOX_WITH_VBOXSERVICE_VMINFO
132 VBoxService_SOURCES.win += \
133 VBoxServiceVMInfo-win.cpp
134 VBoxService_SOURCES += \
135 VBoxServiceVMInfo.cpp \
136 VBoxServicePropCache.cpp
137endif
138
139ifdef VBOX_WITH_VBOXSERVICE_CPUHOTPLUG
140 VBoxService_SOURCES += \
141 VBoxServiceCpuHotPlug.cpp
142endif
143
144ifdef 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
151endif
152
153VBoxService_SOURCES.win += \
154 VBoxService-win.rc \
155 VBoxService-win.cpp
156
157VBoxService_SOURCES.os2 = \
158 VBoxService-os2.def \
159 VBoxServiceClipboard-os2.cpp
160
161VBoxService_LDFLAGS.darwin = -framework IOKit
162
163VBoxService_LIBS += \
164 $(VBOX_LIB_IPRT_GUEST_R3) \
165 $(VBOX_LIB_VBGL_R3) \
166 $(VBOX_LIB_IPRT_GUEST_R3) # (The joy of unix linkers.)
167if1of ($(KBUILD_TARGET), linux)
168 VBoxService_LIBS += \
169 crypt
170endif
171ifdef VBOX_WITH_DBUS
172 if1of ($(KBUILD_TARGET), linux solaris) # FreeBSD?
173 VBoxService_LIBS += \
174 dl
175 endif
176endif
177ifdef 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
186endif
187
188#
189# VBoxServiceNT - NT4 version of VBoxService.
190#
191VBoxServiceNT_TEMPLATE = VBoxGuestR3Exe
192VBoxServiceNT_EXTENDS = VBoxService
193VBoxServiceNT_DEFS.win = _WIN32_WINNT=0x0400 TARGET_NT4 VBOX_WITH_VBOXSERVICE_MANAGEMENT
194
195VBoxServiceVMInfo.cpp_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
196VBoxServiceVMInfo.cpp_DEPS = $(VBOX_SVN_REV_KMK)
197
198#
199# The icon is configurable.
200#
201VBoxService-win.rc_INCS = $(VBoxService_0_OUTDIR)
202VBoxService-win.rc_DEPS = $(VBoxService_0_OUTDIR)/VBoxService-win-icon.rc
203VBoxService-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
210include $(FILE_KBUILD_SUB_FOOTER)
211
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use