VirtualBox

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

Last change on this file since 5419 was 5382, checked in by vboxsync, 17 years ago

AHCI: add missing defines in Makefile

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