VirtualBox

source: vbox/trunk/src/VBox/Main/Makefile.kmk@ 9481

Last change on this file since 9481 was 9360, checked in by vboxsync, 17 years ago

Main: Return the correct value for IGuest::OSTypeId as reported by the guest additions when they are active (fixes #1761#c77).

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 18.6 KB
Line 
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
22DEPTH = ../../..
23include $(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.
28ifneq ($(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
33endif
34
35# targets++
36LIBRARIES += VBoxCOM
37DLLS += VBoxSettings VBoxC
38PROGRAMS += VBoxSVC
39VBOX_MAIN_DEFS =
40ifneq ($(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
49endif
50if1of ($(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
56endif
57
58## @todo eliminate or expand VBOX_MAIN_DEFS.
59
60#PROGRAMS += tstCFGLdr
61
62ifeq ($(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
74else
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
89endif
90
91
92#
93# The Main API documentation
94#
95docs: $(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#
117VBoxSVC_TEMPLATE = VBOXMAINEXE
118VBoxSVC_DEFS = VBOX_MAIN_SETTINGS_ADDONS $(VBOX_MAIN_DEFS)
119ifdef VBOX_WITH_VRDP
120VBoxSVC_DEFS += VBOX_VRDP
121endif
122ifdef VBOX_WITH_HGCM
123VBoxSVC_DEFS += VBOX_HGCM
124endif
125ifdef VBOX_MAIN_RELEASE_LOG
126VBoxSVC_DEFS += VBOX_MAIN_RELEASE_LOG LOG_ENABLED
127endif
128ifdef VBOX_WITH_USB
129VBoxSVC_DEFS += VBOX_WITH_USB
130 ifdef VBOX_WITH_EHCI
131VBoxSVC_DEFS += VBOX_WITH_EHCI
132 endif
133 ifdef VBOX_WITH_NEW_USB_CODE_ON_DARWIN
134VBoxSVC_DEFS += VBOX_WITH_NEW_USB_CODE_ON_DARWIN
135 endif
136endif
137ifdef VBOX_WITH_ALSA
138VBoxSVC_DEFS += VBOX_WITH_ALSA
139endif
140ifdef VBOX_WITH_PULSE
141VBoxSVC_DEFS += VBOX_WITH_PULSE
142endif
143ifdef VBOX_WITH_WINMM
144VBoxSVC_DEFS += VBOX_WITH_WINMM
145endif
146ifdef VBOX_WITH_E1000
147VBoxSVC_DEFS += VBOX_WITH_E1000
148endif
149ifdef VBOX_WITH_AHCI
150VBoxSVC_DEFS += VBOX_WITH_AHCI
151endif
152ifdef VBOX_WITHOUT_LINUX_COMPILER_H
153VBoxSVC_DEFS += VBOX_WITHOUT_LINUX_COMPILER_H
154endif
155
156VBoxSVC_DEFS.win += VBOX_COM_OUTOFPROC_MODULE
157VBoxSVC_DEFS.win.x86 += _WIN32_WINNT=0x0500
158VBoxSVC_DEFS.win.amd64 += _WIN32_WINNT=0x0510
159VBoxSVC_DEFS.linux += VBOX_USE_LIBHAL
160VBoxSVC_DEFS.solaris += VBOX_USE_LIBHAL
161
162VBoxSVC_INCS = \
163 include \
164 $(PATH_VBoxSVC) \
165 $(PATH_CURRENT)
166VBoxSVC_INCS.win = \
167 $(PATH_VBoxCOM)
168ifdef VBOX_WITH_USB
169 VBoxSVC_INCS.os2 = \
170 $(PATH_ROOT)/src/VBox/HostDrivers/VBoxUSB/os2
171endif
172
173VBoxSVC_LIBS += \
174 $(LIB_DDU) \
175 $(LIB_SETTINGS)
176VBoxSVC_LIBS.darwin = \
177 $(LIB_VMM) \
178 $(LIB_REM)
179VBoxSVC_LIBS.solaris = \
180 adm \
181 devinfo
182
183VBoxSVC_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
215ifdef VBOX_WITH_VRDP
216VBoxSVC_SOURCES += VRDPServerImpl.cpp
217endif
218
219VBoxSVC_SOURCES.darwin = \
220 darwin/iokit.cpp
221
222VBoxSVC_SOURCES.win = \
223 HostNetworkInterfaceImpl.cpp \
224 win/svcmain.cpp \
225 win/svchlp.cpp \
226 win/VBoxSVC.rc
227
228VBoxSVC_SOURCES.linux = \
229 linux/vbox-libhal.cpp
230
231VBoxSVC_SOURCES.solaris = \
232 linux/vbox-libhal.cpp
233
234ifdef VBOX_WITH_XPCOM
235VBoxSVC_SOURCES += \
236 xpcom/server.cpp
237endif
238
239ifdef VBOX_WITH_USB
240VBoxSVC_SOURCES += \
241 USBDeviceFilterImpl.cpp \
242 USBProxyService.cpp \
243 HostUSBDeviceImpl.cpp
244VBoxSVC_SOURCES.darwin += darwin/USBProxyServiceDarwin.cpp
245VBoxSVC_SOURCES.linux += linux/USBProxyServiceLinux.cpp
246VBoxSVC_SOURCES.os2 += os2/USBProxyServiceOs2.cpp
247VBoxSVC_SOURCES.solaris += solaris/USBProxyServiceSolaris.cpp
248VBoxSVC_SOURCES.win += win/USBProxyServiceWindows.cpp
249endif
250
251VBoxSVC_LDFLAGS.darwin = -framework IOKit
252ifeq ($(KBUILD_TYPE),debug)
253VBoxSVC_LDFLAGS.linux += -rdynamic # for backtrace_symbols()
254endif
255
256win/VBoxSVC.rc_INCS = $(PATH_TARGET)
257win/VBoxSVC.rc_DEPS = $(PATH_TARGET)/VBoxSVC.rgs $(PATH_TARGET)/VBoxSVC-icon.rc
258win/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#
268ifdef VBOX_WITH_XPCOM
269
270VBoxSVCM_TEMPLATE = VBOXMAINDLL
271ifneq ($(KBUILD_TARGET),linux)
272VBoxSVCM_INST = $(INST_BIN)components/
273endif
274VBoxSVCM_DEFS = IN_RING3 $(VBOX_MAIN_DEFS)
275VBoxSVCM_INCS = \
276 include \
277 $(PATH_VBoxC) \
278 $(PATH_CURRENT)
279VBoxSVCM_SOURCES = \
280 xpcom/server_module.cpp
281ifdef VBOX_WITH_ORIGIN
282VBoxSVCM_LDFLAGS = '$(VBOX_GCC_RPATH_OPT)$$(VBOX_ORIGIN)/..'
283endif
284VBoxSVCM_LDFLAGS.darwin = \
285 -install_name @executable_path/components/VBoxSVCM.dylib \
286 -exported_symbols_list $(PATH_TARGET)/VBoxSVCM.def
287ifeq ($(KBUILD_TARGET),darwin)
288VBoxSVCM_ORDERDEPS += $(PATH_TARGET)/VBoxSVCM.def
289VBoxSVCM_CLEAN += $(PATH_TARGET)/VBoxSVCM.def
290$(PATH_TARGET)/VBoxSVCM.def:
291 $(RM) -f $@
292 $(APPEND) $@ _NSGetModule
293endif
294
295endif # VBOX_WITH_XPCOM
296
297
298#
299# VBoxC module
300#
301VBoxC_TEMPLATE = VBOXMAINDLL
302ifneq ($(filter-out linux win,$(KBUILD_TARGET)),)
303VBoxC_INST = $(INST_BIN)components/
304endif
305
306VBoxC_DEFS = IN_RING3 $(VBOX_MAIN_DEFS)
307VBoxC_DEFS += VBOX_COM_INPROC
308
309ifdef VBOX_WITH_VRDP
310VBoxC_DEFS += VBOX_VRDP
311endif
312ifdef VBOX_WITH_HGCM
313VBoxC_DEFS += VBOX_HGCM
314endif
315ifdef VBOX_MAIN_RELEASE_LOG
316VBoxC_DEFS += VBOX_MAIN_RELEASE_LOG LOG_ENABLED
317endif
318ifdef VBOX_WITH_USB
319VBoxC_DEFS += VBOX_WITH_USB
320ifdef VBOX_WITH_EHCI
321VBoxC_DEFS += VBOX_WITH_EHCI
322endif
323endif
324ifdef VBOX_WITH_ALSA
325VBoxC_DEFS += VBOX_WITH_ALSA
326endif
327ifdef VBOX_WITH_PULSE
328VBoxC_DEFS += VBOX_WITH_PULSE
329endif
330ifdef VBOX_WITH_WINMM
331VBoxC_DEFS += VBOX_WITH_WINMM
332endif
333ifdef VBOX_WITH_CROSSBOW
334VBoxC_DEFS += VBOX_WITH_CROSSBOW
335endif
336ifdef VBOX_WITH_E1000
337VBoxC_DEFS += VBOX_WITH_E1000
338endif
339
340VBoxC_DEFS.win.x86 += _WIN32_WINNT=0x0500
341VBoxC_DEFS.win.amd64 += _WIN32_WINNT=0x0510
342
343VBoxC_INCS = \
344 include \
345 $(PATH_VBoxC)
346VBoxC_INCS.win = \
347 $(PATH_VBoxCOM) \
348 $(PATH_SUB_CURRENT)
349
350ifdef VBOX_WITH_ORIGIN
351VBoxC_LDFLAGS = '$(VBOX_GCC_RPATH_OPT)$$(VBOX_ORIGIN)/..'
352endif
353VBoxC_LDFLAGS.darwin = \
354 -install_name @executable_path/components/VBoxSVCM.dylib \
355 -exported_symbols_list $(PATH_TARGET)/VBoxC.def
356ifdef VBOX_USE_VCC80
357 VBoxC_LDFLAGS.win = /MANIFEST
358endif
359
360VBoxC_LIBS += \
361 $(LIB_VMM) \
362 $(LIB_REM)
363
364VBoxC_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
389VBoxC_SOURCES.win = \
390 win/dllmain.cpp \
391 win/VBoxC.def \
392 win/VBoxC.rc
393ifdef VBOX_WITH_XPCOM
394VBoxC_SOURCES += \
395 xpcom/module.cpp
396endif
397
398ifdef VBOX_WITH_HGCM
399VBoxC_SOURCES += \
400 hgcm/HGCMObjects.cpp \
401 hgcm/HGCMThread.cpp \
402 hgcm/HGCM.cpp
403endif
404
405ifdef VBOX_WITH_USB
406VBoxC_SOURCES += \
407 RemoteUSBBackend.cpp
408endif
409
410ifeq ($(KBUILD_TARGET),darwin)
411VBoxC_ORDERDEPS += $(PATH_TARGET)/VBoxC.def
412VBoxC_CLEAN += $(PATH_TARGET)/VBoxC.def
413$(PATH_TARGET)/VBoxC.def: $(MAKEFILE_CURRENT)
414 $(RM) -f $@
415 $(APPEND) $@ _NSGetModule
416 $(APPEND) $@ _VBoxDriversRegister
417endif
418
419# Version.cpp uses VBOX_SVN_REV.
420Version.cpp_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
421Version.cpp_DEPS = $(VBOX_SVN_REV_KMK)
422
423ConsoleImpl.cpp_DEFS = VBOX_BUILD_TARGET=\"$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)\"
424
425win/VBoxC.rc_DEPS = $(PATH_TARGET)/VBoxC.rgs $(PATH_VBoxCOM)/VirtualBox.tlb
426
427
428#
429# VBoxSettings
430#
431VBoxSettings_TEMPLATE = VBOXMAINDLL
432VBoxSettings_NAME = $(basename $(notdir $(LIB_SETTINGS)))
433VBoxSettings_SDKS = VBOX_LIBXSLT VBOX_LIBXML2 VBOX_ZLIB
434VBoxSettings_DEFS = IN_VBOXSETTINGS_R3
435VBoxSettings_INCS = \
436 include \
437 $(PATH_TARGET)
438VBoxSettings_SOURCES = \
439 xml/Settings.cpp
440VBoxSettings_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#
446VBoxCOM_TEMPLATE = VBOXMAINLIB
447VBoxCOM_SOURCES = \
448 glue/com.cpp \
449 glue/initterm.cpp \
450 glue/string.cpp \
451 glue/EventQueue.cpp \
452 glue/ErrorInfo.cpp
453ifeq ($(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
458else
459 VBoxCOM_INCS += \
460 include
461 VBoxCOM_SOURCES += \
462 xpcom/helpers.cpp
463endif
464
465
466#
467# Generate _DEPS on all sources which depends on generated headers.
468#
469ifeq ($(KBUILD_TARGET),win)
470PREREQS = $(PATH_VBoxCOM)/VirtualBox_i.c
471else
472PREREQS = $(IDLTYPELIB) $(IDLHEADER)
473endif
474
475# brute force way to ensure the prereqs are generated before anything is compiled.
476define def_src_deps
477$(src)_ORDERDEPS += $(PREREQS)
478endef
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
490VBOX_XML_SCHEMA_H = $(PATH_TARGET)/xml_VirtualBox_settings_xsd.h
491VBOX_XML_SCHEMA_COMMON_H = $(PATH_TARGET)/xml_VirtualBox_settings_common_xsd.h
492VBOX_XML_CONVERTER_TEMPLATE_H = $(PATH_TARGET)/xml_SettingsConverter_xsl.h
493
494VBOX_XML_SCHEMA_COMMON = xml/VirtualBox-settings-common.xsd
495VBOX_XML_SCHEMA.darwin = xml/VirtualBox-settings-macosx.xsd
496VBOX_XML_SCHEMA.linux = xml/VirtualBox-settings-linux.xsd
497VBOX_XML_SCHEMA.freebsd = xml/VirtualBox-settings-freebsd.xsd
498VBOX_XML_SCHEMA.win = xml/VirtualBox-settings-windows.xsd
499VBOX_XML_SCHEMA.os2 = xml/VirtualBox-settings-os2.xsd
500VBOX_XML_SCHEMA.solaris = xml/VirtualBox-settings-solaris.xsd
501
502VBOX_XML_CONVERTER_TEMPLATE = xml/SettingsConverter.xsl
503
504VirtualBoxImplExtra.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
519OTHER_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#
526VBOX_XML_SCHEMADEFS_H = $(PATH_TARGET)/SchemaDefs.h
527VBOX_XML_SCHEMADEFS_CPP = $(PATH_TARGET)/SchemaDefs.cpp
528VBOX_XML_SCHEMADEFS_XSL = xml/SchemaDefs.xsl
529
530VBoxC_DEPS += $(VBOX_XML_SCHEMADEFS_H)
531VBoxC_INCS += $(PATH_TARGET)
532VBoxC_SOURCES += $(VBOX_XML_SCHEMADEFS_CPP)
533
534VBoxSVC_DEPS += $(VBOX_XML_SCHEMADEFS_H)
535VBoxSVC_INCS += $(PATH_TARGET)
536VBoxSVC_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
546OTHER_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
555xpcom-components_INST = $(INST_BIN)components/
556ifeq ($(KBUILD_TARGET),linux)
557xpcom-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)
563endif
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#
574ifeq ($(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
579endif
580
581# generate rules
582include $(KBUILD_PATH)/subfooter.kmk
583
584
585#
586# Additions rules.
587#
588
589XIDLFILE = idl/VirtualBox.xidl
590
591ifneq ($(KBUILD_TARGET),win)
592
593xpcom/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
608else
609
610MAIN_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)
615IDL_DEFS = /nologo
616ifdef VBOX_WITH_VRDP
617 IDL_DEFS += /D VBOX_VRDP
618endif
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
654endif
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#
664VBoxSVC_HEADERS = \
665 include/collection.h \
666 include/MachineImpl.h \
667 include/HostDVDDriveImpl.h \
668 include/HostFloppyDriveImpl.h
669
670VBoxC_HEADERS = \
671 include/ConsoleImpl.h
672
673VBoxSVC_TRANSLATIONS = \
674 nls/VBoxSVC_de.ts
675
676VBoxC_TRANSLATIONS = \
677 nls/VBoxC_de.ts
678
679updatenls:
680 $(VBOX_LUPDATE) $(VBoxSVC_SOURCES) $(VBoxSVC_HEADERS) -ts $(VBoxSVC_TRANSLATIONS)
681 $(VBOX_LUPDATE) $(VBoxC_SOURCES) $(VBoxC_HEADERS) -ts $(VBoxC_TRANSLATIONS)
682
683ifdef VBOX_WITH_XPCOM
684
685testidl: $(IDLFILE) $(IDLTYPELIB)
686testidlhdr: $(IDLHEADER)
687
688else
689
690testidl: $(IDLFILE) $(PATH_VBoxCOM)/VirtualBox_i.c
691
692endif
693
694testschemadefs: $(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
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette