VirtualBox

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

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

New VMDK code.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 11.8 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/VBoxHDD.cpp
385
386# -- OS specific --
387
388ifeq ($(BUILD_TARGET),darwin)
389Drivers_SOURCES := $(filter-out \
390 Storage/DrvHostRaw% \
391 Storage/DrvHostFloppy% \
392 , $(Drivers_SOURCES)) \
393 Audio/coreaudio.c
394Drivers_SOURCES.darwin =
395endif # darwin
396
397ifeq ($(BUILD_TARGET),freebsd)
398Drivers_SOURCES := $(filter-out \
399 Storage/DrvHost% \
400 , $(Drivers_SOURCES))
401Drivers_SOURCES.freebsd =
402endif # freebsd
403
404
405ifeq ($(BUILD_TARGET),l4)
406Drivers_SOURCES = \
407 Input/DrvMouseQueue.cpp \
408 Input/DrvKeyboardQueue.cpp \
409 Storage/VBoxHDD.cpp \
410 Storage/DrvBlock.cpp \
411 Storage/DrvMediaISO.cpp \
412 Storage/DrvRawImage.cpp \
413 Storage/DrvHostBase.cpp \
414 Storage/DrvHostDVD.cpp \
415 Storage/DrvVD.cpp \
416 PC/DrvACPI.cpp \
417 Network/DrvIntNet.cpp \
418 Network/DrvNetSniffer.cpp \
419 Audio/audio.c \
420 Audio/mixeng.c \
421 Audio/noaudio.c \
422 Audio/audiosniffer.c
423
424Drivers_SOURCES.l4 = \
425 Network/DrvTAP.cpp \
426 Audio/ossaudio.c
427endif # l4
428
429Drivers_SOURCES.linux = \
430 Network/DrvTAP.cpp \
431 Audio/ossaudio.c
432
433ifeq ($(BUILD_TARGET),os2)
434Drivers_SOURCES := $(filter-out \
435 Storage/DrvHost% \
436 , $(Drivers_SOURCES))
437Drivers_SOURCES.os2 =
438endif
439
440Drivers_SOURCES.win = \
441 Network/DrvTAPWin32.cpp \
442 Audio/dsoundaudio.c
443
444
445# -- features --
446
447ifdef VBOX_WITH_ISCSI
448 Drivers_SOURCES += \
449 Storage/DrvISCSI.cpp \
450 Storage/DrvISCSITransportTCP.cpp
451 Drivers_DEFS += VBOX_WITH_ISCSI
452endif # VBOX_WITH_ISCSI
453
454ifdef VBOX_WITH_ALSA
455 Drivers_DEFS.linux += VBOX_WITH_ALSA
456 Drivers_SOURCES.linux+= \
457 Audio/alsaaudio.c
458 VBoxDD_LIBS.linux += asound
459endif
460
461ifdef VBOX_WITH_USB
462 Drivers_DEFS += VBOX_WITH_USB IN_USB_R3
463 Drivers_SOURCES += \
464 USB/DrvVUSBRootHub.cpp \
465 USB/VUSBDevice.cpp \
466 USB/VUSBUrb.cpp
467 ifdef VBOX_WITH_VRDP
468 Drivers_SOURCES += \
469 USB/vrdp/USBProxyDevice-vrdp.cpp
470 endif
471
472 Drivers_DEFS.linux += VUSB_HAVE_USBPROXY_DEVICE
473 ifdef VBOX_WITHOUT_LINUX_COMPILER_H
474 Drivers_DEFS.linux += VBOX_WITHOUT_LINUX_COMPILER_H
475 endif
476 Drivers_SOURCES.linux+= \
477 USB/USBProxyDevice.cpp \
478 USB/linux/USBProxyDevice-linux.cpp
479
480 Drivers_DEFS.l4 += VUSB_HAVE_USBPROXY_DEVICE
481 Drivers_SOURCES.l4 += \
482 USB/USBProxyDevice.cpp \
483 USB/linux/USBProxyDevice-linux.cpp
484
485 Drivers_DEFS.win += VUSB_HAVE_USBPROXY_DEVICE
486 Drivers_SOURCES.win += \
487 USB/USBProxyDevice.cpp \
488 USB/win32/USBProxyDevice-win32.cpp
489endif # VBOX_WITH_USB
490
491
492
493#
494# Ring-0 Services (library, linked into VMMR0.r0)
495#
496ServicesR0_TEMPLATE = VBOXR0
497ServicesR0_DEFS = IN_INTNET_R0 IN_RT_R0
498ServicesR0_SOURCES = \
499 Network/SrvIntNetR0.cpp
500
501#
502# Internal Networking - Ring-3 Testcase for the Ring-0 code (a bit hackish).
503#
504tstIntNetR0_TEMPLATE = VBOXR3TSTEXE
505tstIntNetR0_DEFS = IN_INTNET_R0
506tstIntNetR0_SOURCES = \
507 Network/testcase/tstIntNetR0.cpp
508tstIntNetR0_LIBS = \
509 $(LIB_RUNTIME)
510
511
512include $(PATH_KBUILD)/footer.kmk
513
514
515# ACPI DSL generation
516$(PATH_TARGET)/vboxaml.hex: PC/vbox.dsl
517 $(call MSG_L1,iasl $<,=> $@)
518 $(QUIET)$(VBOX_IASLCMD) -tc -vs -p $@ $<
519
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