VirtualBox

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

Last change on this file since 5320 was 5212, checked in by vboxsync, 17 years ago

Solaris.

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