VirtualBox

source: vbox/trunk/src/VBox/Devices/Makefile.kmk@ 3845

Last change on this file since 3845 was 3765, checked in by vboxsync, 18 years ago

darwin usb stuff.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 12.5 KB
Line 
1# $Id: Makefile.kmk 3765 2007-07-22 13:19:20Z vboxsync $
2## @file
3# Top-level makefile for the devices, drivers and services.
4#
5
6#
7# Copyright (C) 2006-2007 innotek GmbH
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 as published by the Free Software Foundation,
13# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
14# distribution. VirtualBox OSE is distributed in the hope that it will
15# be useful, but WITHOUT ANY WARRANTY of any kind.
16#
17# If you received this file as part of a commercial VirtualBox
18# distribution, then only the terms of your commercial VirtualBox
19# license agreement apply instead of the previous paragraph.
20#
21
22DEPTH = ../../..
23include $(PATH_KBUILD)/subheader.kmk
24
25# Include sub-makefiles.
26include $(PATH_SUB_CURRENT)/PC/BIOS/Makefile.kmk
27include $(PATH_SUB_CURRENT)/Graphics/BIOS/Makefile.kmk
28include $(PATH_SUB_CURRENT)/testcase/Makefile.kmk
29include $(PATH_SUB_CURRENT)/Storage/testcase/Makefile.kmk
30
31# Subdirs with complex makefiles.
32SUBDIRS_LIBRARIES = PC/Etherboot-src
33SUBDIRS_CLEAN = PC/Etherboot-src
34
35#
36# Main targets.
37#
38LIBRARIES += DevicesR3 Drivers ServicesR0
39DLLS += VBoxDDU VBoxDD VBoxDD2
40SYSMODS += VBoxDDGC VBoxDD2GC VBoxDDR0 VBoxDD2R0
41
42
43##
44## Enable the pdm lock (experimental).
45##
46#DEFS += VBOX_WITH_PDM_LOCK
47
48
49#
50# VBoxDDU (shared object)
51#
52VBoxDDU_TEMPLATE = VBOXR3
53VBoxDDU_DEFS = IN_VBOXDDU
54ifdef VBOX_WITH_USB
55 VBoxDDU_DEFS.win = VBOX_WITH_USB
56 VBoxDDU_SDKS.win = WINPSDK W2K3DDK
57 VBoxDDU_SOURCES.win = \
58 USB/win32/USBLib-win32.cpp
59else
60 VBoxDDU_SDKS.win = WINPSDK
61endif
62VBoxDDU_SOURCES = \
63 Storage/VBoxHDD-new.cpp \
64 Storage/VDICore.cpp \
65 Storage/VmdkHDDCore.cpp
66VBoxDDU_LIBS = \
67 $(LIB_RUNTIME)
68ifeq ($(BUILD_TARGET),l4)
69 VBoxDDU_LIBS += \
70 $(L4_LIBDIR)/libl4sys.p.a
71endif
72VBoxDDU_LDFLAGS.darwin = -install_name @executable_path/VBoxDDU.dylib
73VBoxDDU_LDFLAGS.linux = -Wl,--no-undefined
74VBoxDDU_LDFLAGS.l4 = -Wl,--no-undefined
75
76
77#
78# VBoxDD (shared object)
79#
80VBoxDD_TEMPLATE = VBOXR3
81VBoxDD_SDKS.win = WINPSDK DXSDK W2K3DDK VBOX_NTDLL
82VBoxDD_SOURCES = \
83 Builtins.cpp
84VBoxDD_DEFS = VBOX_ACPI
85ifdef VBOX_WITH_USB
86 VBoxDD_DEFS += VBOX_WITH_USB IN_USB_R3
87endif
88ifdef VBOX_WITH_ISCSI
89 VBoxDD_DEFS += VBOX_WITH_ISCSI
90endif
91VBoxDD_LIBS = \
92 $(PATH_LIB)/DevicesR3$(VBOX_SUFF_LIB) \
93 $(PATH_LIB)/Drivers$(VBOX_SUFF_LIB) \
94 $(PATH_LIB)/PcDefBiosLogo$(VBOX_SUFF_LIB) \
95 $(LIB_VMM) \
96 $(LIB_RUNTIME)
97ifeq ($(BUILD_TARGET),win)
98 VBoxDD_LIBS += \
99 $(PATH_LIB)/VBoxDDU.lib \
100 $(PATH_LIB)/VBoxDD2.lib \
101 $(PATH_SDK_DXSDK_LIB)/dxguid.lib
102else
103 VBoxDD_LIBS += \
104 $(INSTARGET_VBoxDDU) \
105 $(INSTARGET_VBoxDD2)
106endif
107ifeq ($(BUILD_TARGET),l4)
108 VBoxDD_LIBS += \
109 $(L4_LIBDIR)/libl4sys.p.a
110endif
111VBoxDD_LIBS.darwin = \
112 $(PATH_LIB)/USBLib$(VBOX_SUFF_LIB)
113VBoxDD_LIBS.darwin += \
114 $(LIB_REM)
115VBoxDD_LDFLAGS.darwin = -install_name @executable_path/VBoxDD.dylib \
116 -framework CoreAudio \
117 -framework IOKit \
118 -framework Carbon \
119 -framework DiskArbitration
120VBoxDD_LDFLAGS.linux = -Wl,--no-undefined
121VBoxDD_LDFLAGS.l4 = -Wl,--no-undefined
122
123
124# damn, fix this.
125ifeq ($(BUILD_TARGET),win)
126$(PATH_LIB)/VBoxDD2.lib: $(PATH_BIN)/VBoxDD2.dll
127$(PATH_LIB)/VBoxDDU.lib: $(PATH_BIN)/VBoxDDU.dll
128endif
129
130
131#
132# VBoxDD2 (shared object)
133#
134VBoxDD2_TEMPLATE = VBOXR3
135VBoxDD2_DEFS = IN_VBOXDD2
136VBoxDD2_INCS := \
137 $(PATH_SUB_CURRENT)
138VBoxDD2_SOURCES = \
139 Builtins2.cpp \
140 PC/DevAPIC.cpp
141VBoxDD2_LIBS = \
142 $(PATH_LIB)/PcBiosBin$(VBOX_SUFF_LIB) \
143 $(PATH_LIB)/VgaBiosBin$(VBOX_SUFF_LIB) \
144 $(PATH_LIB)/NetBiosBin$(VBOX_SUFF_LIB) \
145 $(LIB_VMM) \
146 $(LIB_RUNTIME)
147ifeq ($(BUILD_TARGET),l4)
148VBoxDD2_LIBS += \
149 $(L4_LIBDIR)/libl4sys.p.a
150endif
151VBoxDD2_LIBS.darwin += $(LIB_REM)
152VBoxDD2_LDFLAGS.darwin = -install_name @executable_path/VBoxDD2.dylib
153VBoxDD2_LDFLAGS.linux = -Wl,--no-undefined
154VBoxDD2_LDFLAGS.l4 = -Wl,--no-undefined
155
156
157#
158# DevicesR3 (library)
159#
160DevicesR3_TEMPLATE = VBOXR3
161DevicesR3_SDKS.win = WINPSDK W2K3DDK
162DevicesR3_INCS := \
163 $(PATH_SUB_CURRENT)
164DevicesR3_SOURCES = \
165 Input/DevPS2.cpp \
166 Bus/DevPCI.cpp \
167 Graphics/DevVGA.cpp \
168 Storage/DevATA.cpp \
169 PC/DevPit-i8254.cpp \
170 PC/DevPIC.cpp \
171 PC/DevACPI.cpp \
172 PC/DevRTC.cpp \
173 PC/DevPcBios.cpp \
174 PC/DevPcArch.c \
175 VMMDev/VBoxDev.cpp \
176 VMMDev/VMMDevHGCM.cpp \
177 Network/DevPCNet.cpp \
178 Audio/DevIchAc97.cpp \
179 PC/DevDMA.cpp \
180 Storage/fdc.c \
181 Serial/DevSerial.cpp \
182 Parallel/DevParallel.cpp
183
184ifeq (0,1)
185DevicesR3_SOURCES += \
186 Network/ne2000.c
187endif
188
189ifdef VBOX_WITH_USB
190DevicesR3_DEFS += VBOX_WITH_USB IN_USB_R3
191DevicesR3_SOURCES += \
192 USB/DevOHCI.cpp
193endif
194
195DevicesR3_DEFS += VBOX_HGCM
196DevicesR3_DEFS.linux += _GNU_SOURCE
197DevicesR3_DEFS.l4 += _GNU_SOURCE
198
199# DevACPI.cpp needs vboxaml.hex which we generate from PC/vbox.dsl.
200DevicesR3_CLEAN += $(PATH_TARGET)/vboxaml.hex $(PATH_TARGET)/vboxaml.aml
201PC/DevACPI.cpp_DEPS = $(PATH_TARGET)/vboxaml.hex
202PC/DevACPI.cpp_INCS = $(PATH_TARGET)
203
204$(PATH_TARGET)/vboxaml.hex: PC/vbox.dsl
205 $(call MSG_TOOL,iasl,DevicesR3,$<,$@)
206 $(QUIET)$(VBOX_IASLCMD) -tc -vs -p $@ $<
207
208# For finding PCIInternal.h from VBox/pci.h.
209Bus/DevPCI.cpp_INCS = Bus
210
211
212
213#
214# VBoxDDGC (sysmod)
215#
216VBoxDDGC_TEMPLATE = VBOXGC
217VBoxDDGC_DEFS =
218VBoxDDGC_SYSSUFF = .gc
219VBoxDDGC_INCS := \
220 $(PATH_SUB_CURRENT)
221VBoxDDGC_SOURCES = \
222 Bus/DevPCI.cpp \
223 Graphics/DevVGA.cpp \
224 Input/DevPS2.cpp \
225 PC/DevACPI.cpp \
226 PC/DevPit-i8254.cpp \
227 PC/DevPIC.cpp \
228 PC/DevRTC.cpp \
229 Storage/DevATA.cpp \
230 Network/DevPCNet.cpp \
231 Serial/DevSerial.cpp \
232 Parallel/DevParallel.cpp
233
234ifdef VBOX_WITH_USB
235VBoxDDGC_DEFS += VBOX_WITH_USB IN_USB_GC
236VBoxDDGC_SOURCES += \
237 USB/DevOHCI.cpp
238endif
239
240ifeq ($(VBOX_LDR_FMT32),pe)
241VBoxDDGC_LDFLAGS = -Entry:vgaMMIOWrite
242endif
243ifneq ($(filter pe lx,$(VBOX_LDR_FMT32)),)
244VBoxDDGC_LIBS = \
245 $(PATH_LIB)/VMMGCBuiltin$(VBOX_SUFF_LIB) \
246 $(PATH_LIB)/VMMGCImp$(VBOX_SUFF_LIB)
247endif
248
249
250#
251# VBoxDDR0 (sysmod)
252#
253VBoxDDR0_TEMPLATE = VBOXR0
254VBoxDDR0_SYSSUFF = .r0
255VBoxDDR0_DEFS = IN_RT_R0
256VBoxDDR0_INCS := \
257 $(PATH_SUB_CURRENT)
258VBoxDDR0_SOURCES = \
259 Bus/DevPCI.cpp \
260 Graphics/DevVGA.cpp \
261 Input/DevPS2.cpp \
262 PC/DevACPI.cpp \
263 PC/DevPit-i8254.cpp \
264 PC/DevPIC.cpp \
265 PC/DevRTC.cpp \
266 Storage/DevATA.cpp \
267 Network/DevPCNet.cpp \
268 Serial/DevSerial.cpp \
269 Parallel/DevParallel.cpp
270
271ifdef VBOX_WITH_USB
272VBoxDDR0_DEFS += VBOX_WITH_USB IN_USB_R0
273VBoxDDR0_SOURCES += \
274 USB/DevOHCI.cpp
275endif
276
277ifeq ($(VBOX_LDR_FMT32),pe)
278VBoxDDR0_LDFLAGS = -Entry:vgaMMIOWrite
279endif
280ifneq ($(filter pe lx,$(VBOX_LDR_FMT32)),)
281VBoxDDR0_LIBS = $(PATH_LIB)/VMMR0Imp$(VBOX_SUFF_LIB)
282endif
283VBoxDDR0_LIBS += $(PATH_LIB)/RuntimeR0$(VBOX_SUFF_LIB)
284ifeq ($(VBOX_LDR_FMT32),elf) # this is template stuff!
285VBoxDDR0_LIBS += $(VBOX_GCC_LIBGCC)
286endif
287
288
289#
290# VBoxDD2GC (LGPL sysmod)
291#
292VBoxDD2GC_TEMPLATE = VBOXGC
293VBoxDD2GC_DEFS =
294VBoxDD2GC_SYSSUFF = .gc
295VBoxDD2GC_INCS := \
296 $(PATH_SUB_CURRENT)
297VBoxDD2GC_SOURCES = \
298 PC/DevAPIC.cpp
299ifeq ($(VBOX_LDR_FMT32),pe)
300VBoxDD2GC_LDFLAGS = -Entry:apicMMIOWrite
301endif
302ifneq ($(filter pe lx,$(VBOX_LDR_FMT32)),)
303VBoxDD2GC_LIBS = \
304 $(PATH_LIB)/VMMGCBuiltin$(VBOX_SUFF_LIB) \
305 $(PATH_LIB)/VMMGCImp$(VBOX_SUFF_LIB)
306endif
307
308
309#
310# VBoxDD2R0 (LGPL sysmod)
311#
312VBoxDD2R0_TEMPLATE = VBOXR0
313VBoxDD2R0_DEFS = IN_RT_R0
314VBoxDD2R0_SYSSUFF = .r0
315VBoxDD2R0_INCS := \
316 $(PATH_SUB_CURRENT)
317VBoxDD2R0_SOURCES = \
318 PC/DevAPIC.cpp
319ifeq ($(VBOX_LDR_FMT),pe)
320VBoxDD2R0_LDFLAGS = -Entry:apicMMIOWrite
321endif
322ifneq ($(filter pe lx,$(VBOX_LDR_FMT)),)
323VBoxDD2R0_LIBS = $(PATH_LIB)/VMMR0Imp$(VBOX_SUFF_LIB)
324endif
325VBoxDD2R0_LIBS += $(PATH_LIB)/RuntimeR0$(VBOX_SUFF_LIB)
326ifeq ($(VBOX_LDR_FMT),elf)
327VBoxDD2R0_LIBS += $(VBOX_GCC_LIBGCC)
328endif
329
330
331#
332# Drivers (library)
333#
334ifeq ($(BUILD_TARGET),l4) # We are using real Linux headers, not the cleaned up user space ones
335Drivers_TEMPLATE = VBOXR3NP
336else
337Drivers_TEMPLATE = VBOXR3
338endif
339Drivers_SDKS.win = WINPSDK W2K3DDK
340Storage/DrvHostDVD.cpp_SDKS.win = W2K3DDK
341Drivers_DEFS = IN_IDE_R3
342Drivers_DEFS.win.x86 += _WIN32_WINNT=0x0500
343Drivers_DEFS.win.amd64 += _WIN32_WINNT=0x0510
344Drivers_INCS := \
345 $(PATH_SUB_CURRENT) \
346 Network/slirp
347Drivers_SOURCES = \
348 Audio/audio.c \
349 Audio/audiosniffer.c \
350 Audio/mixeng.c \
351 Audio/noaudio.c \
352 Input/DrvKeyboardQueue.cpp \
353 Input/DrvMouseQueue.cpp \
354 Network/DrvIntNet.cpp \
355 Network/DrvNAT.cpp \
356 Network/DrvNetSniffer.cpp \
357 Network/slirp/bootp.c \
358 Network/slirp/cksum.c \
359 Network/slirp/debug.c \
360 Network/slirp/if.c \
361 Network/slirp/ip_icmp.c \
362 Network/slirp/ip_input.c \
363 Network/slirp/ip_output.c \
364 Network/slirp/mbuf.c \
365 Network/slirp/misc.c \
366 Network/slirp/sbuf.c \
367 Network/slirp/slirp.c \
368 Network/slirp/socket.c \
369 Network/slirp/tcp_input.c \
370 Network/slirp/tcp_output.c \
371 Network/slirp/tcp_subr.c \
372 Network/slirp/tcp_timer.c \
373 Network/slirp/tftp.c \
374 Network/slirp/udp.c \
375 PC/DrvACPI.cpp \
376 Serial/DrvChar.cpp \
377 Serial/DrvNamedPipe.cpp \
378 Storage/DrvBlock.cpp \
379 Storage/DrvHostBase.cpp \
380 Storage/DrvHostDVD.cpp \
381 Storage/DrvHostFloppy.cpp \
382 Storage/DrvHostRawDisk.cpp \
383 Storage/DrvMediaISO.cpp \
384 Storage/DrvRawImage.cpp \
385 Storage/DrvVD.cpp \
386 Storage/DrvVmdk.cpp \
387 Storage/VBoxHDD.cpp
388
389# -- OS specific --
390
391ifeq ($(BUILD_TARGET),darwin)
392Drivers_SOURCES := $(filter-out \
393 Storage/DrvHostRaw% \
394 Storage/DrvHostFloppy% \
395 , $(Drivers_SOURCES)) \
396 Audio/coreaudio.c
397Drivers_SOURCES.darwin =
398endif # darwin
399
400ifeq ($(BUILD_TARGET),freebsd)
401Drivers_SOURCES := $(filter-out \
402 Storage/DrvHost% \
403 , $(Drivers_SOURCES))
404Drivers_SOURCES.freebsd =
405endif # freebsd
406
407
408ifeq ($(BUILD_TARGET),l4)
409Drivers_SOURCES = \
410 Input/DrvMouseQueue.cpp \
411 Input/DrvKeyboardQueue.cpp \
412 Storage/VBoxHDD.cpp \
413 Storage/DrvBlock.cpp \
414 Storage/DrvMediaISO.cpp \
415 Storage/DrvRawImage.cpp \
416 Storage/DrvHostBase.cpp \
417 Storage/DrvHostDVD.cpp \
418 Storage/DrvVD.cpp \
419 PC/DrvACPI.cpp \
420 Network/DrvIntNet.cpp \
421 Network/DrvNetSniffer.cpp \
422 Audio/audio.c \
423 Audio/mixeng.c \
424 Audio/noaudio.c \
425 Audio/audiosniffer.c
426
427Drivers_SOURCES.l4 = \
428 Network/DrvTAP.cpp \
429 Audio/ossaudio.c
430endif # l4
431
432Drivers_SOURCES.linux = \
433 Network/DrvTAP.cpp \
434 Audio/ossaudio.c \
435 Parallel/DrvHostParallel.cpp
436
437ifeq ($(BUILD_TARGET),os2)
438Drivers_SOURCES := $(filter-out \
439 Storage/DrvHost% \
440 , $(Drivers_SOURCES))
441Drivers_SOURCES.os2 =
442endif
443
444Drivers_SOURCES.win = \
445 Network/DrvTAPWin32.cpp \
446 Audio/dsoundaudio.c
447
448
449# -- features --
450
451ifdef VBOX_WITH_ISCSI
452 Drivers_SOURCES += \
453 Storage/DrvISCSI.cpp \
454 Storage/DrvISCSITransportTCP.cpp
455 Drivers_DEFS += VBOX_WITH_ISCSI
456endif # VBOX_WITH_ISCSI
457
458ifdef VBOX_WITH_ALSA
459 Drivers_DEFS.linux += VBOX_WITH_ALSA
460 Drivers_SOURCES.linux+= \
461 Audio/alsaaudio.c
462 VBoxDD_LIBS.linux += asound
463endif
464
465ifdef VBOX_WITH_USB
466 Drivers_DEFS += VBOX_WITH_USB IN_USB_R3
467 Drivers_SOURCES += \
468 USB/DrvVUSBRootHub.cpp \
469 USB/VUSBDevice.cpp \
470 USB/VUSBUrb.cpp
471 ifdef VBOX_WITH_VRDP
472 Drivers_DEFS += VBOX_VRDP
473 Drivers_SOURCES += \
474 USB/vrdp/USBProxyDevice-vrdp.cpp
475 endif
476
477 Drivers_DEFS.darwin += VUSB_HAVE_USBPROXY_DEVICE
478 Drivers_DEFS.darwin += VBOX_WITH_USBFILTER
479 Drivers_SOURCES.darwin += \
480 USB/USBProxyDevice.cpp \
481 USB/darwin/USBProxyDevice-darwin.cpp
482
483 Drivers_DEFS.linux += VUSB_HAVE_USBPROXY_DEVICE
484 ifdef VBOX_WITHOUT_LINUX_COMPILER_H
485 Drivers_DEFS.linux += VBOX_WITHOUT_LINUX_COMPILER_H
486 endif
487 Drivers_SOURCES.linux+= \
488 USB/USBProxyDevice.cpp \
489 USB/linux/USBProxyDevice-linux.cpp
490
491 Drivers_DEFS.l4 += VUSB_HAVE_USBPROXY_DEVICE
492 Drivers_SOURCES.l4 += \
493 USB/USBProxyDevice.cpp \
494 USB/linux/USBProxyDevice-linux.cpp
495
496 Drivers_DEFS.win += VUSB_HAVE_USBPROXY_DEVICE
497 Drivers_SOURCES.win += \
498 USB/USBProxyDevice.cpp \
499 USB/win32/USBProxyDevice-win32.cpp
500endif # VBOX_WITH_USB
501
502
503
504#
505# Ring-0 Services (library, linked into VMMR0.r0)
506#
507ServicesR0_TEMPLATE = VBOXR0
508ServicesR0_DEFS = IN_INTNET_R0 IN_RT_R0
509ServicesR0_SOURCES = \
510 Network/SrvIntNetR0.cpp
511
512#
513# Internal Networking - Ring-3 Testcase for the Ring-0 code (a bit hackish).
514#
515ifdef VBOX_WITH_TESTCASES
516 PROGRAMS += tstIntNetR0
517 tstIntNetR0_TEMPLATE = VBOXR3TSTEXE
518 tstIntNetR0_DEFS = IN_INTNET_R0
519 tstIntNetR0_SOURCES = \
520 Network/testcase/tstIntNetR0.cpp
521 tstIntNetR0_LIBS = \
522 $(LIB_RUNTIME)
523endif
524
525
526include $(PATH_KBUILD)/subfooter.kmk
527
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