VirtualBox

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

Last change on this file since 6792 was 6778, checked in by vboxsync, 17 years ago

VBOX_WITH_WEBSERVICES got lost when resolving a conflict the other day, put it back.

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