1 | # $Id: Makefile.kmk 9360 2008-06-03 17:10:09Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Makefile for the VBox Main module.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2006-2007 Sun Microsystems, Inc.
|
---|
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 | # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
|
---|
18 | # Clara, CA 95054 USA or visit http://www.sun.com if you need
|
---|
19 | # additional information or have any questions.
|
---|
20 | #
|
---|
21 |
|
---|
22 | DEPTH = ../../..
|
---|
23 | include $(KBUILD_PATH)/subheader.kmk
|
---|
24 |
|
---|
25 | # Include sub-makefile(s) first if we're doing parallel building.
|
---|
26 | # This is primarily a hack to try avoid idling all but one cpu when
|
---|
27 | # building the gigant soap sources.
|
---|
28 | ifneq ($(KMK_OPTS_JOBS),1)
|
---|
29 | ifdef VBOX_WITH_WEBSERVICES
|
---|
30 | include $(PATH_SUB_CURRENT)/webservice/Makefile.kmk
|
---|
31 | endif
|
---|
32 | include $(PATH_SUB_CURRENT)/testcase/Makefile.kmk
|
---|
33 | endif
|
---|
34 |
|
---|
35 | # targets++
|
---|
36 | LIBRARIES += VBoxCOM
|
---|
37 | DLLS += VBoxSettings VBoxC
|
---|
38 | PROGRAMS += VBoxSVC
|
---|
39 | VBOX_MAIN_DEFS =
|
---|
40 | ifneq ($(KBUILD_TARGET),win)
|
---|
41 | ifndef VBOX_WITH_XPCOM
|
---|
42 | $(error "VBox: VBOX_WITH_XPCOM isn't defined")
|
---|
43 | endif
|
---|
44 | DLLS += VBoxSVCM
|
---|
45 | ifneq ($(KBUILD_TARGET),os2)
|
---|
46 | VBOX_MAIN_DEFS+= VBOX_WITH_SYS_V_IPC_SESSION_WATCHER
|
---|
47 | endif
|
---|
48 | VBOX_MAIN_DEFS += VBOX_WITH_UNIXY_TAP_NETWORKING
|
---|
49 | endif
|
---|
50 | if1of ($(KBUILD_TARGET), linux freebsd solaris)
|
---|
51 | VBOX_MAIN_DEFS += VBOX_MAIN_USE_SEMRW
|
---|
52 | #else
|
---|
53 | # if1of ($(VBOX_VERSION_BUILD),1 3 5 7 9)
|
---|
54 | # VBOX_MAIN_DEFS += VBOX_MAIN_AUTOLOCK_TRAP
|
---|
55 | # endif
|
---|
56 | endif
|
---|
57 |
|
---|
58 | ## @todo eliminate or expand VBOX_MAIN_DEFS.
|
---|
59 |
|
---|
60 | #PROGRAMS += tstCFGLdr
|
---|
61 |
|
---|
62 | ifeq ($(KBUILD_TARGET),win)
|
---|
63 | OTHERS += $(PATH_BIN)/comregister.cmd
|
---|
64 | IDLFILE = $(VBOX_PATH_SDK)/idl/VirtualBox.idl
|
---|
65 | OTHER_CLEAN += \
|
---|
66 | $(PATH_BIN)/comregister.cmd \
|
---|
67 | $(VBOX_PATH_SDK)/include/VirtualBox.h \
|
---|
68 | $(IDLFILE) \
|
---|
69 | $(VBOX_PATH_SDK)/lib/VirtualBox.tlb \
|
---|
70 | $(VBOX_PATH_SDK)/lib/VirtualBox_i.c \
|
---|
71 | $(PATH_VBoxCOM)/VirtualBox.h \
|
---|
72 | $(PATH_VBoxCOM)/VirtualBox_i.c \
|
---|
73 | $(PATH_VBoxCOM)/VirtualBox.tlb
|
---|
74 | else
|
---|
75 | INSTALLS += xpcom-components
|
---|
76 | IDLFILE = $(VBOX_PATH_SDK)/idl/VirtualBox_XPCOM.idl
|
---|
77 | ifeq ($(KBUILD_TARGET),linux)
|
---|
78 | IDLTYPELIB = $(PATH_BIN)/VirtualBox_XPCOM.xpt
|
---|
79 | else
|
---|
80 | IDLTYPELIB = $(PATH_BIN)/components/VirtualBox_XPCOM.xpt
|
---|
81 | endif
|
---|
82 | IDLHEADER = $(VBOX_PATH_SDK)/include/VirtualBox_XPCOM.h
|
---|
83 | OTHERS += $(IDLTYPELIB)
|
---|
84 | OTHER_CLEAN += \
|
---|
85 | $(IDLFILE) \
|
---|
86 | $(IDLHEADER) \
|
---|
87 | $(IDLTYPELIB)
|
---|
88 |
|
---|
89 | endif
|
---|
90 |
|
---|
91 |
|
---|
92 | #
|
---|
93 | # The Main API documentation
|
---|
94 | #
|
---|
95 | docs: $(PATH_TARGET)/docs.Main
|
---|
96 |
|
---|
97 | $(PATH_TARGET)/docs.Main: \
|
---|
98 | Doxyfile.Main \
|
---|
99 | idl/doxygen.xsl \
|
---|
100 | idl/VirtualBox.xidl \
|
---|
101 | | $(call DIRDEP, $(PATH_TARGET)) \
|
---|
102 | $(call DIRDEP, $(PATH_OUT)/docs/Main)
|
---|
103 | $(RM) -f $(wildcard $(PATH_OUT)/docs/Main/html/*)
|
---|
104 | $(VBOX_XSLTPROC) -o $(PATH_TARGET)/VirtualBox.idl idl/doxygen.xsl idl/VirtualBox.xidl
|
---|
105 | $(REDIRECT) -E 'PATH_OUT=$(PATH_OUT)' -E 'PATH_TARGET=$(PATH_TARGET)' -E 'PATH_CHM=$(subst /,\,$(PATH_BIN)/VirtualBoxAPI.chm)' \
|
---|
106 | -- doxygen Doxyfile.Main
|
---|
107 | -$(EXEC_X86_WIN32) $(VBOX_PATH_HTML_HELP_WORKSHOP)/hhc.exe $(subst /,\\,$(PATH_OUT)/docs/Main/html/index.hhp)
|
---|
108 | $(APPEND) $(PATH_TARGET)/docs.Main
|
---|
109 |
|
---|
110 | $(call DIRDEP, $(PATH_OUT)/docs/Main):
|
---|
111 | $(MKDIR) -p $@
|
---|
112 |
|
---|
113 |
|
---|
114 | #
|
---|
115 | # VBoxSVC executable
|
---|
116 | #
|
---|
117 | VBoxSVC_TEMPLATE = VBOXMAINEXE
|
---|
118 | VBoxSVC_DEFS = VBOX_MAIN_SETTINGS_ADDONS $(VBOX_MAIN_DEFS)
|
---|
119 | ifdef VBOX_WITH_VRDP
|
---|
120 | VBoxSVC_DEFS += VBOX_VRDP
|
---|
121 | endif
|
---|
122 | ifdef VBOX_WITH_HGCM
|
---|
123 | VBoxSVC_DEFS += VBOX_HGCM
|
---|
124 | endif
|
---|
125 | ifdef VBOX_MAIN_RELEASE_LOG
|
---|
126 | VBoxSVC_DEFS += VBOX_MAIN_RELEASE_LOG LOG_ENABLED
|
---|
127 | endif
|
---|
128 | ifdef VBOX_WITH_USB
|
---|
129 | VBoxSVC_DEFS += VBOX_WITH_USB
|
---|
130 | ifdef VBOX_WITH_EHCI
|
---|
131 | VBoxSVC_DEFS += VBOX_WITH_EHCI
|
---|
132 | endif
|
---|
133 | ifdef VBOX_WITH_NEW_USB_CODE_ON_DARWIN
|
---|
134 | VBoxSVC_DEFS += VBOX_WITH_NEW_USB_CODE_ON_DARWIN
|
---|
135 | endif
|
---|
136 | endif
|
---|
137 | ifdef VBOX_WITH_ALSA
|
---|
138 | VBoxSVC_DEFS += VBOX_WITH_ALSA
|
---|
139 | endif
|
---|
140 | ifdef VBOX_WITH_PULSE
|
---|
141 | VBoxSVC_DEFS += VBOX_WITH_PULSE
|
---|
142 | endif
|
---|
143 | ifdef VBOX_WITH_WINMM
|
---|
144 | VBoxSVC_DEFS += VBOX_WITH_WINMM
|
---|
145 | endif
|
---|
146 | ifdef VBOX_WITH_E1000
|
---|
147 | VBoxSVC_DEFS += VBOX_WITH_E1000
|
---|
148 | endif
|
---|
149 | ifdef VBOX_WITH_AHCI
|
---|
150 | VBoxSVC_DEFS += VBOX_WITH_AHCI
|
---|
151 | endif
|
---|
152 | ifdef VBOX_WITHOUT_LINUX_COMPILER_H
|
---|
153 | VBoxSVC_DEFS += VBOX_WITHOUT_LINUX_COMPILER_H
|
---|
154 | endif
|
---|
155 |
|
---|
156 | VBoxSVC_DEFS.win += VBOX_COM_OUTOFPROC_MODULE
|
---|
157 | VBoxSVC_DEFS.win.x86 += _WIN32_WINNT=0x0500
|
---|
158 | VBoxSVC_DEFS.win.amd64 += _WIN32_WINNT=0x0510
|
---|
159 | VBoxSVC_DEFS.linux += VBOX_USE_LIBHAL
|
---|
160 | VBoxSVC_DEFS.solaris += VBOX_USE_LIBHAL
|
---|
161 |
|
---|
162 | VBoxSVC_INCS = \
|
---|
163 | include \
|
---|
164 | $(PATH_VBoxSVC) \
|
---|
165 | $(PATH_CURRENT)
|
---|
166 | VBoxSVC_INCS.win = \
|
---|
167 | $(PATH_VBoxCOM)
|
---|
168 | ifdef VBOX_WITH_USB
|
---|
169 | VBoxSVC_INCS.os2 = \
|
---|
170 | $(PATH_ROOT)/src/VBox/HostDrivers/VBoxUSB/os2
|
---|
171 | endif
|
---|
172 |
|
---|
173 | VBoxSVC_LIBS += \
|
---|
174 | $(LIB_DDU) \
|
---|
175 | $(LIB_SETTINGS)
|
---|
176 | VBoxSVC_LIBS.darwin = \
|
---|
177 | $(LIB_VMM) \
|
---|
178 | $(LIB_REM)
|
---|
179 | VBoxSVC_LIBS.solaris = \
|
---|
180 | adm \
|
---|
181 | devinfo
|
---|
182 |
|
---|
183 | VBoxSVC_SOURCES = \
|
---|
184 | Global.cpp \
|
---|
185 | Logging.cpp \
|
---|
186 | AutoLock.cpp \
|
---|
187 | Matching.cpp \
|
---|
188 | VirtualBoxBase.cpp \
|
---|
189 | VirtualBoxErrorInfoImpl.cpp \
|
---|
190 | VirtualBoxImpl.cpp \
|
---|
191 | VirtualBoxImplExtra.cpp \
|
---|
192 | MachineImpl.cpp \
|
---|
193 | SnapshotImpl.cpp \
|
---|
194 | HardDiskImpl.cpp \
|
---|
195 | HardDiskAttachmentImpl.cpp \
|
---|
196 | ProgressImpl.cpp \
|
---|
197 | DVDDriveImpl.cpp \
|
---|
198 | DVDImageImpl.cpp \
|
---|
199 | FloppyDriveImpl.cpp \
|
---|
200 | FloppyImageImpl.cpp \
|
---|
201 | HostImpl.cpp \
|
---|
202 | HostDVDDriveImpl.cpp \
|
---|
203 | HostFloppyDriveImpl.cpp \
|
---|
204 | GuestOSTypeImpl.cpp \
|
---|
205 | NetworkAdapterImpl.cpp \
|
---|
206 | SerialPortImpl.cpp \
|
---|
207 | ParallelPortImpl.cpp \
|
---|
208 | USBControllerImpl.cpp \
|
---|
209 | SATAControllerImpl.cpp \
|
---|
210 | AudioAdapterImpl.cpp \
|
---|
211 | SharedFolderImpl.cpp \
|
---|
212 | SystemPropertiesImpl.cpp \
|
---|
213 | BIOSSettingsImpl.cpp
|
---|
214 |
|
---|
215 | ifdef VBOX_WITH_VRDP
|
---|
216 | VBoxSVC_SOURCES += VRDPServerImpl.cpp
|
---|
217 | endif
|
---|
218 |
|
---|
219 | VBoxSVC_SOURCES.darwin = \
|
---|
220 | darwin/iokit.cpp
|
---|
221 |
|
---|
222 | VBoxSVC_SOURCES.win = \
|
---|
223 | HostNetworkInterfaceImpl.cpp \
|
---|
224 | win/svcmain.cpp \
|
---|
225 | win/svchlp.cpp \
|
---|
226 | win/VBoxSVC.rc
|
---|
227 |
|
---|
228 | VBoxSVC_SOURCES.linux = \
|
---|
229 | linux/vbox-libhal.cpp
|
---|
230 |
|
---|
231 | VBoxSVC_SOURCES.solaris = \
|
---|
232 | linux/vbox-libhal.cpp
|
---|
233 |
|
---|
234 | ifdef VBOX_WITH_XPCOM
|
---|
235 | VBoxSVC_SOURCES += \
|
---|
236 | xpcom/server.cpp
|
---|
237 | endif
|
---|
238 |
|
---|
239 | ifdef VBOX_WITH_USB
|
---|
240 | VBoxSVC_SOURCES += \
|
---|
241 | USBDeviceFilterImpl.cpp \
|
---|
242 | USBProxyService.cpp \
|
---|
243 | HostUSBDeviceImpl.cpp
|
---|
244 | VBoxSVC_SOURCES.darwin += darwin/USBProxyServiceDarwin.cpp
|
---|
245 | VBoxSVC_SOURCES.linux += linux/USBProxyServiceLinux.cpp
|
---|
246 | VBoxSVC_SOURCES.os2 += os2/USBProxyServiceOs2.cpp
|
---|
247 | VBoxSVC_SOURCES.solaris += solaris/USBProxyServiceSolaris.cpp
|
---|
248 | VBoxSVC_SOURCES.win += win/USBProxyServiceWindows.cpp
|
---|
249 | endif
|
---|
250 |
|
---|
251 | VBoxSVC_LDFLAGS.darwin = -framework IOKit
|
---|
252 | ifeq ($(KBUILD_TYPE),debug)
|
---|
253 | VBoxSVC_LDFLAGS.linux += -rdynamic # for backtrace_symbols()
|
---|
254 | endif
|
---|
255 |
|
---|
256 | win/VBoxSVC.rc_INCS = $(PATH_TARGET)
|
---|
257 | win/VBoxSVC.rc_DEPS = $(PATH_TARGET)/VBoxSVC.rgs $(PATH_TARGET)/VBoxSVC-icon.rc
|
---|
258 | win/VBoxSVC.rc_CLEAN = $(PATH_TARGET)/VBoxSVC-icon.rc
|
---|
259 |
|
---|
260 | $(PATH_TARGET)/VBoxSVC-icon.rc: Makefile.kmk $(VBOX_WINDOWS_ICON_FILE) | $$(call DIRDEP,$$(@D))
|
---|
261 | $(RM) -f $@
|
---|
262 | $(APPEND) $@ '1 ICON DISCARDABLE "$(subst /,\\,$(VBOX_WINDOWS_ICON_FILE))"'
|
---|
263 |
|
---|
264 |
|
---|
265 | #
|
---|
266 | # VBoxSVC wrapper module
|
---|
267 | #
|
---|
268 | ifdef VBOX_WITH_XPCOM
|
---|
269 |
|
---|
270 | VBoxSVCM_TEMPLATE = VBOXMAINDLL
|
---|
271 | ifneq ($(KBUILD_TARGET),linux)
|
---|
272 | VBoxSVCM_INST = $(INST_BIN)components/
|
---|
273 | endif
|
---|
274 | VBoxSVCM_DEFS = IN_RING3 $(VBOX_MAIN_DEFS)
|
---|
275 | VBoxSVCM_INCS = \
|
---|
276 | include \
|
---|
277 | $(PATH_VBoxC) \
|
---|
278 | $(PATH_CURRENT)
|
---|
279 | VBoxSVCM_SOURCES = \
|
---|
280 | xpcom/server_module.cpp
|
---|
281 | ifdef VBOX_WITH_ORIGIN
|
---|
282 | VBoxSVCM_LDFLAGS = '$(VBOX_GCC_RPATH_OPT)$$(VBOX_ORIGIN)/..'
|
---|
283 | endif
|
---|
284 | VBoxSVCM_LDFLAGS.darwin = \
|
---|
285 | -install_name @executable_path/components/VBoxSVCM.dylib \
|
---|
286 | -exported_symbols_list $(PATH_TARGET)/VBoxSVCM.def
|
---|
287 | ifeq ($(KBUILD_TARGET),darwin)
|
---|
288 | VBoxSVCM_ORDERDEPS += $(PATH_TARGET)/VBoxSVCM.def
|
---|
289 | VBoxSVCM_CLEAN += $(PATH_TARGET)/VBoxSVCM.def
|
---|
290 | $(PATH_TARGET)/VBoxSVCM.def:
|
---|
291 | $(RM) -f $@
|
---|
292 | $(APPEND) $@ _NSGetModule
|
---|
293 | endif
|
---|
294 |
|
---|
295 | endif # VBOX_WITH_XPCOM
|
---|
296 |
|
---|
297 |
|
---|
298 | #
|
---|
299 | # VBoxC module
|
---|
300 | #
|
---|
301 | VBoxC_TEMPLATE = VBOXMAINDLL
|
---|
302 | ifneq ($(filter-out linux win,$(KBUILD_TARGET)),)
|
---|
303 | VBoxC_INST = $(INST_BIN)components/
|
---|
304 | endif
|
---|
305 |
|
---|
306 | VBoxC_DEFS = IN_RING3 $(VBOX_MAIN_DEFS)
|
---|
307 | VBoxC_DEFS += VBOX_COM_INPROC
|
---|
308 |
|
---|
309 | ifdef VBOX_WITH_VRDP
|
---|
310 | VBoxC_DEFS += VBOX_VRDP
|
---|
311 | endif
|
---|
312 | ifdef VBOX_WITH_HGCM
|
---|
313 | VBoxC_DEFS += VBOX_HGCM
|
---|
314 | endif
|
---|
315 | ifdef VBOX_MAIN_RELEASE_LOG
|
---|
316 | VBoxC_DEFS += VBOX_MAIN_RELEASE_LOG LOG_ENABLED
|
---|
317 | endif
|
---|
318 | ifdef VBOX_WITH_USB
|
---|
319 | VBoxC_DEFS += VBOX_WITH_USB
|
---|
320 | ifdef VBOX_WITH_EHCI
|
---|
321 | VBoxC_DEFS += VBOX_WITH_EHCI
|
---|
322 | endif
|
---|
323 | endif
|
---|
324 | ifdef VBOX_WITH_ALSA
|
---|
325 | VBoxC_DEFS += VBOX_WITH_ALSA
|
---|
326 | endif
|
---|
327 | ifdef VBOX_WITH_PULSE
|
---|
328 | VBoxC_DEFS += VBOX_WITH_PULSE
|
---|
329 | endif
|
---|
330 | ifdef VBOX_WITH_WINMM
|
---|
331 | VBoxC_DEFS += VBOX_WITH_WINMM
|
---|
332 | endif
|
---|
333 | ifdef VBOX_WITH_CROSSBOW
|
---|
334 | VBoxC_DEFS += VBOX_WITH_CROSSBOW
|
---|
335 | endif
|
---|
336 | ifdef VBOX_WITH_E1000
|
---|
337 | VBoxC_DEFS += VBOX_WITH_E1000
|
---|
338 | endif
|
---|
339 |
|
---|
340 | VBoxC_DEFS.win.x86 += _WIN32_WINNT=0x0500
|
---|
341 | VBoxC_DEFS.win.amd64 += _WIN32_WINNT=0x0510
|
---|
342 |
|
---|
343 | VBoxC_INCS = \
|
---|
344 | include \
|
---|
345 | $(PATH_VBoxC)
|
---|
346 | VBoxC_INCS.win = \
|
---|
347 | $(PATH_VBoxCOM) \
|
---|
348 | $(PATH_SUB_CURRENT)
|
---|
349 |
|
---|
350 | ifdef VBOX_WITH_ORIGIN
|
---|
351 | VBoxC_LDFLAGS = '$(VBOX_GCC_RPATH_OPT)$$(VBOX_ORIGIN)/..'
|
---|
352 | endif
|
---|
353 | VBoxC_LDFLAGS.darwin = \
|
---|
354 | -install_name @executable_path/components/VBoxSVCM.dylib \
|
---|
355 | -exported_symbols_list $(PATH_TARGET)/VBoxC.def
|
---|
356 | ifdef VBOX_USE_VCC80
|
---|
357 | VBoxC_LDFLAGS.win = /MANIFEST
|
---|
358 | endif
|
---|
359 |
|
---|
360 | VBoxC_LIBS += \
|
---|
361 | $(LIB_VMM) \
|
---|
362 | $(LIB_REM)
|
---|
363 |
|
---|
364 | VBoxC_SOURCES = \
|
---|
365 | Global.cpp \
|
---|
366 | Logging.cpp \
|
---|
367 | AutoLock.cpp \
|
---|
368 | VBoxDll.cpp \
|
---|
369 | Version.cpp \
|
---|
370 | USBDeviceImpl.cpp \
|
---|
371 | RemoteUSBDeviceImpl.cpp \
|
---|
372 | VirtualBoxBase.cpp \
|
---|
373 | VirtualBoxErrorInfoImpl.cpp \
|
---|
374 | ProgressImpl.cpp \
|
---|
375 | SharedFolderImpl.cpp \
|
---|
376 | SessionImpl.cpp \
|
---|
377 | ConsoleImpl.cpp \
|
---|
378 | ConsoleImpl2.cpp \
|
---|
379 | ConsoleVRDPServer.cpp \
|
---|
380 | GuestImpl.cpp \
|
---|
381 | KeyboardImpl.cpp \
|
---|
382 | MouseImpl.cpp \
|
---|
383 | DisplayImpl.cpp \
|
---|
384 | FramebufferImpl.cpp \
|
---|
385 | MachineDebuggerImpl.cpp \
|
---|
386 | VBoxDriversRegister.cpp \
|
---|
387 | AudioSnifferInterface.cpp \
|
---|
388 | VMMDevInterface.cpp
|
---|
389 | VBoxC_SOURCES.win = \
|
---|
390 | win/dllmain.cpp \
|
---|
391 | win/VBoxC.def \
|
---|
392 | win/VBoxC.rc
|
---|
393 | ifdef VBOX_WITH_XPCOM
|
---|
394 | VBoxC_SOURCES += \
|
---|
395 | xpcom/module.cpp
|
---|
396 | endif
|
---|
397 |
|
---|
398 | ifdef VBOX_WITH_HGCM
|
---|
399 | VBoxC_SOURCES += \
|
---|
400 | hgcm/HGCMObjects.cpp \
|
---|
401 | hgcm/HGCMThread.cpp \
|
---|
402 | hgcm/HGCM.cpp
|
---|
403 | endif
|
---|
404 |
|
---|
405 | ifdef VBOX_WITH_USB
|
---|
406 | VBoxC_SOURCES += \
|
---|
407 | RemoteUSBBackend.cpp
|
---|
408 | endif
|
---|
409 |
|
---|
410 | ifeq ($(KBUILD_TARGET),darwin)
|
---|
411 | VBoxC_ORDERDEPS += $(PATH_TARGET)/VBoxC.def
|
---|
412 | VBoxC_CLEAN += $(PATH_TARGET)/VBoxC.def
|
---|
413 | $(PATH_TARGET)/VBoxC.def: $(MAKEFILE_CURRENT)
|
---|
414 | $(RM) -f $@
|
---|
415 | $(APPEND) $@ _NSGetModule
|
---|
416 | $(APPEND) $@ _VBoxDriversRegister
|
---|
417 | endif
|
---|
418 |
|
---|
419 | # Version.cpp uses VBOX_SVN_REV.
|
---|
420 | Version.cpp_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
|
---|
421 | Version.cpp_DEPS = $(VBOX_SVN_REV_KMK)
|
---|
422 |
|
---|
423 | ConsoleImpl.cpp_DEFS = VBOX_BUILD_TARGET=\"$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)\"
|
---|
424 |
|
---|
425 | win/VBoxC.rc_DEPS = $(PATH_TARGET)/VBoxC.rgs $(PATH_VBoxCOM)/VirtualBox.tlb
|
---|
426 |
|
---|
427 |
|
---|
428 | #
|
---|
429 | # VBoxSettings
|
---|
430 | #
|
---|
431 | VBoxSettings_TEMPLATE = VBOXMAINDLL
|
---|
432 | VBoxSettings_NAME = $(basename $(notdir $(LIB_SETTINGS)))
|
---|
433 | VBoxSettings_SDKS = VBOX_LIBXSLT VBOX_LIBXML2 VBOX_ZLIB
|
---|
434 | VBoxSettings_DEFS = IN_VBOXSETTINGS_R3
|
---|
435 | VBoxSettings_INCS = \
|
---|
436 | include \
|
---|
437 | $(PATH_TARGET)
|
---|
438 | VBoxSettings_SOURCES = \
|
---|
439 | xml/Settings.cpp
|
---|
440 | VBoxSettings_LDFLAGS.darwin = -install_name @executable_path/$(notdir $(LIB_SETTINGS)) -Wl,-x # no debug info please.
|
---|
441 |
|
---|
442 |
|
---|
443 | #
|
---|
444 | # VBoxCOM - COM Abstraction Layer library
|
---|
445 | #
|
---|
446 | VBoxCOM_TEMPLATE = VBOXMAINLIB
|
---|
447 | VBoxCOM_SOURCES = \
|
---|
448 | glue/com.cpp \
|
---|
449 | glue/initterm.cpp \
|
---|
450 | glue/string.cpp \
|
---|
451 | glue/EventQueue.cpp \
|
---|
452 | glue/ErrorInfo.cpp
|
---|
453 | ifeq ($(KBUILD_TARGET),win)
|
---|
454 | VBoxCOM_DEFS.x86 += _WIN32_WINNT=0x0500
|
---|
455 | VBoxCOM_DEFS.amd64 += _WIN32_WINNT=0x0510
|
---|
456 | VBoxCOM_SOURCES += \
|
---|
457 | $(PATH_VBoxCOM)/VirtualBox_i.c
|
---|
458 | else
|
---|
459 | VBoxCOM_INCS += \
|
---|
460 | include
|
---|
461 | VBoxCOM_SOURCES += \
|
---|
462 | xpcom/helpers.cpp
|
---|
463 | endif
|
---|
464 |
|
---|
465 |
|
---|
466 | #
|
---|
467 | # Generate _DEPS on all sources which depends on generated headers.
|
---|
468 | #
|
---|
469 | ifeq ($(KBUILD_TARGET),win)
|
---|
470 | PREREQS = $(PATH_VBoxCOM)/VirtualBox_i.c
|
---|
471 | else
|
---|
472 | PREREQS = $(IDLTYPELIB) $(IDLHEADER)
|
---|
473 | endif
|
---|
474 |
|
---|
475 | # brute force way to ensure the prereqs are generated before anything is compiled.
|
---|
476 | define def_src_deps
|
---|
477 | $(src)_ORDERDEPS += $(PREREQS)
|
---|
478 | endef
|
---|
479 | $(foreach src,\
|
---|
480 | $(VBoxC_SOURCES) $(VBoxC_SOURCES.$(KBUILD_TARGET)) \
|
---|
481 | $(VBoxSVC_SOURCES) $(VBoxSVC_SOURCES.$(KBUILD_TARGET)) \
|
---|
482 | $(VBoxCOM_SOURCES) \
|
---|
483 | ,$(eval $(value def_src_deps)))
|
---|
484 |
|
---|
485 |
|
---|
486 | #
|
---|
487 | # Embed XML Schema files to VBoxSVC
|
---|
488 | #
|
---|
489 |
|
---|
490 | VBOX_XML_SCHEMA_H = $(PATH_TARGET)/xml_VirtualBox_settings_xsd.h
|
---|
491 | VBOX_XML_SCHEMA_COMMON_H = $(PATH_TARGET)/xml_VirtualBox_settings_common_xsd.h
|
---|
492 | VBOX_XML_CONVERTER_TEMPLATE_H = $(PATH_TARGET)/xml_SettingsConverter_xsl.h
|
---|
493 |
|
---|
494 | VBOX_XML_SCHEMA_COMMON = xml/VirtualBox-settings-common.xsd
|
---|
495 | VBOX_XML_SCHEMA.darwin = xml/VirtualBox-settings-macosx.xsd
|
---|
496 | VBOX_XML_SCHEMA.linux = xml/VirtualBox-settings-linux.xsd
|
---|
497 | VBOX_XML_SCHEMA.freebsd = xml/VirtualBox-settings-freebsd.xsd
|
---|
498 | VBOX_XML_SCHEMA.win = xml/VirtualBox-settings-windows.xsd
|
---|
499 | VBOX_XML_SCHEMA.os2 = xml/VirtualBox-settings-os2.xsd
|
---|
500 | VBOX_XML_SCHEMA.solaris = xml/VirtualBox-settings-solaris.xsd
|
---|
501 |
|
---|
502 | VBOX_XML_CONVERTER_TEMPLATE = xml/SettingsConverter.xsl
|
---|
503 |
|
---|
504 | VirtualBoxImplExtra.cpp_DEPS = \
|
---|
505 | $(VBOX_XML_SCHEMA_H) $(VBOX_XML_SCHEMA_COMMON_H) $(VBOX_XML_CONVERTER_TEMPLATE_H)
|
---|
506 |
|
---|
507 | $(VBOX_XML_SCHEMA_H): $(VBOX_XML_SCHEMA.$(KBUILD_TARGET)) $(VBOX_BIN2C)
|
---|
508 | $(call MSG_TOOL,bin2c,VBoxSVC,$<,$@)
|
---|
509 | $(QUIET)$(VBOX_BIN2C) _xml_VirtualBox_settings_xsd $< $@
|
---|
510 |
|
---|
511 | $(VBOX_XML_SCHEMA_COMMON_H): $(VBOX_XML_SCHEMA_COMMON) $(VBOX_BIN2C)
|
---|
512 | $(call MSG_TOOL,bin2c,VBoxSVC,$<,$@)
|
---|
513 | $(QUIET)$(VBOX_BIN2C) _xml_VirtualBox_settings_common_xsd $< $@
|
---|
514 |
|
---|
515 | $(VBOX_XML_CONVERTER_TEMPLATE_H): $(VBOX_XML_CONVERTER_TEMPLATE) $(VBOX_BIN2C)
|
---|
516 | $(call MSG_TOOL,bin2c,VBoxSVC,$<,$@)
|
---|
517 | $(QUIET)$(VBOX_BIN2C) _xml_SettingsConverter_xsl $< $@
|
---|
518 |
|
---|
519 | OTHER_CLEAN += \
|
---|
520 | $(VBOX_XML_SCHEMA_H) $(VBOX_XML_SCHEMA_COMMON_H) $(VBOX_XML_CONVERTER_TEMPLATE_H)
|
---|
521 |
|
---|
522 |
|
---|
523 | #
|
---|
524 | # Generate SchemaDefs.h and SchemaDefs.cpp from XML Schema
|
---|
525 | #
|
---|
526 | VBOX_XML_SCHEMADEFS_H = $(PATH_TARGET)/SchemaDefs.h
|
---|
527 | VBOX_XML_SCHEMADEFS_CPP = $(PATH_TARGET)/SchemaDefs.cpp
|
---|
528 | VBOX_XML_SCHEMADEFS_XSL = xml/SchemaDefs.xsl
|
---|
529 |
|
---|
530 | VBoxC_DEPS += $(VBOX_XML_SCHEMADEFS_H)
|
---|
531 | VBoxC_INCS += $(PATH_TARGET)
|
---|
532 | VBoxC_SOURCES += $(VBOX_XML_SCHEMADEFS_CPP)
|
---|
533 |
|
---|
534 | VBoxSVC_DEPS += $(VBOX_XML_SCHEMADEFS_H)
|
---|
535 | VBoxSVC_INCS += $(PATH_TARGET)
|
---|
536 | VBoxSVC_SOURCES += $(VBOX_XML_SCHEMADEFS_CPP)
|
---|
537 |
|
---|
538 | $(VBOX_XML_SCHEMADEFS_H): $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA.$(KBUILD_TARGET)) $(VBOX_XML_SCHEMA_COMMON)
|
---|
539 | $(call MSG_TOOL,xsltproc,SchemaDefs,$<,$@)
|
---|
540 | $(QUIET)$(VBOX_XSLTPROC) --stringparam mode declare -o $@ $(filter-out $(VBOX_XML_SCHEMA_COMMON),$^)
|
---|
541 |
|
---|
542 | $(VBOX_XML_SCHEMADEFS_CPP): $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA.$(KBUILD_TARGET)) $(VBOX_XML_SCHEMA_COMMON)
|
---|
543 | $(call MSG_TOOL,xsltproc,SchemaDefs,$<,$@)
|
---|
544 | $(QUIET)$(VBOX_XSLTPROC) --stringparam mode define -o $@ $(filter-out $(VBOX_XML_SCHEMA_COMMON),$^)
|
---|
545 |
|
---|
546 | OTHER_CLEAN += $(VBOX_XML_SCHEMADEFS_H) $(VBOX_XML_SCHEMADEFS_CPP)
|
---|
547 | .NOTPARALLEL: $(VBOX_XML_SCHEMADEFS_H) $(VBOX_XML_SCHEMADEFS_CPP)
|
---|
548 |
|
---|
549 |
|
---|
550 | #
|
---|
551 | # Creates the symlinks necessary for making XPCOM work.
|
---|
552 | #
|
---|
553 | ## @todo Figure out why Linux really needs this, darwin doesn't...
|
---|
554 |
|
---|
555 | xpcom-components_INST = $(INST_BIN)components/
|
---|
556 | ifeq ($(KBUILD_TARGET),linux)
|
---|
557 | xpcom-components_SYMLINKS = \
|
---|
558 | VirtualBox_XPCOM.xpt=>../VirtualBox_XPCOM.xpt \
|
---|
559 | VBoxXPCOMBase.xpt=>../VBoxXPCOMBase.xpt \
|
---|
560 | VBoxC$(SUFF_DLL)=>../VBoxC$(SUFF_DLL) \
|
---|
561 | VBoxSVCM$(SUFF_DLL)=>../VBoxSVCM$(SUFF_DLL) \
|
---|
562 | VBoxXPCOMIPCC$(SUFF_DLL)=>../VBoxXPCOMIPCC$(SUFF_DLL)
|
---|
563 | endif
|
---|
564 |
|
---|
565 |
|
---|
566 | #
|
---|
567 | # Include sub-makefile(s) last if we're not doing parallel building.
|
---|
568 | #
|
---|
569 | # We do this here so that the webservices ends up last in the target
|
---|
570 | # lists. For 100% correctness we must do this after all the main
|
---|
571 | # targets has been fully fleshed out as subheader/footer.kmk will
|
---|
572 | # process new targets.
|
---|
573 | #
|
---|
574 | ifeq ($(KMK_OPTS_JOBS),1)
|
---|
575 | ifdef VBOX_WITH_WEBSERVICES
|
---|
576 | include $(PATH_SUB_CURRENT)/webservice/Makefile.kmk
|
---|
577 | endif
|
---|
578 | include $(PATH_SUB_CURRENT)/testcase/Makefile.kmk
|
---|
579 | endif
|
---|
580 |
|
---|
581 | # generate rules
|
---|
582 | include $(KBUILD_PATH)/subfooter.kmk
|
---|
583 |
|
---|
584 |
|
---|
585 | #
|
---|
586 | # Additions rules.
|
---|
587 | #
|
---|
588 |
|
---|
589 | XIDLFILE = idl/VirtualBox.xidl
|
---|
590 |
|
---|
591 | ifneq ($(KBUILD_TARGET),win)
|
---|
592 |
|
---|
593 | xpcom/helpers.cpp: $(IDLTYPELIB)
|
---|
594 |
|
---|
595 | $(IDLFILE): idl/xpidl.xsl $(XIDLFILE) | $(call DIRDEP,$(dir $(IDLFILE)))
|
---|
596 | $(call MSG_TOOL,xsltproc,VBoxSVC,$<,$@)
|
---|
597 | $(QUIET)$(MKDIR) -p $(@D)
|
---|
598 | $(QUIET)$(VBOX_XSLTPROC) -o $@ $^
|
---|
599 |
|
---|
600 | $(IDLTYPELIB): $(IDLFILE) | $(call DIRDEP,$(dir $(IDLTYPELIB)))
|
---|
601 | $(call MSG_TOOL,xpidl,VBoxSVC,$<,$@)
|
---|
602 | $(QUIET)$(VBOX_XPIDL) -m typelib -I $(VBOX_PATH_XPCOM_IDL) -e $@ $<
|
---|
603 |
|
---|
604 | $(IDLHEADER): $(IDLFILE) | $(call DIRDEP,$(dir $(IDLHEADER)))
|
---|
605 | $(call MSG_TOOL,xpidl,VBoxSVC,$<,$@)
|
---|
606 | $(QUIET)$(VBOX_XPIDL) -m header -I $(VBOX_PATH_XPCOM_IDL) -e $@ $<
|
---|
607 |
|
---|
608 | else
|
---|
609 |
|
---|
610 | MAIN_IDL ?= $(EXEC_X86_WIN32) $(firstword $(wildcard \
|
---|
611 | $(PATH_SDK_WINPSDK_BIN)/Midl.Exe\
|
---|
612 | $(PATH_SDK_WINPSDK)/Bin/Midl.Exe\
|
---|
613 | $(PATH_DEVTOOLS)/win.x86/bin/midl.exe\
|
---|
614 | ) Sorry_Cannot_Find_The_Midl_Compiler_In_The_PSDK)
|
---|
615 | IDL_DEFS = /nologo
|
---|
616 | ifdef VBOX_WITH_VRDP
|
---|
617 | IDL_DEFS += /D VBOX_VRDP
|
---|
618 | endif
|
---|
619 |
|
---|
620 | $(IDLFILE): idl/midl.xsl $(XIDLFILE)
|
---|
621 | $(call MSG_TOOL,xsltproc,VBoxSVC,$<,$@)
|
---|
622 | $(QUIET)$(MKDIR) -p $(VBOX_PATH_SDK)/idl
|
---|
623 | $(QUIET)$(VBOX_XSLTPROC) -o $@ $^
|
---|
624 |
|
---|
625 | $(PATH_TARGET)/VBoxSVC.rgs: win/VirtualBox_rgs.xsl $(XIDLFILE)
|
---|
626 | $(VBOX_XSLTPROC) --stringparam Module VBoxSVC -o $@ $^
|
---|
627 |
|
---|
628 | $(PATH_TARGET)/VBoxC.rgs: win/VirtualBox_rgs.xsl $(XIDLFILE)
|
---|
629 | $(VBOX_XSLTPROC) --stringparam Module VBoxC -o $@ $^
|
---|
630 |
|
---|
631 | ## @todo r=bird: last changes to this rule showed incorrect dependencies here as it broke testcase (see testboxwin2).
|
---|
632 | # This is kind of obvious when looking at the rule, because it's (a) not specifing all it output
|
---|
633 | # and (b) generating more stuff *after* the maintarget has been completed.
|
---|
634 | #
|
---|
635 | # What needs to be done is to not depend on _i.c in the object subdir, but on all the final outputs.
|
---|
636 | $(PATH_VBoxCOM)/VirtualBox_i.c \
|
---|
637 | + $(VBOX_PATH_SDK)/lib/VirtualBox_i.c \
|
---|
638 | + $(PATH_VBoxCOM)/VirtualBox.h \
|
---|
639 | + $(VBOX_PATH_SDK)/include/VirtualBox.h \
|
---|
640 | + $(PATH_VBoxCOM)/VirtualBox.tlb \
|
---|
641 | + $(VBOX_PATH_SDK)/lib/VirtualBox.tlb: $(IDLFILE) | $(call DIRDEP,$(PATH_VBoxCOM))
|
---|
642 | $(MAIN_IDL) $(IDL_DEFS) \
|
---|
643 | /out $(subst /,\\,$(PATH_VBoxCOM)) \
|
---|
644 | /cpp_cmd $(subst /,\\,$(TOOL_$(VBOX_VCC_TOOL)_CC)) \
|
---|
645 | /I $(subst /,\\,$(PATH_SDK_WINPSDK_INC)) \
|
---|
646 | /I idl \
|
---|
647 | $(subst /,\\,$<)
|
---|
648 | $(MKDIR) -p $(VBOX_PATH_SDK)/include
|
---|
649 | $(CP) $(PATH_VBoxCOM)/VirtualBox.h $(VBOX_PATH_SDK)/include
|
---|
650 | $(MKDIR) -p $(VBOX_PATH_SDK)/lib
|
---|
651 | $(CP) $(PATH_VBoxCOM)/VirtualBox.tlb $(VBOX_PATH_SDK)/lib
|
---|
652 | $(CP) $(PATH_VBoxCOM)/VirtualBox_i.c $(VBOX_PATH_SDK)/lib
|
---|
653 |
|
---|
654 | endif
|
---|
655 |
|
---|
656 | # bird: anyone still using this? If not it's a gonner.
|
---|
657 | ## Hack to work around wine's trouble with midl.exe and rc.exe (seems to be msvcrt.dll related)
|
---|
658 | #gen: $(PREREQS)
|
---|
659 |
|
---|
660 |
|
---|
661 | #
|
---|
662 | # Translation stuff
|
---|
663 | #
|
---|
664 | VBoxSVC_HEADERS = \
|
---|
665 | include/collection.h \
|
---|
666 | include/MachineImpl.h \
|
---|
667 | include/HostDVDDriveImpl.h \
|
---|
668 | include/HostFloppyDriveImpl.h
|
---|
669 |
|
---|
670 | VBoxC_HEADERS = \
|
---|
671 | include/ConsoleImpl.h
|
---|
672 |
|
---|
673 | VBoxSVC_TRANSLATIONS = \
|
---|
674 | nls/VBoxSVC_de.ts
|
---|
675 |
|
---|
676 | VBoxC_TRANSLATIONS = \
|
---|
677 | nls/VBoxC_de.ts
|
---|
678 |
|
---|
679 | updatenls:
|
---|
680 | $(VBOX_LUPDATE) $(VBoxSVC_SOURCES) $(VBoxSVC_HEADERS) -ts $(VBoxSVC_TRANSLATIONS)
|
---|
681 | $(VBOX_LUPDATE) $(VBoxC_SOURCES) $(VBoxC_HEADERS) -ts $(VBoxC_TRANSLATIONS)
|
---|
682 |
|
---|
683 | ifdef VBOX_WITH_XPCOM
|
---|
684 |
|
---|
685 | testidl: $(IDLFILE) $(IDLTYPELIB)
|
---|
686 | testidlhdr: $(IDLHEADER)
|
---|
687 |
|
---|
688 | else
|
---|
689 |
|
---|
690 | testidl: $(IDLFILE) $(PATH_VBoxCOM)/VirtualBox_i.c
|
---|
691 |
|
---|
692 | endif
|
---|
693 |
|
---|
694 | testschemadefs: $(VBOX_XML_SCHEMADEFS_H) $(VBOX_XML_SCHEMADEFS_CPP)
|
---|
695 |
|
---|
696 | $(PATH_BIN)/comregister.cmd: win/comregister.cmd
|
---|
697 | $(CP) $< $@
|
---|
698 |
|
---|
699 |
|
---|
700 | # Hot fix when dependencies goes bad again...
|
---|
701 | #.NOTPARALLEL: $(TARGET_VBoxC) $(TARGET_VBoxSVC) $(TARGET_VBoxCOM) $(IDLHEADER) $(IDLFILE) $(PATH_VBoxCOM)/VirtualBox_i.c
|
---|
702 |
|
---|