VirtualBox

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

Last change on this file since 8217 was 8155, checked in by vboxsync, 17 years ago

The Big Sun Rebranding Header Change

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 18.4 KB
Line 
1# $Id: Makefile.kmk 8155 2008-04-18 15:16:47Z 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 $(PATH_KBUILD)/subheader.kmk
24
25# The KMK_OPTS_JOBS is a kmk v0.1.3 feature. Fake it for now.
26ifndef KMK_OPTS_JOBS
27 KMK_OPTS_JOBS = 1
28endif
29
30# Include sub-makefile(s) first if we're doing parallel building.
31# This is primarily a hack to try avoid idling all but one cpu when
32# building the gigant soap sources.
33ifneq ($(KMK_OPTS_JOBS),1)
34 ifdef VBOX_WITH_WEBSERVICES
35 include $(PATH_SUB_CURRENT)/webservice/Makefile.kmk
36 endif
37 include $(PATH_SUB_CURRENT)/testcase/Makefile.kmk
38endif
39
40# targets++
41LIBRARIES += VBoxCOM
42DLLS += VBoxSettings VBoxC
43PROGRAMS += VBoxSVC
44VBOX_MAIN_DEFS =
45ifneq ($(BUILD_TARGET),win)
46 ifndef VBOX_WITH_XPCOM
47 $(error "VBox: VBOX_WITH_XPCOM isn't defined")
48 endif
49 DLLS += VBoxSVCM
50 ifneq ($(BUILD_TARGET),os2)
51 VBOX_MAIN_DEFS+= VBOX_WITH_SYS_V_IPC_SESSION_WATCHER
52 endif
53 VBOX_MAIN_DEFS += VBOX_WITH_UNIXY_TAP_NETWORKING
54endif
55## @todo later when RTSemRWIsWriteOwner and RTSemRWGetWriteRecursion are done
56#ifeq ($(filter-out linux darwin freebsd solaris,$(BUILD_TARGET)),)
57# VBOX_MAIN_DEFS += VBOX_MAIN_USE_SEMRW
58#endif
59
60## @todo eliminate or expand VBOX_MAIN_DEFS.
61
62#PROGRAMS += tstCFGLdr
63
64ifeq ($(BUILD_TARGET),win)
65 OTHERS += $(PATH_BIN)/comregister.cmd
66 IDLFILE = $(VBOX_PATH_SDK)/idl/VirtualBox.idl
67 OTHER_CLEAN += \
68 $(PATH_BIN)/comregister.cmd \
69 $(VBOX_PATH_SDK)/include/VirtualBox.h \
70 $(IDLFILE) \
71 $(VBOX_PATH_SDK)/lib/VirtualBox.tlb \
72 $(VBOX_PATH_SDK)/lib/VirtualBox_i.c \
73 $(PATH_VBoxCOM)/VirtualBox.h \
74 $(PATH_VBoxCOM)/VirtualBox_i.c \
75 $(PATH_VBoxCOM)/VirtualBox.tlb
76else
77 INSTALLS += xpcom-components
78 IDLFILE = $(VBOX_PATH_SDK)/idl/VirtualBox_XPCOM.idl
79 ifeq ($(BUILD_TARGET),linux)
80 IDLTYPELIB = $(PATH_BIN)/VirtualBox_XPCOM.xpt
81 else
82 IDLTYPELIB = $(PATH_BIN)/components/VirtualBox_XPCOM.xpt
83 endif
84 IDLHEADER = $(VBOX_PATH_SDK)/include/VirtualBox_XPCOM.h
85 OTHERS += $(IDLTYPELIB)
86 OTHER_CLEAN += \
87 $(IDLFILE) \
88 $(IDLHEADER) \
89 $(IDLTYPELIB)
90
91endif
92
93
94#
95# The Main API documentation
96#
97docs: $(PATH_TARGET)/docs.Main
98
99$(PATH_TARGET)/docs.Main: \
100 Doxyfile.Main \
101 idl/doxygen.xsl \
102 idl/VirtualBox.xidl \
103 | $(call DIRDEP, $(PATH_TARGET)) \
104 $(call DIRDEP, $(PATH_OUT)/docs/Main)
105 $(RM) -f $(wildcard $(PATH_OUT)/docs/Main/html/*)
106 $(VBOX_XSLTPROC) -o $(PATH_TARGET)/VirtualBox.idl idl/doxygen.xsl idl/VirtualBox.xidl
107 $(REDIRECT) -E 'PATH_OUT=$(PATH_OUT)' -E 'PATH_TARGET=$(PATH_TARGET)' -E 'PATH_CHM=$(subst /,\,$(PATH_BIN)/VirtualBoxAPI.chm)' \
108 -- doxygen Doxyfile.Main
109 -$(EXEC_X86_WIN32) $(VBOX_PATH_HTML_HELP_WORKSHOP)/hhc.exe $(subst /,\\,$(PATH_OUT)/docs/Main/html/index.hhp)
110 $(APPEND) $(PATH_TARGET)/docs.Main
111
112$(call DIRDEP, $(PATH_OUT)/docs/Main):
113 $(MKDIR) -p $@
114
115
116#
117# VBoxSVC executable
118#
119VBoxSVC_TEMPLATE = VBOXMAINEXE
120VBoxSVC_DEFS = VBOX_MAIN_SETTINGS_ADDONS $(VBOX_MAIN_DEFS)
121ifdef VBOX_WITH_VRDP
122VBoxSVC_DEFS += VBOX_VRDP
123endif
124ifdef VBOX_WITH_HGCM
125VBoxSVC_DEFS += VBOX_HGCM
126endif
127ifdef VBOX_MAIN_RELEASE_LOG
128VBoxSVC_DEFS += VBOX_MAIN_RELEASE_LOG LOG_ENABLED
129endif
130ifdef VBOX_WITH_USB
131VBoxSVC_DEFS += VBOX_WITH_USB
132 ifdef VBOX_WITH_EHCI
133VBoxSVC_DEFS += VBOX_WITH_EHCI
134 endif
135 ifdef VBOX_WITH_NEW_USB_CODE_ON_DARWIN
136VBoxSVC_DEFS += VBOX_WITH_NEW_USB_CODE_ON_DARWIN
137 endif
138endif
139ifdef VBOX_WITH_ALSA
140VBoxSVC_DEFS += VBOX_WITH_ALSA
141endif
142ifdef VBOX_WITH_PULSE
143VBoxSVC_DEFS += VBOX_WITH_PULSE
144endif
145ifdef VBOX_WITH_WINMM
146VBoxSVC_DEFS += VBOX_WITH_WINMM
147endif
148ifdef VBOX_WITH_E1000
149VBoxSVC_DEFS += VBOX_WITH_E1000
150endif
151ifdef VBOX_WITH_AHCI
152VBoxSVC_DEFS += VBOX_WITH_AHCI
153endif
154ifdef VBOX_WITHOUT_LINUX_COMPILER_H
155VBoxSVC_DEFS += VBOX_WITHOUT_LINUX_COMPILER_H
156endif
157
158VBoxSVC_DEFS.win += VBOX_COM_OUTOFPROC_MODULE
159VBoxSVC_DEFS.win.x86 += _WIN32_WINNT=0x0500
160VBoxSVC_DEFS.win.amd64 += _WIN32_WINNT=0x0510
161VBoxSVC_DEFS.linux += VBOX_USE_LIBHAL
162VBoxSVC_DEFS.solaris += VBOX_USE_LIBHAL
163
164VBoxSVC_INCS = \
165 include \
166 $(PATH_VBoxSVC) \
167 $(PATH_CURRENT)
168VBoxSVC_INCS.win = \
169 $(PATH_VBoxCOM)
170ifdef VBOX_WITH_USB
171 VBoxSVC_INCS.os2 = \
172 $(PATH_ROOT)/src/VBox/HostDrivers/VBoxUSB/os2
173endif
174
175VBoxSVC_LIBS += \
176 $(LIB_DDU) \
177 $(LIB_SETTINGS)
178ifdef VBOX_WITH_USB
179 VBoxSVC_LIBS += \
180 $(PATH_LIB)/USBLib$(VBOX_SUFF_LIB)
181endif
182VBoxSVC_LIBS.darwin = \
183 $(LIB_VMM) \
184 $(LIB_REM)
185VBoxSVC_LIBS.solaris = \
186 adm \
187 devinfo
188
189VBoxSVC_SOURCES = \
190 Logging.cpp \
191 AutoLock.cpp \
192 Matching.cpp \
193 VirtualBoxBase.cpp \
194 VirtualBoxErrorInfoImpl.cpp \
195 VirtualBoxImpl.cpp \
196 VirtualBoxImplExtra.cpp \
197 MachineImpl.cpp \
198 SnapshotImpl.cpp \
199 HardDiskImpl.cpp \
200 HardDiskAttachmentImpl.cpp \
201 ProgressImpl.cpp \
202 DVDDriveImpl.cpp \
203 DVDImageImpl.cpp \
204 FloppyDriveImpl.cpp \
205 FloppyImageImpl.cpp \
206 HostImpl.cpp \
207 HostDVDDriveImpl.cpp \
208 HostFloppyDriveImpl.cpp \
209 GuestOSTypeImpl.cpp \
210 NetworkAdapterImpl.cpp \
211 SerialPortImpl.cpp \
212 ParallelPortImpl.cpp \
213 USBControllerImpl.cpp \
214 SATAControllerImpl.cpp \
215 AudioAdapterImpl.cpp \
216 SharedFolderImpl.cpp \
217 SystemPropertiesImpl.cpp \
218 BIOSSettingsImpl.cpp
219
220ifdef VBOX_WITH_VRDP
221VBoxSVC_SOURCES += VRDPServerImpl.cpp
222endif
223
224VBoxSVC_SOURCES.darwin = \
225 darwin/iokit.cpp
226
227VBoxSVC_SOURCES.win = \
228 HostNetworkInterfaceImpl.cpp \
229 win32/svcmain.cpp \
230 win32/svchlp.cpp \
231 win32/VBoxSVC.rc
232
233VBoxSVC_SOURCES.linux = \
234 linux/vbox-libhal.cpp
235
236VBoxSVC_SOURCES.solaris = \
237 linux/vbox-libhal.cpp
238
239ifdef VBOX_WITH_XPCOM
240VBoxSVC_SOURCES += \
241 linux/server.cpp
242endif
243
244ifdef VBOX_WITH_USB
245VBoxSVC_SOURCES += \
246 USBDeviceFilterImpl.cpp \
247 USBProxyService.cpp \
248 HostUSBDeviceImpl.cpp
249VBoxSVC_SOURCES.darwin += darwin/USBProxyServiceDarwin.cpp
250VBoxSVC_SOURCES.linux += linux/USBProxyServiceLinux.cpp
251VBoxSVC_SOURCES.os2 += os2/USBProxyServiceOs2.cpp
252VBoxSVC_SOURCES.solaris += solaris/USBProxyServiceSolaris.cpp
253VBoxSVC_SOURCES.win += win32/USBProxyServiceWin32.cpp
254endif
255
256VBoxSVC_LDFLAGS.darwin = -framework IOKit
257ifeq ($(BUILD_TYPE),debug)
258VBoxSVC_LDFLAGS.linux += -rdynamic # for backtrace_symbols()
259endif
260
261win32/VBoxSVC.rc_DEPS = $(PATH_TARGET)/VBoxSVC.rgs
262
263
264#
265# VBoxSVC wrapper module
266#
267ifdef VBOX_WITH_XPCOM
268
269VBoxSVCM_TEMPLATE = VBOXMAINDLL
270ifneq ($(BUILD_TARGET),linux)
271VBoxSVCM_INST = $(INST_BIN)components/
272endif
273VBoxSVCM_DEFS = IN_RING3 $(VBOX_MAIN_DEFS)
274VBoxSVCM_INCS = \
275 include \
276 $(PATH_VBoxC) \
277 $(PATH_CURRENT)
278VBoxSVCM_SOURCES = \
279 linux/server_module.cpp
280ifdef VBOX_WITH_ORIGIN
281VBoxSVCM_LDFLAGS = '$(VBOX_GCC_RPATH_OPT)$$(VBOX_ORIGIN)/..'
282endif
283VBoxSVCM_LDFLAGS.darwin = \
284 -install_name @executable_path/components/VBoxSVCM.dylib \
285 -exported_symbols_list $(PATH_TARGET)/VBoxSVCM.def
286ifeq ($(BUILD_TARGET),darwin)
287VBoxSVCM_ORDERDEPS += $(PATH_TARGET)/VBoxSVCM.def
288VBoxSVCM_CLEAN += $(PATH_TARGET)/VBoxSVCM.def
289$(PATH_TARGET)/VBoxSVCM.def:
290 $(RM) -f $@
291 $(APPEND) $@ _NSGetModule
292endif
293
294endif # VBOX_WITH_XPCOM
295
296
297#
298# VBoxC module
299#
300VBoxC_TEMPLATE = VBOXMAINDLL
301ifneq ($(filter-out linux win,$(BUILD_TARGET)),)
302VBoxC_INST = $(INST_BIN)components/
303endif
304
305VBoxC_DEFS = IN_RING3 $(VBOX_MAIN_DEFS)
306VBoxC_DEFS += VBOX_COM_INPROC
307
308ifdef VBOX_WITH_VRDP
309VBoxC_DEFS += VBOX_VRDP
310endif
311ifdef VBOX_WITH_HGCM
312VBoxC_DEFS += VBOX_HGCM
313endif
314ifdef VBOX_MAIN_RELEASE_LOG
315VBoxC_DEFS += VBOX_MAIN_RELEASE_LOG LOG_ENABLED
316endif
317ifdef VBOX_WITH_USB
318VBoxC_DEFS += VBOX_WITH_USB
319ifdef VBOX_WITH_EHCI
320VBoxC_DEFS += VBOX_WITH_EHCI
321endif
322endif
323ifdef VBOX_WITH_ALSA
324VBoxC_DEFS += VBOX_WITH_ALSA
325endif
326ifdef VBOX_WITH_PULSE
327VBoxC_DEFS += VBOX_WITH_PULSE
328endif
329ifdef VBOX_WITH_WINMM
330VBoxC_DEFS += VBOX_WITH_WINMM
331endif
332ifdef VBOX_WITH_CROSSBOW
333VBoxC_DEFS += VBOX_WITH_CROSSBOW
334endif
335ifdef VBOX_WITH_E1000
336VBoxC_DEFS += VBOX_WITH_E1000
337endif
338
339VBoxC_DEFS.win.x86 += _WIN32_WINNT=0x0500
340VBoxC_DEFS.win.amd64 += _WIN32_WINNT=0x0510
341
342VBoxC_INCS = \
343 include \
344 $(PATH_VBoxC)
345VBoxC_INCS.win = \
346 $(PATH_VBoxCOM) \
347 $(PATH_SUB_CURRENT)
348
349ifdef VBOX_WITH_ORIGIN
350VBoxC_LDFLAGS = '$(VBOX_GCC_RPATH_OPT)$$(VBOX_ORIGIN)/..'
351endif
352VBoxC_LDFLAGS.darwin = \
353 -install_name @executable_path/components/VBoxSVCM.dylib \
354 -exported_symbols_list $(PATH_TARGET)/VBoxC.def
355ifdef VBOX_USE_VCC80
356 VBoxC_LDFLAGS.win = /MANIFEST
357endif
358
359VBoxC_LIBS += \
360 $(LIB_VMM) \
361 $(LIB_REM)
362
363VBoxC_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
387VBoxC_SOURCES.win = \
388 win32/dllmain.cpp \
389 win32/VBoxC.def \
390 win32/VBoxC.rc
391ifdef VBOX_WITH_XPCOM
392VBoxC_SOURCES += \
393 linux/module.cpp
394endif
395
396ifdef VBOX_WITH_HGCM
397VBoxC_SOURCES += \
398 hgcm/HGCMObjects.cpp \
399 hgcm/HGCMThread.cpp \
400 hgcm/HGCM.cpp
401endif
402
403ifdef VBOX_WITH_USB
404VBoxC_SOURCES += \
405 RemoteUSBBackend.cpp
406endif
407
408ifeq ($(BUILD_TARGET),darwin)
409VBoxC_ORDERDEPS += $(PATH_TARGET)/VBoxC.def
410VBoxC_CLEAN += $(PATH_TARGET)/VBoxC.def
411$(PATH_TARGET)/VBoxC.def: $(MAKEFILE_CURRENT)
412 $(RM) -f $@
413 $(APPEND) $@ _NSGetModule
414 $(APPEND) $@ _VBoxDriversRegister
415endif
416
417# Version.cpp uses VBOX_SVN_REV.
418Version.cpp_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
419Version.cpp_DEPS = $(VBOX_SVN_REV_KMK)
420
421ConsoleImpl.cpp_DEFS = VBOX_BUILD_TARGET=\"$(BUILD_TARGET).$(BUILD_TARGET_ARCH)\"
422
423win32/VBoxC.rc_DEPS = $(PATH_TARGET)/VBoxC.rgs $(PATH_VBoxCOM)/VirtualBox.tlb
424
425
426#
427# VBoxSettings
428#
429VBoxSettings_TEMPLATE = VBOXMAINDLL
430VBoxSettings_NAME = $(basename $(notdir $(LIB_SETTINGS)))
431VBoxSettings_SDKS = VBOX_LIBXSLT VBOX_LIBXML2 VBOX_ZLIB
432VBoxSettings_DEFS = IN_VBOXSETTINGS_R3
433VBoxSettings_INCS = \
434 include \
435 $(PATH_TARGET)
436VBoxSettings_SOURCES = \
437 xml/Settings.cpp
438VBoxSettings_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#
444VBoxCOM_TEMPLATE = VBOXMAINLIB
445VBoxCOM_SOURCES = \
446 glue/com.cpp \
447 glue/initterm.cpp \
448 glue/string.cpp \
449 glue/EventQueue.cpp \
450 glue/ErrorInfo.cpp
451ifeq ($(BUILD_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
456else
457 VBoxCOM_INCS += \
458 include
459 VBoxCOM_SOURCES += \
460 linux/helpers.cpp
461endif
462
463
464#
465# Generate _DEPS on all sources which depends on generated headers.
466#
467ifeq ($(BUILD_TARGET),win)
468PREREQS = $(PATH_VBoxCOM)/VirtualBox_i.c
469else
470PREREQS = $(IDLTYPELIB) $(IDLHEADER)
471endif
472
473# brute force way to ensure the prereqs are generated before anything is compiled.
474define def_src_deps
475$(src)_ORDERDEPS += $(PREREQS)
476endef
477$(foreach src,\
478 $(VBoxC_SOURCES) $(VBoxC_SOURCES.$(BUILD_TARGET)) \
479 $(VBoxSVC_SOURCES) $(VBoxSVC_SOURCES.$(BUILD_TARGET)) \
480 $(VBoxCOM_SOURCES) \
481 ,$(eval $(value def_src_deps)))
482
483
484#
485# Embed XML Schema files to VBoxSVC
486#
487
488VBOX_XML_SCHEMA_H = $(PATH_TARGET)/xml_VirtualBox_settings_xsd.h
489VBOX_XML_SCHEMA_COMMON_H = $(PATH_TARGET)/xml_VirtualBox_settings_common_xsd.h
490VBOX_XML_CONVERTER_TEMPLATE_H = $(PATH_TARGET)/xml_SettingsConverter_xsl.h
491
492VBOX_XML_SCHEMA_COMMON = xml/VirtualBox-settings-common.xsd
493VBOX_XML_SCHEMA.darwin = xml/VirtualBox-settings-macosx.xsd
494VBOX_XML_SCHEMA.linux = xml/VirtualBox-settings-linux.xsd
495VBOX_XML_SCHEMA.freebsd = xml/VirtualBox-settings-freebsd.xsd
496VBOX_XML_SCHEMA.win = xml/VirtualBox-settings-windows.xsd
497VBOX_XML_SCHEMA.os2 = xml/VirtualBox-settings-os2.xsd
498VBOX_XML_SCHEMA.solaris = xml/VirtualBox-settings-solaris.xsd
499
500VBOX_XML_CONVERTER_TEMPLATE = xml/SettingsConverter.xsl
501
502VirtualBoxImplExtra.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.$(BUILD_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
517OTHER_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#
524VBOX_XML_SCHEMADEFS_H = $(PATH_TARGET)/SchemaDefs.h
525VBOX_XML_SCHEMADEFS_CPP = $(PATH_TARGET)/SchemaDefs.cpp
526VBOX_XML_SCHEMADEFS_XSL = xml/SchemaDefs.xsl
527
528VBoxC_DEPS += $(VBOX_XML_SCHEMADEFS_H)
529VBoxC_INCS += $(PATH_TARGET)
530
531VBoxSVC_DEPS += $(VBOX_XML_SCHEMADEFS_H)
532VBoxSVC_INCS += $(PATH_TARGET)
533VBoxSVC_SOURCES += $(VBOX_XML_SCHEMADEFS_CPP)
534
535$(VBOX_XML_SCHEMADEFS_H): $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA.$(BUILD_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.$(BUILD_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
543OTHER_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
552xpcom-components_INST = $(INST_BIN)components/
553ifeq ($(BUILD_TARGET),linux)
554xpcom-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)
560endif
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#
571ifeq ($(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
576endif
577
578# generate rules
579include $(PATH_KBUILD)/subfooter.kmk
580
581
582#
583# Additions rules.
584#
585
586XIDLFILE = idl/VirtualBox.xidl
587
588ifneq ($(BUILD_TARGET),win)
589
590linux/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
605else
606
607MAIN_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)
612IDL_DEFS = /nologo
613ifdef VBOX_WITH_VRDP
614 IDL_DEFS += /D VBOX_VRDP
615endif
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: win32/VirtualBox_rgs.xsl $(XIDLFILE)
623 $(VBOX_XSLTPROC) --stringparam Module VBoxSVC -o $@ $^
624
625$(PATH_TARGET)/VBoxC.rgs: win32/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
651endif
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#
661VBoxSVC_HEADERS = \
662 include/collection.h \
663 include/MachineImpl.h \
664 include/HostDVDDriveImpl.h \
665 include/HostFloppyDriveImpl.h
666
667VBoxC_HEADERS = \
668 include/ConsoleImpl.h
669
670VBoxSVC_TRANSLATIONS = \
671 nls/VBoxSVC_de.ts
672
673VBoxC_TRANSLATIONS = \
674 nls/VBoxC_de.ts
675
676updatenls:
677 $(VBOX_LUPDATE) $(VBoxSVC_SOURCES) $(VBoxSVC_HEADERS) -ts $(VBoxSVC_TRANSLATIONS)
678 $(VBOX_LUPDATE) $(VBoxC_SOURCES) $(VBoxC_HEADERS) -ts $(VBoxC_TRANSLATIONS)
679
680ifdef VBOX_WITH_XPCOM
681
682testidl: $(IDLFILE) $(IDLTYPELIB)
683testidlhdr: $(IDLHEADER)
684
685else
686
687testidl: $(IDLFILE) $(PATH_VBoxCOM)/VirtualBox_i.c
688
689endif
690
691testschemadefs: $(VBOX_XML_SCHEMADEFS_H) $(VBOX_XML_SCHEMADEFS_CPP)
692
693$(PATH_BIN)/comregister.cmd: win32/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
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