VirtualBox

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

Last change on this file since 2405 was 2390, checked in by vboxsync, 18 years ago

Resurrect old VMDK code and make it default.

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