VirtualBox

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

Last change on this file since 2935 was 2784, checked in by vboxsync, 18 years ago

Converted to sub-makefiles.

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