VirtualBox

source: vbox/trunk/src/VBox/Devices/Makefile@ 1982

Last change on this file since 1982 was 1965, checked in by vboxsync, 18 years ago

HostDVD support for Darwin.

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