VirtualBox

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

Last change on this file since 4849 was 4642, checked in by vboxsync, 17 years ago

Compilable TAP driver for OS/2.

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