VirtualBox

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

Last change on this file since 3481 was 2981, checked in by vboxsync, 17 years ago

InnoTek -> innotek: all the headers and comments.

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