VirtualBox

source: vbox/trunk/src/VBox/Devices/Makefile@ 1668

Last change on this file since 1668 was 1569, checked in by vboxsync, 18 years ago

Moved win32 usbLib code to VBoxDDU.dll.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 11.6 KB
Line 
1#
2# Makefile for the devices, drivers and services.
3#
4
5#
6# Copyright (C) 2006 InnoTek Systemberatung GmbH
7#
8# This file is part of VirtualBox Open Source Edition (OSE), as
9# available from http://www.virtualbox.org. This file is free software;
10# you can redistribute it and/or modify it under the terms of the GNU
11# General Public License as published by the Free Software Foundation,
12# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
13# distribution. VirtualBox OSE is distributed in the hope that it will
14# be useful, but WITHOUT ANY WARRANTY of any kind.
15#
16# If you received this file as part of a commercial VirtualBox
17# distribution, then only the terms of your commercial VirtualBox
18# license agreement apply instead of the previous paragraph.
19#
20
21DEPTH = ../../..
22include $(PATH_KBUILD)/header.kmk
23
24ifdef VBOX_WITH_TESTCASES
25 PROGRAMS = tstIntNetR0
26endif
27LIBRARIES = DevicesR3 Drivers ServicesR0
28DLLS = VBoxDDU VBoxDD VBoxDD2
29SYSMODS = VBoxDDGC VBoxDD2GC VBoxDDR0 VBoxDD2R0
30
31OTHER_CLEAN = \
32 $(PATH_TARGET)/vboxaml.hex \
33 $(PATH_TARGET)/vboxaml.aml
34
35SUBDIRS = \
36 testcase \
37 PC/BIOS \
38 PC/Etherboot-src \
39 Graphics/BIOS
40SUBDIRS_AFTER = \
41 Storage/testcase
42
43
44#
45# Check for VBOX_* stuff which governs defines.
46#
47ifdef VBOX_USE_IOAPIC
48 DEFS += USE_IOAPIC
49endif
50ifdef VBOX_WITH_VRDP
51 DEFS += VBOX_VRDP
52endif
53ifdef VBOX_WITH_INTERNAL_NETWORKING
54 DEFS += VBOX_WITH_INTERNAL_NETWORKING
55endif
56
57# enable the pdm lock.
58#DEFS += VBOX_WITH_PDM_LOCK
59
60
61#
62# VBoxDDU (shared object)
63#
64VBoxDDU_TEMPLATE = VBOXR3
65VBoxDDU_DEFS = IN_VBOXDDU
66ifdef VBOX_WITH_USB
67 VBoxDDU_DEFS.win = VBOX_WITH_USB
68 VBoxDDU_SDKS.win = WINPSDK W2K3DDK
69 VBoxDDU_SOURCES.win = \
70 USB/win32/USBLib-win32.cpp
71else
72 VBoxDDU_SDKS.win = WINPSDK
73endif
74VBoxDDU_SOURCES = \
75 Storage/VDICore.cpp
76# Storage/VmdkHDDCore.cpp
77VBoxDDU_LIBS = \
78 $(LIB_RUNTIME)
79ifeq ($(BUILD_TARGET),l4)
80 VBoxDDU_LIBS += \
81 $(L4_LIBDIR)/libl4sys.p.a
82endif
83VBoxDDU_LDFLAGS.darwin = -install_name @executable_path/VBoxDDU.dylib
84VBoxDDU_LDFLAGS.linux = -Wl,--no-undefined
85VBoxDDU_LDFLAGS.l4 = -Wl,--no-undefined
86
87
88#
89# VBoxDD (shared object)
90#
91VBoxDD_TEMPLATE = VBOXR3
92VBoxDD_SDKS.win = WINPSDK DXSDK W2K3DDK VBOX_NTDLL
93VBoxDD_SOURCES = \
94 Builtins.cpp \
95 muldiv64.c
96VBoxDD_DEFS = VBOX_ACPI
97ifdef VBOX_WITH_USB
98 VBoxDD_DEFS += VBOX_WITH_USB IN_USB_R3
99endif
100ifdef VBOX_WITH_ISCSI
101 VBoxDD_DEFS += VBOX_WITH_ISCSI
102endif
103VBoxDD_LIBS = \
104 $(PATH_LIB)/DevicesR3$(VBOX_SUFF_LIB) \
105 $(PATH_LIB)/Drivers$(VBOX_SUFF_LIB) \
106 $(PATH_LIB)/PcDefBiosLogo$(VBOX_SUFF_LIB) \
107 $(LIB_VMM) \
108 $(LIB_RUNTIME)
109ifeq ($(BUILD_TARGET),win)
110 VBoxDD_LIBS += \
111 $(PATH_LIB)/VBoxDDU.lib \
112 $(PATH_LIB)/VBoxDD2.lib \
113 $(PATH_SDK_DXSDK_LIB)/dxguid.lib
114else
115 VBoxDD_LIBS += \
116 $(INSTARGET_VBoxDDU) \
117 $(INSTARGET_VBoxDD2)
118endif
119ifeq ($(BUILD_TARGET),l4)
120 VBoxDD_LIBS += \
121 $(L4_LIBDIR)/libl4sys.p.a
122endif
123VBoxDD_LIBS.darwin = \
124 $(LIB_REM)
125VBoxDD_LDFLAGS.darwin = -install_name @executable_path/VBoxDD.dylib -framework CoreAudio
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_SOURCES = \
143 Builtins2.cpp \
144 PC/apic.c
145VBoxDD2_LIBS = \
146 $(PATH_LIB)/PcBiosBin$(VBOX_SUFF_LIB) \
147 $(PATH_LIB)/VgaBiosBin$(VBOX_SUFF_LIB) \
148 $(PATH_LIB)/NetBiosBin$(VBOX_SUFF_LIB) \
149 $(LIB_VMM) \
150 $(LIB_RUNTIME)
151ifeq ($(BUILD_TARGET),l4)
152VBoxDD2_LIBS += \
153 $(L4_LIBDIR)/libl4sys.p.a
154endif
155VBoxDD2_LIBS.darwin += $(LIB_REM)
156VBoxDD2_LDFLAGS.darwin = -install_name @executable_path/VBoxDD2.dylib
157VBoxDD2_LDFLAGS.linux = -Wl,--no-undefined
158VBoxDD2_LDFLAGS.l4 = -Wl,--no-undefined
159
160
161#
162# DevicesR3 (library)
163#
164DevicesR3_TEMPLATE = VBOXR3
165DevicesR3_SDKS.win = WINPSDK W2K3DDK
166DevicesR3_INCS = \
167 $(PATH_CURRENT)
168DevicesR3_SOURCES = \
169 Input/pckbd.c \
170 Bus/DevPCI.cpp \
171 Graphics/DevVGA.cpp \
172 Storage/DevATA.cpp \
173 PC/DevPit-i8254.cpp \
174 PC/DevPIC.cpp \
175 PC/DevACPI.cpp \
176 PC/DevRTC.cpp \
177 PC/DevPcBios.cpp \
178 PC/DevPcArch.c \
179 VMMDev/VBoxDev.cpp \
180 VMMDev/VMMDevHGCM.cpp \
181 Network/DevPCNet.cpp \
182 Audio/DevIchAc97.cpp \
183 PC/dma.c \
184 Storage/fdc.c \
185 Serial/serial.c
186
187ifeq (0,1)
188DevicesR3_SOURCES += \
189 Network/ne2000.c
190endif
191
192ifdef VBOX_WITH_USB
193DevicesR3_DEFS += VBOX_WITH_USB IN_USB_R3
194DevicesR3_SOURCES += \
195 USB/DevOHCI.cpp
196endif
197
198DevicesR3_DEFS += VBOX_HGCM
199DevicesR3_DEFS.linux += _GNU_SOURCE
200DevicesR3_DEFS.l4 += _GNU_SOURCE
201
202
203# DevACPI.cpp needs vboxaml.hex which we generate from PC/vbox.dsl.
204PC/DevACPI.cpp_DEPS = $(PATH_TARGET)/vboxaml.hex
205PC/DevACPI.cpp_INCS = $(PATH_TARGET)
206Bus/DevPCI.cpp_INCS = Bus
207
208
209#
210# VBoxDDGC (sysmod)
211#
212VBoxDDGC_TEMPLATE = VBOXGC
213VBoxDDGC_DEFS =
214VBoxDDGC_SYSSUFF = .gc
215VBoxDDGC_INCS = \
216 $(PATH_CURRENT)
217VBoxDDGC_SOURCES = \
218 muldiv64.c \
219 Bus/DevPCI.cpp \
220 Graphics/DevVGA.cpp \
221 Input/pckbd.c \
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
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_CURRENT)
253VBoxDDR0_SOURCES = \
254 muldiv64.c \
255 Bus/DevPCI.cpp \
256 Graphics/DevVGA.cpp \
257 Input/pckbd.c \
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
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_CURRENT)
291VBoxDD2GC_SOURCES = \
292 PC/apic.c
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_CURRENT)
311VBoxDD2R0_SOURCES = \
312 PC/apic.c
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 Network/slirp
338Drivers_SOURCES = \
339 Input/DrvMouseQueue.cpp \
340 Input/DrvKeyboardQueue.cpp \
341 Storage/VBoxHDD.cpp \
342 Storage/DrvBlock.cpp \
343 Storage/VmdkHDD.cpp \
344 Storage/DrvMediaISO.cpp \
345 Storage/DrvRawImage.cpp \
346 Storage/DrvHostBase.cpp \
347 Storage/DrvHostDVD.cpp \
348 Storage/DrvHostFloppy.cpp \
349 PC/DrvACPI.cpp \
350 Network/DrvIntNet.cpp \
351 Network/DrvNetSniffer.cpp \
352 Network/DrvNAT.cpp \
353 Network/slirp/cksum.c \
354 Network/slirp/if.c \
355 Network/slirp/ip_icmp.c \
356 Network/slirp/ip_input.c \
357 Network/slirp/ip_output.c \
358 Network/slirp/slirp.c \
359 Network/slirp/mbuf.c \
360 Network/slirp/misc.c \
361 Network/slirp/sbuf.c \
362 Network/slirp/socket.c \
363 Network/slirp/tcp_input.c \
364 Network/slirp/tcp_output.c \
365 Network/slirp/tcp_subr.c \
366 Network/slirp/tcp_timer.c \
367 Network/slirp/tftp.c \
368 Network/slirp/udp.c \
369 Network/slirp/bootp.c \
370 Network/slirp/debug.c \
371 Audio/audio.c \
372 Audio/mixeng.c \
373 Audio/noaudio.c \
374 Audio/audiosniffer.c \
375 Serial/DrvChar.cpp \
376 Serial/DrvNamedPipe.cpp
377
378# -- OS specific --
379
380ifeq ($(BUILD_TARGET),darwin)
381Drivers_SOURCES := $(filter-out \
382 Storage/DrvHost% \
383 , $(Drivers_SOURCES)) \
384 Audio/coreaudio.c
385Drivers_SOURCES.darwin =
386endif # darwin
387
388ifeq ($(BUILD_TARGET),freebsd)
389Drivers_SOURCES := $(filter-out \
390 Storage/DrvHost% \
391 , $(Drivers_SOURCES))
392Drivers_SOURCES.freebsd =
393endif # freebsd
394
395
396ifeq ($(BUILD_TARGET),l4)
397Drivers_SOURCES = \
398 Input/DrvMouseQueue.cpp \
399 Input/DrvKeyboardQueue.cpp \
400 Storage/VBoxHDD.cpp \
401 Storage/DrvBlock.cpp \
402 Storage/VmdkHDD.cpp \
403 Storage/DrvMediaISO.cpp \
404 Storage/DrvRawImage.cpp \
405 Storage/DrvHostBase.cpp \
406 Storage/DrvHostDVD.cpp \
407 PC/DrvACPI.cpp \
408 Network/DrvIntNet.cpp \
409 Network/DrvNetSniffer.cpp \
410 Audio/audio.c \
411 Audio/mixeng.c \
412 Audio/noaudio.c \
413 Audio/audiosniffer.c
414
415Drivers_SOURCES.l4 = \
416 Network/DrvTAP.cpp \
417 Audio/ossaudio.c
418endif # l4
419
420Drivers_SOURCES.linux = \
421 Network/DrvTAP.cpp \
422 Audio/ossaudio.c
423
424ifeq ($(BUILD_TARGET),os2)
425Drivers_SOURCES := $(filter-out \
426 Storage/DrvHost% \
427 , $(Drivers_SOURCES))
428Drivers_SOURCES.os2 =
429endif
430
431Drivers_SOURCES.win = \
432 Network/DrvTAPWin32.cpp \
433 Audio/dsoundaudio.c
434
435
436# -- features --
437
438ifdef VBOX_WITH_ISCSI
439 Drivers_SOURCES += \
440 Storage/DrvISCSI.cpp \
441 Storage/DrvISCSITransportTCP.cpp
442 Drivers_DEFS += VBOX_WITH_ISCSI
443endif # VBOX_WITH_ISCSI
444
445ifdef VBOX_WITH_ALSA
446 Drivers_DEFS.linux += VBOX_WITH_ALSA
447 Drivers_SOURCES.linux+= \
448 Audio/alsaaudio.c
449 VBoxDD_LIBS.linux += asound
450endif
451
452ifdef VBOX_WITH_USB
453 Drivers_DEFS += VBOX_WITH_USB IN_USB_R3
454 Drivers_SOURCES += \
455 USB/DrvVUSBRootHub.cpp \
456 USB/VUSBDevice.cpp \
457 USB/VUSBUrb.cpp
458 ifdef VBOX_WITH_VRDP
459 Drivers_SOURCES += \
460 USB/vrdp/USBProxyDevice-vrdp.cpp
461 endif
462
463 Drivers_DEFS.linux += VUSB_HAVE_USBPROXY_DEVICE
464 ifdef VBOX_WITHOUT_LINUX_COMPILER_H
465 Drivers_DEFS.linux += VBOX_WITHOUT_LINUX_COMPILER_H
466 endif
467 Drivers_SOURCES.linux+= \
468 USB/USBProxyDevice.cpp \
469 USB/linux/USBProxyDevice-linux.cpp
470
471 Drivers_DEFS.l4 += VUSB_HAVE_USBPROXY_DEVICE
472 Drivers_SOURCES.l4 += \
473 USB/USBProxyDevice.cpp \
474 USB/linux/USBProxyDevice-linux.cpp
475
476 Drivers_DEFS.win += VUSB_HAVE_USBPROXY_DEVICE
477 Drivers_SOURCES.win += \
478 USB/USBProxyDevice.cpp \
479 USB/win32/USBProxyDevice-win32.cpp
480endif # VBOX_WITH_USB
481
482
483
484#
485# Ring-0 Services (library, linked into VMMR0.r0)
486#
487ServicesR0_TEMPLATE = VBOXR0
488ServicesR0_DEFS = IN_INTNET_R0 IN_RT_R0
489ServicesR0_SOURCES = \
490 Network/SrvIntNetR0.cpp
491
492#
493# Internal Networking - Ring-3 Testcase for the Ring-0 code (a bit hackish).
494#
495tstIntNetR0_TEMPLATE = VBOXR3TSTEXE
496tstIntNetR0_DEFS = IN_INTNET_R0
497tstIntNetR0_SOURCES = \
498 Network/testcase/tstIntNetR0.cpp
499tstIntNetR0_LIBS = \
500 $(LIB_RUNTIME)
501
502
503include $(PATH_KBUILD)/footer.kmk
504
505
506# ACPI DSL generation
507$(PATH_TARGET)/vboxaml.hex: PC/vbox.dsl
508 $(call MSG_L1,iasl $<,=> $@)
509 $(QUIET)$(VBOX_IASLCMD) -tc -vs -p $@ $<
510
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