1 | # $Id: Makefile.kmk 8903 2008-05-16 15:40:20Z 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 | Logging.cpp \
|
---|
185 | AutoLock.cpp \
|
---|
186 | Matching.cpp \
|
---|
187 | VirtualBoxBase.cpp \
|
---|
188 | VirtualBoxErrorInfoImpl.cpp \
|
---|
189 | VirtualBoxImpl.cpp \
|
---|
190 | VirtualBoxImplExtra.cpp \
|
---|
191 | MachineImpl.cpp \
|
---|
192 | SnapshotImpl.cpp \
|
---|
193 | HardDiskImpl.cpp \
|
---|
194 | HardDiskAttachmentImpl.cpp \
|
---|
195 | ProgressImpl.cpp \
|
---|
196 | DVDDriveImpl.cpp \
|
---|
197 | DVDImageImpl.cpp \
|
---|
198 | FloppyDriveImpl.cpp \
|
---|
199 | FloppyImageImpl.cpp \
|
---|
200 | HostImpl.cpp \
|
---|
201 | HostDVDDriveImpl.cpp \
|
---|
202 | HostFloppyDriveImpl.cpp \
|
---|
203 | GuestOSTypeImpl.cpp \
|
---|
204 | NetworkAdapterImpl.cpp \
|
---|
205 | SerialPortImpl.cpp \
|
---|
206 | ParallelPortImpl.cpp \
|
---|
207 | USBControllerImpl.cpp \
|
---|
208 | SATAControllerImpl.cpp \
|
---|
209 | AudioAdapterImpl.cpp \
|
---|
210 | SharedFolderImpl.cpp \
|
---|
211 | SystemPropertiesImpl.cpp \
|
---|
212 | BIOSSettingsImpl.cpp
|
---|
213 |
|
---|
214 | ifdef VBOX_WITH_VRDP
|
---|
215 | VBoxSVC_SOURCES += VRDPServerImpl.cpp
|
---|
216 | endif
|
---|
217 |
|
---|
218 | VBoxSVC_SOURCES.darwin = \
|
---|
219 | darwin/iokit.cpp
|
---|
220 |
|
---|
221 | VBoxSVC_SOURCES.win = \
|
---|
222 | HostNetworkInterfaceImpl.cpp \
|
---|
223 | win/svcmain.cpp \
|
---|
224 | win/svchlp.cpp \
|
---|
225 | win/VBoxSVC.rc
|
---|
226 |
|
---|
227 | VBoxSVC_SOURCES.linux = \
|
---|
228 | linux/vbox-libhal.cpp
|
---|
229 |
|
---|
230 | VBoxSVC_SOURCES.solaris = \
|
---|
231 | linux/vbox-libhal.cpp
|
---|
232 |
|
---|
233 | ifdef VBOX_WITH_XPCOM
|
---|
234 | VBoxSVC_SOURCES += \
|
---|
235 | xpcom/server.cpp
|
---|
236 | endif
|
---|
237 |
|
---|
238 | ifdef VBOX_WITH_USB
|
---|
239 | VBoxSVC_SOURCES += \
|
---|
240 | USBDeviceFilterImpl.cpp \
|
---|
241 | USBProxyService.cpp \
|
---|
242 | HostUSBDeviceImpl.cpp
|
---|
243 | VBoxSVC_SOURCES.darwin += darwin/USBProxyServiceDarwin.cpp
|
---|
244 | VBoxSVC_SOURCES.linux += linux/USBProxyServiceLinux.cpp
|
---|
245 | VBoxSVC_SOURCES.os2 += os2/USBProxyServiceOs2.cpp
|
---|
246 | VBoxSVC_SOURCES.solaris += solaris/USBProxyServiceSolaris.cpp
|
---|
247 | VBoxSVC_SOURCES.win += win/USBProxyServiceWindows.cpp
|
---|
248 | endif
|
---|
249 |
|
---|
250 | VBoxSVC_LDFLAGS.darwin = -framework IOKit
|
---|
251 | ifeq ($(KBUILD_TYPE),debug)
|
---|
252 | VBoxSVC_LDFLAGS.linux += -rdynamic # for backtrace_symbols()
|
---|
253 | endif
|
---|
254 |
|
---|
255 | win/VBoxSVC.rc_INCS = $(PATH_TARGET)
|
---|
256 | win/VBoxSVC.rc_DEPS = $(PATH_TARGET)/VBoxSVC.rgs $(PATH_TARGET)/VBoxSVC-icon.rc
|
---|
257 | win/VBoxSVC.rc_CLEAN = $(PATH_TARGET)/VBoxSVC-icon.rc
|
---|
258 |
|
---|
259 | $(PATH_TARGET)/VBoxSVC-icon.rc: Makefile.kmk $(VBOX_WINDOWS_ICON_FILE) | $$(call DIRDEP,$$(@D))
|
---|
260 | $(RM) -f $@
|
---|
261 | $(APPEND) $@ '1 ICON DISCARDABLE "$(subst /,\\,$(VBOX_WINDOWS_ICON_FILE))"'
|
---|
262 |
|
---|
263 |
|
---|
264 | #
|
---|
265 | # VBoxSVC wrapper module
|
---|
266 | #
|
---|
267 | ifdef VBOX_WITH_XPCOM
|
---|
268 |
|
---|
269 | VBoxSVCM_TEMPLATE = VBOXMAINDLL
|
---|
270 | ifneq ($(KBUILD_TARGET),linux)
|
---|
271 | VBoxSVCM_INST = $(INST_BIN)components/
|
---|
272 | endif
|
---|
273 | VBoxSVCM_DEFS = IN_RING3 $(VBOX_MAIN_DEFS)
|
---|
274 | VBoxSVCM_INCS = \
|
---|
275 | include \
|
---|
276 | $(PATH_VBoxC) \
|
---|
277 | $(PATH_CURRENT)
|
---|
278 | VBoxSVCM_SOURCES = \
|
---|
279 | xpcom/server_module.cpp
|
---|
280 | ifdef VBOX_WITH_ORIGIN
|
---|
281 | VBoxSVCM_LDFLAGS = '$(VBOX_GCC_RPATH_OPT)$$(VBOX_ORIGIN)/..'
|
---|
282 | endif
|
---|
283 | VBoxSVCM_LDFLAGS.darwin = \
|
---|
284 | -install_name @executable_path/components/VBoxSVCM.dylib \
|
---|
285 | -exported_symbols_list $(PATH_TARGET)/VBoxSVCM.def
|
---|
286 | ifeq ($(KBUILD_TARGET),darwin)
|
---|
287 | VBoxSVCM_ORDERDEPS += $(PATH_TARGET)/VBoxSVCM.def
|
---|
288 | VBoxSVCM_CLEAN += $(PATH_TARGET)/VBoxSVCM.def
|
---|
289 | $(PATH_TARGET)/VBoxSVCM.def:
|
---|
290 | $(RM) -f $@
|
---|
291 | $(APPEND) $@ _NSGetModule
|
---|
292 | endif
|
---|
293 |
|
---|
294 | endif # VBOX_WITH_XPCOM
|
---|
295 |
|
---|
296 |
|
---|
297 | #
|
---|
298 | # VBoxC module
|
---|
299 | #
|
---|
300 | VBoxC_TEMPLATE = VBOXMAINDLL
|
---|
301 | ifneq ($(filter-out linux win,$(KBUILD_TARGET)),)
|
---|
302 | VBoxC_INST = $(INST_BIN)components/
|
---|
303 | endif
|
---|
304 |
|
---|
305 | VBoxC_DEFS = IN_RING3 $(VBOX_MAIN_DEFS)
|
---|
306 | VBoxC_DEFS += VBOX_COM_INPROC
|
---|
307 |
|
---|
308 | ifdef VBOX_WITH_VRDP
|
---|
309 | VBoxC_DEFS += VBOX_VRDP
|
---|
310 | endif
|
---|
311 | ifdef VBOX_WITH_HGCM
|
---|
312 | VBoxC_DEFS += VBOX_HGCM
|
---|
313 | endif
|
---|
314 | ifdef VBOX_MAIN_RELEASE_LOG
|
---|
315 | VBoxC_DEFS += VBOX_MAIN_RELEASE_LOG LOG_ENABLED
|
---|
316 | endif
|
---|
317 | ifdef VBOX_WITH_USB
|
---|
318 | VBoxC_DEFS += VBOX_WITH_USB
|
---|
319 | ifdef VBOX_WITH_EHCI
|
---|
320 | VBoxC_DEFS += VBOX_WITH_EHCI
|
---|
321 | endif
|
---|
322 | endif
|
---|
323 | ifdef VBOX_WITH_ALSA
|
---|
324 | VBoxC_DEFS += VBOX_WITH_ALSA
|
---|
325 | endif
|
---|
326 | ifdef VBOX_WITH_PULSE
|
---|
327 | VBoxC_DEFS += VBOX_WITH_PULSE
|
---|
328 | endif
|
---|
329 | ifdef VBOX_WITH_WINMM
|
---|
330 | VBoxC_DEFS += VBOX_WITH_WINMM
|
---|
331 | endif
|
---|
332 | ifdef VBOX_WITH_CROSSBOW
|
---|
333 | VBoxC_DEFS += VBOX_WITH_CROSSBOW
|
---|
334 | endif
|
---|
335 | ifdef VBOX_WITH_E1000
|
---|
336 | VBoxC_DEFS += VBOX_WITH_E1000
|
---|
337 | endif
|
---|
338 |
|
---|
339 | VBoxC_DEFS.win.x86 += _WIN32_WINNT=0x0500
|
---|
340 | VBoxC_DEFS.win.amd64 += _WIN32_WINNT=0x0510
|
---|
341 |
|
---|
342 | VBoxC_INCS = \
|
---|
343 | include \
|
---|
344 | $(PATH_VBoxC)
|
---|
345 | VBoxC_INCS.win = \
|
---|
346 | $(PATH_VBoxCOM) \
|
---|
347 | $(PATH_SUB_CURRENT)
|
---|
348 |
|
---|
349 | ifdef VBOX_WITH_ORIGIN
|
---|
350 | VBoxC_LDFLAGS = '$(VBOX_GCC_RPATH_OPT)$$(VBOX_ORIGIN)/..'
|
---|
351 | endif
|
---|
352 | VBoxC_LDFLAGS.darwin = \
|
---|
353 | -install_name @executable_path/components/VBoxSVCM.dylib \
|
---|
354 | -exported_symbols_list $(PATH_TARGET)/VBoxC.def
|
---|
355 | ifdef VBOX_USE_VCC80
|
---|
356 | VBoxC_LDFLAGS.win = /MANIFEST
|
---|
357 | endif
|
---|
358 |
|
---|
359 | VBoxC_LIBS += \
|
---|
360 | $(LIB_VMM) \
|
---|
361 | $(LIB_REM)
|
---|
362 |
|
---|
363 | VBoxC_SOURCES = \
|
---|
364 | Logging.cpp \
|
---|
365 | AutoLock.cpp \
|
---|
366 | VBoxDll.cpp \
|
---|
367 | Version.cpp \
|
---|
368 | USBDeviceImpl.cpp \
|
---|
369 | RemoteUSBDeviceImpl.cpp \
|
---|
370 | VirtualBoxBase.cpp \
|
---|
371 | VirtualBoxErrorInfoImpl.cpp \
|
---|
372 | ProgressImpl.cpp \
|
---|
373 | SharedFolderImpl.cpp \
|
---|
374 | SessionImpl.cpp \
|
---|
375 | ConsoleImpl.cpp \
|
---|
376 | ConsoleImpl2.cpp \
|
---|
377 | ConsoleVRDPServer.cpp \
|
---|
378 | GuestImpl.cpp \
|
---|
379 | KeyboardImpl.cpp \
|
---|
380 | MouseImpl.cpp \
|
---|
381 | DisplayImpl.cpp \
|
---|
382 | FramebufferImpl.cpp \
|
---|
383 | MachineDebuggerImpl.cpp \
|
---|
384 | VBoxDriversRegister.cpp \
|
---|
385 | AudioSnifferInterface.cpp \
|
---|
386 | VMMDevInterface.cpp
|
---|
387 | VBoxC_SOURCES.win = \
|
---|
388 | win/dllmain.cpp \
|
---|
389 | win/VBoxC.def \
|
---|
390 | win/VBoxC.rc
|
---|
391 | ifdef VBOX_WITH_XPCOM
|
---|
392 | VBoxC_SOURCES += \
|
---|
393 | xpcom/module.cpp
|
---|
394 | endif
|
---|
395 |
|
---|
396 | ifdef VBOX_WITH_HGCM
|
---|
397 | VBoxC_SOURCES += \
|
---|
398 | hgcm/HGCMObjects.cpp \
|
---|
399 | hgcm/HGCMThread.cpp \
|
---|
400 | hgcm/HGCM.cpp
|
---|
401 | endif
|
---|
402 |
|
---|
403 | ifdef VBOX_WITH_USB
|
---|
404 | VBoxC_SOURCES += \
|
---|
405 | RemoteUSBBackend.cpp
|
---|
406 | endif
|
---|
407 |
|
---|
408 | ifeq ($(KBUILD_TARGET),darwin)
|
---|
409 | VBoxC_ORDERDEPS += $(PATH_TARGET)/VBoxC.def
|
---|
410 | VBoxC_CLEAN += $(PATH_TARGET)/VBoxC.def
|
---|
411 | $(PATH_TARGET)/VBoxC.def: $(MAKEFILE_CURRENT)
|
---|
412 | $(RM) -f $@
|
---|
413 | $(APPEND) $@ _NSGetModule
|
---|
414 | $(APPEND) $@ _VBoxDriversRegister
|
---|
415 | endif
|
---|
416 |
|
---|
417 | # Version.cpp uses VBOX_SVN_REV.
|
---|
418 | Version.cpp_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
|
---|
419 | Version.cpp_DEPS = $(VBOX_SVN_REV_KMK)
|
---|
420 |
|
---|
421 | ConsoleImpl.cpp_DEFS = VBOX_BUILD_TARGET=\"$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)\"
|
---|
422 |
|
---|
423 | win/VBoxC.rc_DEPS = $(PATH_TARGET)/VBoxC.rgs $(PATH_VBoxCOM)/VirtualBox.tlb
|
---|
424 |
|
---|
425 |
|
---|
426 | #
|
---|
427 | # VBoxSettings
|
---|
428 | #
|
---|
429 | VBoxSettings_TEMPLATE = VBOXMAINDLL
|
---|
430 | VBoxSettings_NAME = $(basename $(notdir $(LIB_SETTINGS)))
|
---|
431 | VBoxSettings_SDKS = VBOX_LIBXSLT VBOX_LIBXML2 VBOX_ZLIB
|
---|
432 | VBoxSettings_DEFS = IN_VBOXSETTINGS_R3
|
---|
433 | VBoxSettings_INCS = \
|
---|
434 | include \
|
---|
435 | $(PATH_TARGET)
|
---|
436 | VBoxSettings_SOURCES = \
|
---|
437 | xml/Settings.cpp
|
---|
438 | VBoxSettings_LDFLAGS.darwin = -install_name @executable_path/$(notdir $(LIB_SETTINGS)) -Wl,-x # no debug info please.
|
---|
439 |
|
---|
440 |
|
---|
441 | #
|
---|
442 | # VBoxCOM - COM Abstraction Layer library
|
---|
443 | #
|
---|
444 | VBoxCOM_TEMPLATE = VBOXMAINLIB
|
---|
445 | VBoxCOM_SOURCES = \
|
---|
446 | glue/com.cpp \
|
---|
447 | glue/initterm.cpp \
|
---|
448 | glue/string.cpp \
|
---|
449 | glue/EventQueue.cpp \
|
---|
450 | glue/ErrorInfo.cpp
|
---|
451 | ifeq ($(KBUILD_TARGET),win)
|
---|
452 | VBoxCOM_DEFS.x86 += _WIN32_WINNT=0x0500
|
---|
453 | VBoxCOM_DEFS.amd64 += _WIN32_WINNT=0x0510
|
---|
454 | VBoxCOM_SOURCES += \
|
---|
455 | $(PATH_VBoxCOM)/VirtualBox_i.c
|
---|
456 | else
|
---|
457 | VBoxCOM_INCS += \
|
---|
458 | include
|
---|
459 | VBoxCOM_SOURCES += \
|
---|
460 | xpcom/helpers.cpp
|
---|
461 | endif
|
---|
462 |
|
---|
463 |
|
---|
464 | #
|
---|
465 | # Generate _DEPS on all sources which depends on generated headers.
|
---|
466 | #
|
---|
467 | ifeq ($(KBUILD_TARGET),win)
|
---|
468 | PREREQS = $(PATH_VBoxCOM)/VirtualBox_i.c
|
---|
469 | else
|
---|
470 | PREREQS = $(IDLTYPELIB) $(IDLHEADER)
|
---|
471 | endif
|
---|
472 |
|
---|
473 | # brute force way to ensure the prereqs are generated before anything is compiled.
|
---|
474 | define def_src_deps
|
---|
475 | $(src)_ORDERDEPS += $(PREREQS)
|
---|
476 | endef
|
---|
477 | $(foreach src,\
|
---|
478 | $(VBoxC_SOURCES) $(VBoxC_SOURCES.$(KBUILD_TARGET)) \
|
---|
479 | $(VBoxSVC_SOURCES) $(VBoxSVC_SOURCES.$(KBUILD_TARGET)) \
|
---|
480 | $(VBoxCOM_SOURCES) \
|
---|
481 | ,$(eval $(value def_src_deps)))
|
---|
482 |
|
---|
483 |
|
---|
484 | #
|
---|
485 | # Embed XML Schema files to VBoxSVC
|
---|
486 | #
|
---|
487 |
|
---|
488 | VBOX_XML_SCHEMA_H = $(PATH_TARGET)/xml_VirtualBox_settings_xsd.h
|
---|
489 | VBOX_XML_SCHEMA_COMMON_H = $(PATH_TARGET)/xml_VirtualBox_settings_common_xsd.h
|
---|
490 | VBOX_XML_CONVERTER_TEMPLATE_H = $(PATH_TARGET)/xml_SettingsConverter_xsl.h
|
---|
491 |
|
---|
492 | VBOX_XML_SCHEMA_COMMON = xml/VirtualBox-settings-common.xsd
|
---|
493 | VBOX_XML_SCHEMA.darwin = xml/VirtualBox-settings-macosx.xsd
|
---|
494 | VBOX_XML_SCHEMA.linux = xml/VirtualBox-settings-linux.xsd
|
---|
495 | VBOX_XML_SCHEMA.freebsd = xml/VirtualBox-settings-freebsd.xsd
|
---|
496 | VBOX_XML_SCHEMA.win = xml/VirtualBox-settings-windows.xsd
|
---|
497 | VBOX_XML_SCHEMA.os2 = xml/VirtualBox-settings-os2.xsd
|
---|
498 | VBOX_XML_SCHEMA.solaris = xml/VirtualBox-settings-solaris.xsd
|
---|
499 |
|
---|
500 | VBOX_XML_CONVERTER_TEMPLATE = xml/SettingsConverter.xsl
|
---|
501 |
|
---|
502 | VirtualBoxImplExtra.cpp_DEPS = \
|
---|
503 | $(VBOX_XML_SCHEMA_H) $(VBOX_XML_SCHEMA_COMMON_H) $(VBOX_XML_CONVERTER_TEMPLATE_H)
|
---|
504 |
|
---|
505 | $(VBOX_XML_SCHEMA_H): $(VBOX_XML_SCHEMA.$(KBUILD_TARGET)) $(VBOX_BIN2C)
|
---|
506 | $(call MSG_TOOL,bin2c,VBoxSVC,$<,$@)
|
---|
507 | $(QUIET)$(VBOX_BIN2C) _xml_VirtualBox_settings_xsd $< $@
|
---|
508 |
|
---|
509 | $(VBOX_XML_SCHEMA_COMMON_H): $(VBOX_XML_SCHEMA_COMMON) $(VBOX_BIN2C)
|
---|
510 | $(call MSG_TOOL,bin2c,VBoxSVC,$<,$@)
|
---|
511 | $(QUIET)$(VBOX_BIN2C) _xml_VirtualBox_settings_common_xsd $< $@
|
---|
512 |
|
---|
513 | $(VBOX_XML_CONVERTER_TEMPLATE_H): $(VBOX_XML_CONVERTER_TEMPLATE) $(VBOX_BIN2C)
|
---|
514 | $(call MSG_TOOL,bin2c,VBoxSVC,$<,$@)
|
---|
515 | $(QUIET)$(VBOX_BIN2C) _xml_SettingsConverter_xsl $< $@
|
---|
516 |
|
---|
517 | OTHER_CLEAN += \
|
---|
518 | $(VBOX_XML_SCHEMA_H) $(VBOX_XML_SCHEMA_COMMON_H) $(VBOX_XML_CONVERTER_TEMPLATE_H)
|
---|
519 |
|
---|
520 |
|
---|
521 | #
|
---|
522 | # Generate SchemaDefs.h and SchemaDefs.cpp from XML Schema
|
---|
523 | #
|
---|
524 | VBOX_XML_SCHEMADEFS_H = $(PATH_TARGET)/SchemaDefs.h
|
---|
525 | VBOX_XML_SCHEMADEFS_CPP = $(PATH_TARGET)/SchemaDefs.cpp
|
---|
526 | VBOX_XML_SCHEMADEFS_XSL = xml/SchemaDefs.xsl
|
---|
527 |
|
---|
528 | VBoxC_DEPS += $(VBOX_XML_SCHEMADEFS_H)
|
---|
529 | VBoxC_INCS += $(PATH_TARGET)
|
---|
530 |
|
---|
531 | VBoxSVC_DEPS += $(VBOX_XML_SCHEMADEFS_H)
|
---|
532 | VBoxSVC_INCS += $(PATH_TARGET)
|
---|
533 | VBoxSVC_SOURCES += $(VBOX_XML_SCHEMADEFS_CPP)
|
---|
534 |
|
---|
535 | $(VBOX_XML_SCHEMADEFS_H): $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA.$(KBUILD_TARGET)) $(VBOX_XML_SCHEMA_COMMON)
|
---|
536 | $(call MSG_TOOL,xsltproc,SchemaDefs,$<,$@)
|
---|
537 | $(QUIET)$(VBOX_XSLTPROC) --stringparam mode declare -o $@ $(filter-out $(VBOX_XML_SCHEMA_COMMON),$^)
|
---|
538 |
|
---|
539 | $(VBOX_XML_SCHEMADEFS_CPP): $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA.$(KBUILD_TARGET)) $(VBOX_XML_SCHEMA_COMMON)
|
---|
540 | $(call MSG_TOOL,xsltproc,SchemaDefs,$<,$@)
|
---|
541 | $(QUIET)$(VBOX_XSLTPROC) --stringparam mode define -o $@ $(filter-out $(VBOX_XML_SCHEMA_COMMON),$^)
|
---|
542 |
|
---|
543 | OTHER_CLEAN += $(VBOX_XML_SCHEMADEFS_H) $(VBOX_XML_SCHEMADEFS_CPP)
|
---|
544 | .NOTPARALLEL: $(VBOX_XML_SCHEMADEFS_H) $(VBOX_XML_SCHEMADEFS_CPP)
|
---|
545 |
|
---|
546 |
|
---|
547 | #
|
---|
548 | # Creates the symlinks necessary for making XPCOM work.
|
---|
549 | #
|
---|
550 | ## @todo Figure out why Linux really needs this, darwin doesn't...
|
---|
551 |
|
---|
552 | xpcom-components_INST = $(INST_BIN)components/
|
---|
553 | ifeq ($(KBUILD_TARGET),linux)
|
---|
554 | xpcom-components_SYMLINKS = \
|
---|
555 | VirtualBox_XPCOM.xpt=>../VirtualBox_XPCOM.xpt \
|
---|
556 | VBoxXPCOMBase.xpt=>../VBoxXPCOMBase.xpt \
|
---|
557 | VBoxC$(SUFF_DLL)=>../VBoxC$(SUFF_DLL) \
|
---|
558 | VBoxSVCM$(SUFF_DLL)=>../VBoxSVCM$(SUFF_DLL) \
|
---|
559 | VBoxXPCOMIPCC$(SUFF_DLL)=>../VBoxXPCOMIPCC$(SUFF_DLL)
|
---|
560 | endif
|
---|
561 |
|
---|
562 |
|
---|
563 | #
|
---|
564 | # Include sub-makefile(s) last if we're not doing parallel building.
|
---|
565 | #
|
---|
566 | # We do this here so that the webservices ends up last in the target
|
---|
567 | # lists. For 100% correctness we must do this after all the main
|
---|
568 | # targets has been fully fleshed out as subheader/footer.kmk will
|
---|
569 | # process new targets.
|
---|
570 | #
|
---|
571 | ifeq ($(KMK_OPTS_JOBS),1)
|
---|
572 | ifdef VBOX_WITH_WEBSERVICES
|
---|
573 | include $(PATH_SUB_CURRENT)/webservice/Makefile.kmk
|
---|
574 | endif
|
---|
575 | include $(PATH_SUB_CURRENT)/testcase/Makefile.kmk
|
---|
576 | endif
|
---|
577 |
|
---|
578 | # generate rules
|
---|
579 | include $(KBUILD_PATH)/subfooter.kmk
|
---|
580 |
|
---|
581 |
|
---|
582 | #
|
---|
583 | # Additions rules.
|
---|
584 | #
|
---|
585 |
|
---|
586 | XIDLFILE = idl/VirtualBox.xidl
|
---|
587 |
|
---|
588 | ifneq ($(KBUILD_TARGET),win)
|
---|
589 |
|
---|
590 | xpcom/helpers.cpp: $(IDLTYPELIB)
|
---|
591 |
|
---|
592 | $(IDLFILE): idl/xpidl.xsl $(XIDLFILE) | $(call DIRDEP,$(dir $(IDLFILE)))
|
---|
593 | $(call MSG_TOOL,xsltproc,VBoxSVC,$<,$@)
|
---|
594 | $(QUIET)$(MKDIR) -p $(@D)
|
---|
595 | $(QUIET)$(VBOX_XSLTPROC) -o $@ $^
|
---|
596 |
|
---|
597 | $(IDLTYPELIB): $(IDLFILE) | $(call DIRDEP,$(dir $(IDLTYPELIB)))
|
---|
598 | $(call MSG_TOOL,xpidl,VBoxSVC,$<,$@)
|
---|
599 | $(QUIET)$(VBOX_XPIDL) -m typelib -I $(VBOX_PATH_XPCOM_IDL) -e $@ $<
|
---|
600 |
|
---|
601 | $(IDLHEADER): $(IDLFILE) | $(call DIRDEP,$(dir $(IDLHEADER)))
|
---|
602 | $(call MSG_TOOL,xpidl,VBoxSVC,$<,$@)
|
---|
603 | $(QUIET)$(VBOX_XPIDL) -m header -I $(VBOX_PATH_XPCOM_IDL) -e $@ $<
|
---|
604 |
|
---|
605 | else
|
---|
606 |
|
---|
607 | MAIN_IDL ?= $(EXEC_X86_WIN32) $(firstword $(wildcard \
|
---|
608 | $(PATH_SDK_WINPSDK_BIN)/Midl.Exe\
|
---|
609 | $(PATH_SDK_WINPSDK)/Bin/Midl.Exe\
|
---|
610 | $(PATH_DEVTOOLS)/win.x86/bin/midl.exe\
|
---|
611 | ) Sorry_Cannot_Find_The_Midl_Compiler_In_The_PSDK)
|
---|
612 | IDL_DEFS = /nologo
|
---|
613 | ifdef VBOX_WITH_VRDP
|
---|
614 | IDL_DEFS += /D VBOX_VRDP
|
---|
615 | endif
|
---|
616 |
|
---|
617 | $(IDLFILE): idl/midl.xsl $(XIDLFILE)
|
---|
618 | $(call MSG_TOOL,xsltproc,VBoxSVC,$<,$@)
|
---|
619 | $(QUIET)$(MKDIR) -p $(VBOX_PATH_SDK)/idl
|
---|
620 | $(QUIET)$(VBOX_XSLTPROC) -o $@ $^
|
---|
621 |
|
---|
622 | $(PATH_TARGET)/VBoxSVC.rgs: win/VirtualBox_rgs.xsl $(XIDLFILE)
|
---|
623 | $(VBOX_XSLTPROC) --stringparam Module VBoxSVC -o $@ $^
|
---|
624 |
|
---|
625 | $(PATH_TARGET)/VBoxC.rgs: win/VirtualBox_rgs.xsl $(XIDLFILE)
|
---|
626 | $(VBOX_XSLTPROC) --stringparam Module VBoxC -o $@ $^
|
---|
627 |
|
---|
628 | ## @todo r=bird: last changes to this rule showed incorrect dependencies here as it broke testcase (see testboxwin2).
|
---|
629 | # This is kind of obvious when looking at the rule, because it's (a) not specifing all it output
|
---|
630 | # and (b) generating more stuff *after* the maintarget has been completed.
|
---|
631 | #
|
---|
632 | # What needs to be done is to not depend on _i.c in the object subdir, but on all the final outputs.
|
---|
633 | $(PATH_VBoxCOM)/VirtualBox_i.c \
|
---|
634 | + $(VBOX_PATH_SDK)/lib/VirtualBox_i.c \
|
---|
635 | + $(PATH_VBoxCOM)/VirtualBox.h \
|
---|
636 | + $(VBOX_PATH_SDK)/include/VirtualBox.h \
|
---|
637 | + $(PATH_VBoxCOM)/VirtualBox.tlb \
|
---|
638 | + $(VBOX_PATH_SDK)/lib/VirtualBox.tlb: $(IDLFILE) | $(call DIRDEP,$(PATH_VBoxCOM))
|
---|
639 | $(MAIN_IDL) $(IDL_DEFS) \
|
---|
640 | /out $(subst /,\\,$(PATH_VBoxCOM)) \
|
---|
641 | /cpp_cmd $(subst /,\\,$(TOOL_$(VBOX_VCC_TOOL)_CC)) \
|
---|
642 | /I $(subst /,\\,$(PATH_SDK_WINPSDK_INC)) \
|
---|
643 | /I idl \
|
---|
644 | $(subst /,\\,$<)
|
---|
645 | $(MKDIR) -p $(VBOX_PATH_SDK)/include
|
---|
646 | $(CP) $(PATH_VBoxCOM)/VirtualBox.h $(VBOX_PATH_SDK)/include
|
---|
647 | $(MKDIR) -p $(VBOX_PATH_SDK)/lib
|
---|
648 | $(CP) $(PATH_VBoxCOM)/VirtualBox.tlb $(VBOX_PATH_SDK)/lib
|
---|
649 | $(CP) $(PATH_VBoxCOM)/VirtualBox_i.c $(VBOX_PATH_SDK)/lib
|
---|
650 |
|
---|
651 | endif
|
---|
652 |
|
---|
653 | # bird: anyone still using this? If not it's a gonner.
|
---|
654 | ## Hack to work around wine's trouble with midl.exe and rc.exe (seems to be msvcrt.dll related)
|
---|
655 | #gen: $(PREREQS)
|
---|
656 |
|
---|
657 |
|
---|
658 | #
|
---|
659 | # Translation stuff
|
---|
660 | #
|
---|
661 | VBoxSVC_HEADERS = \
|
---|
662 | include/collection.h \
|
---|
663 | include/MachineImpl.h \
|
---|
664 | include/HostDVDDriveImpl.h \
|
---|
665 | include/HostFloppyDriveImpl.h
|
---|
666 |
|
---|
667 | VBoxC_HEADERS = \
|
---|
668 | include/ConsoleImpl.h
|
---|
669 |
|
---|
670 | VBoxSVC_TRANSLATIONS = \
|
---|
671 | nls/VBoxSVC_de.ts
|
---|
672 |
|
---|
673 | VBoxC_TRANSLATIONS = \
|
---|
674 | nls/VBoxC_de.ts
|
---|
675 |
|
---|
676 | updatenls:
|
---|
677 | $(VBOX_LUPDATE) $(VBoxSVC_SOURCES) $(VBoxSVC_HEADERS) -ts $(VBoxSVC_TRANSLATIONS)
|
---|
678 | $(VBOX_LUPDATE) $(VBoxC_SOURCES) $(VBoxC_HEADERS) -ts $(VBoxC_TRANSLATIONS)
|
---|
679 |
|
---|
680 | ifdef VBOX_WITH_XPCOM
|
---|
681 |
|
---|
682 | testidl: $(IDLFILE) $(IDLTYPELIB)
|
---|
683 | testidlhdr: $(IDLHEADER)
|
---|
684 |
|
---|
685 | else
|
---|
686 |
|
---|
687 | testidl: $(IDLFILE) $(PATH_VBoxCOM)/VirtualBox_i.c
|
---|
688 |
|
---|
689 | endif
|
---|
690 |
|
---|
691 | testschemadefs: $(VBOX_XML_SCHEMADEFS_H) $(VBOX_XML_SCHEMADEFS_CPP)
|
---|
692 |
|
---|
693 | $(PATH_BIN)/comregister.cmd: win/comregister.cmd
|
---|
694 | $(CP) $< $@
|
---|
695 |
|
---|
696 |
|
---|
697 | # Hot fix when dependencies goes bad again...
|
---|
698 | #.NOTPARALLEL: $(TARGET_VBoxC) $(TARGET_VBoxSVC) $(TARGET_VBoxCOM) $(IDLHEADER) $(IDLFILE) $(PATH_VBoxCOM)/VirtualBox_i.c
|
---|
699 |
|
---|