VirtualBox

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

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

Missed that one. Linux only driver of course.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 12.4 KB
Line 
1# $Id: Makefile.kmk 3651 2007-07-16 15:53:48Z 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 Parallel/DevParallel.cpp
181
182ifeq (0,1)
183DevicesR3_SOURCES += \
184 Network/ne2000.c
185endif
186
187ifdef VBOX_WITH_USB
188DevicesR3_DEFS += VBOX_WITH_USB IN_USB_R3
189DevicesR3_SOURCES += \
190 USB/DevOHCI.cpp
191endif
192
193DevicesR3_DEFS += VBOX_HGCM
194DevicesR3_DEFS.linux += _GNU_SOURCE
195DevicesR3_DEFS.l4 += _GNU_SOURCE
196
197# DevACPI.cpp needs vboxaml.hex which we generate from PC/vbox.dsl.
198DevicesR3_CLEAN += $(PATH_TARGET)/vboxaml.hex $(PATH_TARGET)/vboxaml.aml
199PC/DevACPI.cpp_DEPS = $(PATH_TARGET)/vboxaml.hex
200PC/DevACPI.cpp_INCS = $(PATH_TARGET)
201
202$(PATH_TARGET)/vboxaml.hex: PC/vbox.dsl
203 $(call MSG_TOOL,iasl,DevicesR3,$<,$@)
204 $(QUIET)$(VBOX_IASLCMD) -tc -vs -p $@ $<
205
206# For finding PCIInternal.h from VBox/pci.h.
207Bus/DevPCI.cpp_INCS = Bus
208
209
210
211#
212# VBoxDDGC (sysmod)
213#
214VBoxDDGC_TEMPLATE = VBOXGC
215VBoxDDGC_DEFS =
216VBoxDDGC_SYSSUFF = .gc
217VBoxDDGC_INCS := \
218 $(PATH_SUB_CURRENT)
219VBoxDDGC_SOURCES = \
220 Bus/DevPCI.cpp \
221 Graphics/DevVGA.cpp \
222 Input/DevPS2.cpp \
223 PC/DevACPI.cpp \
224 PC/DevPit-i8254.cpp \
225 PC/DevPIC.cpp \
226 PC/DevRTC.cpp \
227 Storage/DevATA.cpp \
228 Network/DevPCNet.cpp \
229 Serial/DevSerial.cpp \
230 Parallel/DevParallel.cpp
231
232ifdef VBOX_WITH_USB
233VBoxDDGC_DEFS += VBOX_WITH_USB IN_USB_GC
234VBoxDDGC_SOURCES += \
235 USB/DevOHCI.cpp
236endif
237
238ifeq ($(VBOX_LDR_FMT32),pe)
239VBoxDDGC_LDFLAGS = -Entry:vgaMMIOWrite
240endif
241ifneq ($(filter pe lx,$(VBOX_LDR_FMT32)),)
242VBoxDDGC_LIBS = \
243 $(PATH_LIB)/VMMGCBuiltin$(VBOX_SUFF_LIB) \
244 $(PATH_LIB)/VMMGCImp$(VBOX_SUFF_LIB)
245endif
246
247
248#
249# VBoxDDR0 (sysmod)
250#
251VBoxDDR0_TEMPLATE = VBOXR0
252VBoxDDR0_SYSSUFF = .r0
253VBoxDDR0_DEFS = IN_RT_R0
254VBoxDDR0_INCS := \
255 $(PATH_SUB_CURRENT)
256VBoxDDR0_SOURCES = \
257 Bus/DevPCI.cpp \
258 Graphics/DevVGA.cpp \
259 Input/DevPS2.cpp \
260 PC/DevACPI.cpp \
261 PC/DevPit-i8254.cpp \
262 PC/DevPIC.cpp \
263 PC/DevRTC.cpp \
264 Storage/DevATA.cpp \
265 Network/DevPCNet.cpp \
266 Serial/DevSerial.cpp \
267 Parallel/DevParallel.cpp
268
269ifdef VBOX_WITH_USB
270VBoxDDR0_DEFS += VBOX_WITH_USB IN_USB_R0
271VBoxDDR0_SOURCES += \
272 USB/DevOHCI.cpp
273endif
274
275ifeq ($(VBOX_LDR_FMT32),pe)
276VBoxDDR0_LDFLAGS = -Entry:vgaMMIOWrite
277endif
278ifneq ($(filter pe lx,$(VBOX_LDR_FMT32)),)
279VBoxDDR0_LIBS = $(PATH_LIB)/VMMR0Imp$(VBOX_SUFF_LIB)
280endif
281VBoxDDR0_LIBS += $(PATH_LIB)/RuntimeR0$(VBOX_SUFF_LIB)
282ifeq ($(VBOX_LDR_FMT32),elf) # this is template stuff!
283VBoxDDR0_LIBS += $(VBOX_GCC_LIBGCC)
284endif
285
286
287#
288# VBoxDD2GC (LGPL sysmod)
289#
290VBoxDD2GC_TEMPLATE = VBOXGC
291VBoxDD2GC_DEFS =
292VBoxDD2GC_SYSSUFF = .gc
293VBoxDD2GC_INCS := \
294 $(PATH_SUB_CURRENT)
295VBoxDD2GC_SOURCES = \
296 PC/DevAPIC.cpp
297ifeq ($(VBOX_LDR_FMT32),pe)
298VBoxDD2GC_LDFLAGS = -Entry:apicMMIOWrite
299endif
300ifneq ($(filter pe lx,$(VBOX_LDR_FMT32)),)
301VBoxDD2GC_LIBS = \
302 $(PATH_LIB)/VMMGCBuiltin$(VBOX_SUFF_LIB) \
303 $(PATH_LIB)/VMMGCImp$(VBOX_SUFF_LIB)
304endif
305
306
307#
308# VBoxDD2R0 (LGPL sysmod)
309#
310VBoxDD2R0_TEMPLATE = VBOXR0
311VBoxDD2R0_DEFS = IN_RT_R0
312VBoxDD2R0_SYSSUFF = .r0
313VBoxDD2R0_INCS := \
314 $(PATH_SUB_CURRENT)
315VBoxDD2R0_SOURCES = \
316 PC/DevAPIC.cpp
317ifeq ($(VBOX_LDR_FMT),pe)
318VBoxDD2R0_LDFLAGS = -Entry:apicMMIOWrite
319endif
320ifneq ($(filter pe lx,$(VBOX_LDR_FMT)),)
321VBoxDD2R0_LIBS = $(PATH_LIB)/VMMR0Imp$(VBOX_SUFF_LIB)
322endif
323VBoxDD2R0_LIBS += $(PATH_LIB)/RuntimeR0$(VBOX_SUFF_LIB)
324ifeq ($(VBOX_LDR_FMT),elf)
325VBoxDD2R0_LIBS += $(VBOX_GCC_LIBGCC)
326endif
327
328
329#
330# Drivers (library)
331#
332ifeq ($(BUILD_TARGET),l4) # We are using real Linux headers, not the cleaned up user space ones
333Drivers_TEMPLATE = VBOXR3NP
334else
335Drivers_TEMPLATE = VBOXR3
336endif
337Drivers_SDKS.win = WINPSDK W2K3DDK
338Storage/DrvHostDVD.cpp_SDKS.win = W2K3DDK
339Drivers_DEFS = IN_IDE_R3
340Drivers_DEFS.win.x86 += _WIN32_WINNT=0x0500
341Drivers_DEFS.win.amd64 += _WIN32_WINNT=0x0510
342Drivers_INCS := \
343 $(PATH_SUB_CURRENT) \
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/DrvVmdk.cpp \
385 Storage/VBoxHDD.cpp
386
387# -- OS specific --
388
389ifeq ($(BUILD_TARGET),darwin)
390Drivers_SOURCES := $(filter-out \
391 Storage/DrvHostRaw% \
392 Storage/DrvHostFloppy% \
393 , $(Drivers_SOURCES)) \
394 Audio/coreaudio.c
395Drivers_SOURCES.darwin =
396endif # darwin
397
398ifeq ($(BUILD_TARGET),freebsd)
399Drivers_SOURCES := $(filter-out \
400 Storage/DrvHost% \
401 , $(Drivers_SOURCES))
402Drivers_SOURCES.freebsd =
403endif # freebsd
404
405
406ifeq ($(BUILD_TARGET),l4)
407Drivers_SOURCES = \
408 Input/DrvMouseQueue.cpp \
409 Input/DrvKeyboardQueue.cpp \
410 Storage/VBoxHDD.cpp \
411 Storage/DrvBlock.cpp \
412 Storage/DrvMediaISO.cpp \
413 Storage/DrvRawImage.cpp \
414 Storage/DrvHostBase.cpp \
415 Storage/DrvHostDVD.cpp \
416 Storage/DrvVD.cpp \
417 PC/DrvACPI.cpp \
418 Network/DrvIntNet.cpp \
419 Network/DrvNetSniffer.cpp \
420 Audio/audio.c \
421 Audio/mixeng.c \
422 Audio/noaudio.c \
423 Audio/audiosniffer.c
424
425Drivers_SOURCES.l4 = \
426 Network/DrvTAP.cpp \
427 Audio/ossaudio.c
428endif # l4
429
430Drivers_SOURCES.linux = \
431 Network/DrvTAP.cpp \
432 Audio/ossaudio.c \
433 Parallel/DrvHostParallel.cpp
434
435ifeq ($(BUILD_TARGET),os2)
436Drivers_SOURCES := $(filter-out \
437 Storage/DrvHost% \
438 , $(Drivers_SOURCES))
439Drivers_SOURCES.os2 =
440endif
441
442Drivers_SOURCES.win = \
443 Network/DrvTAPWin32.cpp \
444 Audio/dsoundaudio.c
445
446
447# -- features --
448
449ifdef VBOX_WITH_ISCSI
450 Drivers_SOURCES += \
451 Storage/DrvISCSI.cpp \
452 Storage/DrvISCSITransportTCP.cpp
453 Drivers_DEFS += VBOX_WITH_ISCSI
454endif # VBOX_WITH_ISCSI
455
456ifdef VBOX_WITH_ALSA
457 Drivers_DEFS.linux += VBOX_WITH_ALSA
458 Drivers_SOURCES.linux+= \
459 Audio/alsaaudio.c
460 VBoxDD_LIBS.linux += asound
461endif
462
463ifdef VBOX_WITH_USB
464 Drivers_DEFS += VBOX_WITH_USB IN_USB_R3
465 Drivers_SOURCES += \
466 USB/DrvVUSBRootHub.cpp \
467 USB/VUSBDevice.cpp \
468 USB/VUSBUrb.cpp
469 ifdef VBOX_WITH_VRDP
470 Drivers_DEFS += VBOX_VRDP
471 Drivers_SOURCES += \
472 USB/vrdp/USBProxyDevice-vrdp.cpp
473 endif
474
475 Drivers_DEFS.darwin += VUSB_HAVE_USBPROXY_DEVICE
476 Drivers_SOURCES.darwin += \
477 USB/USBProxyDevice.cpp \
478 USB/darwin/USBProxyDevice-darwin.cpp
479
480 Drivers_DEFS.linux += VUSB_HAVE_USBPROXY_DEVICE
481 ifdef VBOX_WITHOUT_LINUX_COMPILER_H
482 Drivers_DEFS.linux += VBOX_WITHOUT_LINUX_COMPILER_H
483 endif
484 Drivers_SOURCES.linux+= \
485 USB/USBProxyDevice.cpp \
486 USB/linux/USBProxyDevice-linux.cpp
487
488 Drivers_DEFS.l4 += VUSB_HAVE_USBPROXY_DEVICE
489 Drivers_SOURCES.l4 += \
490 USB/USBProxyDevice.cpp \
491 USB/linux/USBProxyDevice-linux.cpp
492
493 Drivers_DEFS.win += VUSB_HAVE_USBPROXY_DEVICE
494 Drivers_SOURCES.win += \
495 USB/USBProxyDevice.cpp \
496 USB/win32/USBProxyDevice-win32.cpp
497endif # VBOX_WITH_USB
498
499
500
501#
502# Ring-0 Services (library, linked into VMMR0.r0)
503#
504ServicesR0_TEMPLATE = VBOXR0
505ServicesR0_DEFS = IN_INTNET_R0 IN_RT_R0
506ServicesR0_SOURCES = \
507 Network/SrvIntNetR0.cpp
508
509#
510# Internal Networking - Ring-3 Testcase for the Ring-0 code (a bit hackish).
511#
512ifdef VBOX_WITH_TESTCASES
513 PROGRAMS += tstIntNetR0
514 tstIntNetR0_TEMPLATE = VBOXR3TSTEXE
515 tstIntNetR0_DEFS = IN_INTNET_R0
516 tstIntNetR0_SOURCES = \
517 Network/testcase/tstIntNetR0.cpp
518 tstIntNetR0_LIBS = \
519 $(LIB_RUNTIME)
520endif
521
522
523include $(PATH_KBUILD)/subfooter.kmk
524
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