VirtualBox

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

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

touch tinderbox

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 12.5 KB
Line 
1# $Id: Makefile.kmk 4406 2007-08-28 18:10:01Z 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
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 $(PATH_LIB)/USBLib$(VBOX_SUFF_LIB)
113VBoxDD_LIBS.darwin += \
114 $(LIB_REM)
115VBoxDD_LDFLAGS.darwin = -install_name @executable_path/VBoxDD.dylib \
116 -framework CoreAudio \
117 -framework IOKit \
118 -framework Carbon \
119 -framework DiskArbitration
120VBoxDD_LDFLAGS.linux = -Wl,--no-undefined
121VBoxDD_LDFLAGS.l4 = -Wl,--no-undefined
122
123
124# damn, fix this.
125ifeq ($(BUILD_TARGET),win)
126$(PATH_LIB)/VBoxDD2.lib: $(PATH_BIN)/VBoxDD2.dll
127$(PATH_LIB)/VBoxDDU.lib: $(PATH_BIN)/VBoxDDU.dll
128endif
129
130
131#
132# VBoxDD2 (shared object)
133#
134VBoxDD2_TEMPLATE = VBOXR3
135VBoxDD2_DEFS = IN_VBOXDD2
136VBoxDD2_INCS := \
137 $(PATH_SUB_CURRENT)
138VBoxDD2_SOURCES = \
139 Builtins2.cpp \
140 PC/DevAPIC.cpp
141VBoxDD2_LIBS = \
142 $(PATH_LIB)/PcBiosBin$(VBOX_SUFF_LIB) \
143 $(PATH_LIB)/VgaBiosBin$(VBOX_SUFF_LIB) \
144 $(PATH_LIB)/NetBiosBin$(VBOX_SUFF_LIB) \
145 $(LIB_VMM) \
146 $(LIB_RUNTIME)
147ifeq ($(BUILD_TARGET),l4)
148VBoxDD2_LIBS += \
149 $(L4_LIBDIR)/libl4sys.p.a
150endif
151VBoxDD2_LIBS.darwin += $(LIB_REM)
152VBoxDD2_LDFLAGS.darwin = -install_name @executable_path/VBoxDD2.dylib
153VBoxDD2_LDFLAGS.linux = -Wl,--no-undefined
154VBoxDD2_LDFLAGS.l4 = -Wl,--no-undefined
155
156
157#
158# DevicesR3 (library)
159#
160DevicesR3_TEMPLATE = VBOXR3
161DevicesR3_SDKS.win = WINPSDK W2K3DDK
162DevicesR3_INCS := \
163 $(PATH_SUB_CURRENT)
164DevicesR3_SOURCES = \
165 Input/DevPS2.cpp \
166 Bus/DevPCI.cpp \
167 Graphics/DevVGA.cpp \
168 Storage/DevATA.cpp \
169 PC/DevPit-i8254.cpp \
170 PC/DevPIC.cpp \
171 PC/DevACPI.cpp \
172 PC/DevRTC.cpp \
173 PC/DevPcBios.cpp \
174 PC/DevPcArch.c \
175 VMMDev/VBoxDev.cpp \
176 VMMDev/VMMDevHGCM.cpp \
177 Network/DevPCNet.cpp \
178 Audio/DevIchAc97.cpp \
179 PC/DevDMA.cpp \
180 Storage/fdc.c \
181 Serial/DevSerial.cpp \
182 Parallel/DevParallel.cpp
183
184ifdef VBOX_WITH_USB
185DevicesR3_DEFS += VBOX_WITH_USB IN_USB_R3
186DevicesR3_SOURCES += \
187 USB/DevOHCI.cpp
188endif
189
190DevicesR3_DEFS += VBOX_HGCM
191DevicesR3_DEFS.linux += _GNU_SOURCE
192DevicesR3_DEFS.l4 += _GNU_SOURCE
193
194# DevACPI.cpp needs vboxaml.hex which we generate from PC/vbox.dsl.
195DevicesR3_CLEAN += $(PATH_TARGET)/vboxaml.hex $(PATH_TARGET)/vboxaml.aml
196PC/DevACPI.cpp_DEPS = $(PATH_TARGET)/vboxaml.hex
197PC/DevACPI.cpp_INCS = $(PATH_TARGET)
198
199$(PATH_TARGET)/vboxaml.hex: PC/vbox.dsl
200 $(call MSG_TOOL,iasl,DevicesR3,$<,$@)
201 $(QUIET)$(VBOX_IASLCMD) -tc -vs -p $@ $<
202
203# For finding PCIInternal.h from VBox/pci.h.
204Bus/DevPCI.cpp_INCS = Bus
205
206
207
208#
209# VBoxDDGC (sysmod)
210#
211VBoxDDGC_TEMPLATE = VBOXGC
212VBoxDDGC_DEFS =
213VBoxDDGC_SYSSUFF = .gc
214VBoxDDGC_INCS := \
215 $(PATH_SUB_CURRENT)
216VBoxDDGC_SOURCES = \
217 Bus/DevPCI.cpp \
218 Graphics/DevVGA.cpp \
219 Input/DevPS2.cpp \
220 PC/DevACPI.cpp \
221 PC/DevPit-i8254.cpp \
222 PC/DevPIC.cpp \
223 PC/DevRTC.cpp \
224 Storage/DevATA.cpp \
225 Network/DevPCNet.cpp \
226 Serial/DevSerial.cpp \
227 Parallel/DevParallel.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 Parallel/DevParallel.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 Parallel/DrvHostParallel.cpp \
431 Serial/DrvHostSerial.cpp
432
433ifeq ($(BUILD_TARGET),os2)
434Drivers_SOURCES := $(filter-out \
435 Storage/DrvHost% \
436 , $(Drivers_SOURCES))
437Drivers_SOURCES.os2 =
438endif
439
440ifeq ($(BUILD_TARGET),solaris)
441Drivers_SOURCES := $(filter-out \
442 Storage/DrvHost% \
443 , $(Drivers_SOURCES))
444Drivers_SOURCES.os2 =
445endif
446
447Drivers_SOURCES.win = \
448 Network/DrvTAPWin32.cpp \
449 Audio/dsoundaudio.c \
450 Serial/DrvHostSerial.cpp
451
452
453# -- features --
454
455ifdef VBOX_WITH_ISCSI
456 Drivers_SOURCES += \
457 Storage/DrvISCSI.cpp \
458 Storage/DrvISCSITransportTCP.cpp
459 Drivers_DEFS += VBOX_WITH_ISCSI
460endif # VBOX_WITH_ISCSI
461
462ifdef VBOX_WITH_ALSA
463 Drivers_DEFS.linux += VBOX_WITH_ALSA
464 Drivers_SOURCES.linux+= \
465 Audio/alsaaudio.c
466 VBoxDD_LIBS.linux += asound
467endif
468
469ifdef VBOX_WITH_USB
470 Drivers_DEFS += VBOX_WITH_USB IN_USB_R3
471 Drivers_SOURCES += \
472 USB/DrvVUSBRootHub.cpp \
473 USB/VUSBDevice.cpp \
474 USB/VUSBUrb.cpp
475 ifdef VBOX_WITH_VRDP
476 Drivers_DEFS += VBOX_VRDP
477 Drivers_SOURCES += \
478 USB/vrdp/USBProxyDevice-vrdp.cpp
479 endif
480
481 Drivers_DEFS.darwin += VUSB_HAVE_USBPROXY_DEVICE
482 Drivers_DEFS.darwin += VBOX_WITH_USBFILTER
483 Drivers_SOURCES.darwin += \
484 USB/USBProxyDevice.cpp \
485 USB/darwin/USBProxyDevice-darwin.cpp
486
487 Drivers_DEFS.linux += VUSB_HAVE_USBPROXY_DEVICE
488 ifdef VBOX_WITHOUT_LINUX_COMPILER_H
489 Drivers_DEFS.linux += VBOX_WITHOUT_LINUX_COMPILER_H
490 endif
491 Drivers_SOURCES.linux+= \
492 USB/USBProxyDevice.cpp \
493 USB/linux/USBProxyDevice-linux.cpp
494
495 Drivers_DEFS.l4 += VUSB_HAVE_USBPROXY_DEVICE
496 Drivers_SOURCES.l4 += \
497 USB/USBProxyDevice.cpp \
498 USB/linux/USBProxyDevice-linux.cpp
499
500 Drivers_DEFS.win += VUSB_HAVE_USBPROXY_DEVICE
501 Drivers_SOURCES.win += \
502 USB/USBProxyDevice.cpp \
503 USB/win32/USBProxyDevice-win32.cpp
504endif # VBOX_WITH_USB
505
506
507
508#
509# Ring-0 Services (library, linked into VMMR0.r0)
510#
511ServicesR0_TEMPLATE = VBOXR0
512ServicesR0_DEFS = IN_INTNET_R0 IN_RT_R0
513ServicesR0_SOURCES = \
514 Network/SrvIntNetR0.cpp
515
516#
517# Internal Networking - Ring-3 Testcase for the Ring-0 code (a bit hackish).
518#
519ifdef VBOX_WITH_TESTCASES
520 PROGRAMS += tstIntNetR0
521 tstIntNetR0_TEMPLATE = VBOXR3TSTEXE
522 tstIntNetR0_DEFS = IN_INTNET_R0
523 tstIntNetR0_SOURCES = \
524 Network/testcase/tstIntNetR0.cpp
525 tstIntNetR0_LIBS = \
526 $(LIB_RUNTIME)
527endif
528
529
530include $(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