VirtualBox

source: vbox/trunk/src/VBox/Runtime/Makefile.kmk@ 6541

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

Runtime: added a reduced ("shared") R3 guest runtime which will work without initialisation for use in the X server process, where several drivers may share the runtime

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 41.1 KB
Line 
1# $Id: Makefile.kmk 6536 2008-01-28 19:44:43Z vboxsync $
2## @file
3# Makefile for the innotek Portable Runtime (IPRT).
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 (GPL) as published by the Free Software
13# Foundation, in version 2 as it comes in the "COPYING" file of the
14# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16#
17# The contents of this file may alternatively be used under the terms
18# of the Common Development and Distribution License Version 1.0
19# (CDDL) only, as it comes in the "COPYING.CDDL" file of the
20# VirtualBox OSE distribution, in which case the provisions of the
21# CDDL are applicable instead of those of the GPL.
22#
23# You may elect to license modified versions of this file under the
24# terms and conditions of either the GPL or the CDDL or both.
25#
26
27
28DEPTH = ../../..
29include $(PATH_KBUILD)/header.kmk
30
31ifdef VBOX_ONLY_ADDITIONS
32 #
33 # Only build the additions, sort out the legacy names first.
34 #
35 ifeq ($(BUILD_TARGET),linux)
36 LIBRARIES = RuntimeLnx32GuestR0 RuntimeLnx32GuestR3 RuntimeLnx32GuestR3Shared
37 else ifeq ($(BUILD_TARGET),os2)
38 LIBRARIES = RuntimeOS2GuestR0 RuntimeOS2GuestR3 #RuntimeOS2Warp3GuestR0
39 else ifeq ($(BUILD_TARGET),win)
40 LIBRARIES = RuntimeW32GuestR0 RuntimeW32GuestR3 RuntimeW32NT4GuestR0
41 else
42 LIBRARIES = RuntimeGuestR0 RuntimeGuestR3 RuntimeGuestR3Shared
43 #LIBRARIES.os2 = RuntimeOS2Warp3GuestR0
44 #LIBRARIES.win = RuntimeW32NT4GuestR0
45 endif
46
47 #
48 # Remote cross building... Will be removed unless somebody speaks up!
49 #
50else ifdef VBOX_ADDITIONS_LINUX_ONLY
51 LIBRARIES = RuntimeLnx32GuestR0 RuntimeLnx32GuestR3 RuntimeLnx32GuestR3Shared
52else ifdef VBOX_ADDITIONS_WIN32_ONLY
53 LIBRARIES = RuntimeW32GuestR0 RuntimeW32GuestR3 RuntimeW32NT4GuestR0
54else
55
56 #
57 # Normal build.
58 #
59 BLDPROGS = uniread
60 LIBRARIES = RuntimeR3 RuntimeR0 RuntimeGC RuntimeEFCPP RuntimeR3NoCRTGCC
61 ifdef VBOX_WITH_VBOXDRV
62 LIBRARIES += RuntimeR0Drv
63 endif
64 ifdef VBOX_WITH_ADDITIONS
65 if1of ($(BUILD_TARGET),linux l4 win)
66 ifdef VBOX_WITH_WIN32_ADDITIONS
67 LIBRARIES += RuntimeW32GuestR0 RuntimeW32GuestR3 RuntimeW32NT4GuestR0
68 endif
69 ifdef VBOX_WITH_LINUX_ADDITIONS
70 LIBRARIES += RuntimeLnx32GuestR3 RuntimeLnx32GuestR3Shared
71 ifdef VBOX_WITH_LINUX_ADDITIONS_32BIT_R0
72 LIBRARIES += RuntimeLnx32GuestR0
73 endif
74 endif
75 else ifeq ($(BUILD_TARGET),os2) ## @todo RuntimeOS2Guest* -> RuntimeGuest*
76 ifdef VBOX_WITH_OS2_ADDITIONS
77 LIBRARIES += RuntimeOS2GuestR0 RuntimeOS2GuestR3
78 endif
79 else
80 LIBRARIES += RuntimeGuestR0 RuntimeGuestR3 RuntimeGuestR3Shared
81 endif
82 #LIBRARIES.os2 = RuntimeOS2Warp3GuestR0
83 endif # VBOX_WITH_ADDITIONS
84 LIBRARIES.l4 = RuntimeR3L4
85 DLLS = VBoxRT
86 OTHER_CLEAN = \
87 $(PATH_TARGET)/errmsgdata.h \
88 $(PATH_TARGET)/errmsgcomdata.h \
89 $(PATH_TARGET)/Doxyfile \
90 $(PATH_TARGET)/Doxyfile.dep \
91 $(PATH_TARGET)/docs.iprt
92
93 SUBDIRS_AFTER = testcase
94endif
95
96
97# global (for now at least)
98INCS += include
99
100#
101# Unicode Specification reader used to regenerate unidata.cpp.
102#
103uniread_TEMPLATE = VBOXBLDPROG
104uniread_SOURCES = common/string/uniread.cpp
105
106#
107# Win64 assembly sources.
108#
109RuntimeWin64ASM_SOURCES = \
110 win/amd64/ASMAtomicBitClear.asm \
111 win/amd64/ASMAtomicBitTestAndToggle.asm \
112 win/amd64/ASMAtomicBitToggle.asm \
113 win/amd64/ASMAtomicReadU64.asm \
114 win/amd64/ASMAtomicXchgU16.asm \
115 win/amd64/ASMAtomicXchgU8.asm \
116 win/amd64/ASMBitFirstClear.asm \
117 win/amd64/ASMBitFirstSet.asm \
118 win/amd64/ASMGetCS.asm \
119 win/amd64/ASMGetDS.asm \
120 win/amd64/ASMGetES.asm \
121 win/amd64/ASMGetFlags.asm \
122 win/amd64/ASMGetFS.asm \
123 win/amd64/ASMGetGS.asm \
124 win/amd64/ASMGetIDTR.asm \
125 win/amd64/ASMGetGDTR.asm \
126 win/amd64/ASMGetTR.asm \
127 win/amd64/ASMGetSS.asm \
128 win/amd64/ASMProbeReadByte.asm \
129 win/amd64/ASMSetFlags.asm \
130 win/amd64/ASMGetDR0.asm \
131 win/amd64/ASMGetDR1.asm \
132 win/amd64/ASMGetDR2.asm \
133 win/amd64/ASMGetDR3.asm \
134 win/amd64/ASMGetDR6.asm \
135 win/amd64/ASMGetDR7.asm \
136 common/asm/ASMMultU64ByU32DivByU32.asm
137
138#
139# Win32 assembly sources.
140#
141RuntimeWin32ASM_SOURCES = \
142 common/asm/ASMMultU64ByU32DivByU32.asm
143
144#
145# RuntimeR3 - Static Runtime for Ring-3 executables.
146#
147RuntimeR3_TEMPLATE = VBOXR3EXE
148RuntimeR3_SDKS.win = WINPSDK W2K3DDK
149RuntimeR3_DEFS = IN_RT_R3 IN_SUP_R3 LDR_WITH_NATIVE LDR_WITH_ELF32 LDR_WITH_PE RT_WITH_VBOX
150ifdef IPRT_WITH_KSTUFF
151 RuntimeR3_DEFS += LDR_WITH_KLDR
152endif
153ifdef VBOX_MAIN_RELEASE_LOG ## @todo (dmik): temporary, until RTThreadSelf/RTThreadAdopt are properly updated
154 RuntimeR3_DEFS += RTCRITSECT_STRICT
155endif
156RuntimeR3_INCS = \
157 $(PATH_ROOT)/src/libs/liblzf-1.51
158ifdef IPRT_WITH_KSTUFF
159 RuntimeR3_INCS += \
160 $(PATH_ROOT)/src/libs/kStuff/kStuff/include
161endif
162RuntimeR3_INCS.l4 = \
163 $(L4_INCDIR)
164# for iconv.h
165RuntimeR3_INCS.freebsd = \
166 /usr/local/include
167
168
169# RuntimeR3_INCS.solaris = \
170# /usr/include
171
172RuntimeR3_SOURCES = \
173 common/alloc/alloc.cpp \
174 common/alloc/heapsimple.cpp \
175 common/checksum/crc32.cpp \
176 common/checksum/crc64.cpp \
177 common/checksum/md5.cpp \
178 common/err/errmsg.cpp \
179 common/err/RTErrConvertFromErrno.cpp \
180 common/ldr/ldr.cpp \
181 common/ldr/ldrELF.cpp \
182 common/ldr/ldrEx.cpp \
183 common/ldr/ldrFile.cpp \
184 common/ldr/ldrNative.cpp \
185 common/ldr/ldrPE.cpp \
186 common/log/log.cpp \
187 common/log/logcom.cpp \
188 common/log/logformat.cpp \
189 common/misc/assert.cpp \
190 common/misc/rand.cpp \
191 common/misc/getopt.cpp \
192 common/misc/req.cpp \
193 common/misc/sanity-c.c \
194 common/misc/sanity-cpp.cpp \
195 common/misc/semspingpong.cpp \
196 common/misc/thread.cpp \
197 common/misc/zip.cpp \
198 common/string/straprintf.cpp \
199 common/string/strformat.cpp \
200 common/string/strformatrt.cpp \
201 common/string/string.cpp \
202 common/string/strprintf.cpp \
203 common/string/strspace.cpp \
204 common/string/strstrip.cpp \
205 common/string/strtonum.cpp \
206 common/string/uni.cpp \
207 common/string/unidata.cpp \
208 common/string/utf-16.cpp \
209 common/string/utf-8.cpp \
210 common/table/avlgcptr.cpp \
211 common/table/avlhcphys.cpp \
212 common/table/avllu32.cpp \
213 common/table/avlogcphys.cpp \
214 common/table/avlogcptr.cpp \
215 common/table/avlohcphys.cpp \
216 common/table/avloioport.cpp \
217 common/table/avlpv.cpp \
218 common/table/avlrgcptr.cpp \
219 common/table/avlrogcphys.cpp \
220 common/table/avlrogcptr.cpp \
221 common/table/avlroioport.cpp \
222 common/table/avlroogcptr.cpp \
223 common/table/avlu32.cpp \
224 common/table/avlul.cpp \
225 common/table/table.cpp \
226 common/time/time.cpp \
227 common/time/timeprog.cpp \
228 common/time/timesup.cpp \
229 generic/critsect-generic.cpp \
230 generic/env-generic.cpp \
231 generic/RTFileCopy-generic.cpp \
232 generic/RTLogWriteStdErr-generic.cpp \
233 generic/RTLogWriteStdOut-generic.cpp \
234 generic/RTLogWriteUser-generic.cpp \
235 generic/semfastmutex-generic.cpp \
236 generic/spinlock-generic.cpp \
237 r3/alloc-ef.cpp \
238 r3/alloc.cpp \
239 r3/dir.cpp \
240 r3/fileio.cpp \
241 r3/fs.cpp \
242 r3/init.cpp \
243 r3/path.cpp \
244 r3/process.cpp \
245 r3/stream.cpp \
246 r3/tcp.cpp
247
248#if1of ($(BUILD_TARGET_ARCH),amd64 x86)
249# RuntimeR3_SOURCES += common/time/timesupA.asm
250#else
251 RuntimeR3_SOURCES += common/time/timesupref.cpp
252#endif
253
254ifdef IPRT_WITH_KSTUFF
255 RuntimeR3_SOURCES += \
256 common/ldr/ldrkStuff.cpp
257endif
258
259# VBox specific stuff.
260RuntimeR3_SOURCES += \
261 VBox/strformat-vbox.cpp \
262 VBox/RTAssertDoBreakpoint-vbox.cpp \
263 VBox/log-vbox.cpp
264
265RuntimeR3_SOURCES.win = \
266 generic/rand-stubs-generic.cpp \
267 generic/RTDirQueryInfo-generic.cpp \
268 generic/RTDirSetTimes-generic.cpp \
269 generic/semnoint-generic.cpp \
270 generic/semsrw-generic.cpp \
271 nt/RTErrConvertFromNtStatus.cpp \
272 r3/posix/env-posix.cpp \
273 r3/win/alloc-win.cpp \
274 r3/win/dir-win.cpp \
275 r3/win/fileio-win.cpp \
276 r3/win/fs-win.cpp \
277 r3/win/ldrNative-win.cpp \
278 r3/win/path-win.cpp \
279 r3/win/process-win.cpp \
280 r3/win/RTLogWriteDebugger-win.cpp \
281 r3/win/sched-win.cpp \
282 r3/win/sems-win.cpp \
283 r3/win/system-win.cpp \
284 r3/win/thread-win.cpp \
285 r3/win/time-win.cpp \
286 r3/win/timer-win.cpp \
287 r3/win/utf16locale-win.cpp \
288 r3/win/utf8-win.cpp \
289 r3/win/uuid-win.cpp \
290 win/errmsgwin.cpp \
291 win/RTErrConvertFromWin32.cpp
292
293RuntimeR3_SOURCES.win.amd64 = $(RuntimeWin64ASM_SOURCES)
294RuntimeR3_SOURCES.win.x86 = $(RuntimeWin32ASM_SOURCES)
295
296RuntimeR3_SOURCES.linux = \
297 generic/pathhost-generic.cpp \
298 generic/RTDirQueryInfo-generic.cpp \
299 generic/RTDirSetTimes-generic.cpp \
300 generic/RTFileMove-generic.cpp \
301 generic/RTLogWriteDebugger-generic.cpp \
302 generic/RTTimeLocalNow-generic.cpp \
303 generic/RTTimerCreate-generic.cpp \
304 generic/utf16locale-generic.cpp \
305 generic/uuid-generic.cpp \
306 r3/linux/sched-linux.cpp \
307 r3/linux/time-linux.cpp \
308 r3/posix/alloc-posix.cpp \
309 r3/posix/dir-posix.cpp \
310 r3/posix/env-posix.cpp \
311 r3/posix/fileio-posix.cpp \
312 r3/posix/filelock-posix.cpp \
313 r3/posix/fs-posix.cpp \
314 r3/posix/ldrNative-posix.cpp \
315 r3/posix/path-posix.cpp \
316 r3/posix/process-posix.cpp \
317 r3/posix/rand-posix.cpp \
318 r3/posix/RTTimeNow-posix.cpp \
319 r3/posix/system-posix.cpp \
320 r3/posix/thread-posix.cpp \
321 r3/posix/timelocal-posix.cpp \
322 r3/posix/timer-posix.cpp \
323 r3/posix/utf8-posix.cpp
324ifeq ($(BUILD_TARGET_ARCH),amd64)
325 RuntimeR3_SOURCES.linux += r3/linux/sems-linux.cpp
326else
327 RuntimeR3_SOURCES.linux += r3/posix/sems-posix.cpp
328endif
329
330RuntimeR3_SOURCES.os2 = \
331 generic/pathhost-generic.cpp \
332 generic/rand-stubs-generic.cpp \
333 generic/RTDirQueryInfo-generic.cpp \
334 generic/RTDirSetTimes-generic.cpp \
335 generic/RTFileMove-generic.cpp \
336 generic/RTLogWriteDebugger-generic.cpp \
337 generic/RTTimeLocalNow-generic.cpp \
338 generic/RTTimerCreate-generic.cpp \
339 generic/semnoint-generic.cpp \
340 generic/semsrw-generic.cpp \
341 generic/timer-generic.cpp \
342 generic/utf16locale-generic.cpp \
343 generic/uuid-generic.cpp \
344 os2/RTErrConvertFromOS2.cpp \
345 r3/os2/sched-os2.cpp \
346 r3/os2/sems-os2.cpp \
347 r3/os2/system-os2.cpp \
348 r3/os2/thread-os2.cpp \
349 r3/os2/time-os2.cpp \
350 r3/posix/alloc-posix.cpp \
351 r3/posix/dir-posix.cpp \
352 r3/posix/env-posix.cpp \
353 r3/posix/fileio-posix.cpp \
354 r3/posix/filelock-posix.cpp \
355 r3/posix/fs-posix.cpp \
356 r3/posix/ldrNative-posix.cpp \
357 r3/posix/path-posix.cpp \
358 r3/posix/process-posix.cpp \
359 r3/posix/RTTimeNow-posix.cpp \
360 r3/posix/timelocal-posix.cpp \
361 r3/posix/utf8-posix.cpp
362
363RuntimeR3_SOURCES.darwin = \
364 darwin/RTErrConvertFromDarwinCOM.cpp \
365 darwin/RTErrConvertFromDarwinIO.cpp \
366 darwin/RTErrConvertFromDarwinKern.cpp \
367 generic/pathhost-generic.cpp \
368 generic/RTDirQueryInfo-generic.cpp \
369 generic/RTDirSetTimes-generic.cpp \
370 generic/RTFileMove-generic.cpp \
371 generic/RTLogWriteDebugger-generic.cpp \
372 generic/RTTimeLocalNow-generic.cpp \
373 generic/RTTimerCreate-generic.cpp \
374 generic/sched-generic.cpp \
375 generic/timer-generic.cpp \
376 generic/utf16locale-generic.cpp \
377 generic/uuid-generic.cpp\
378 r3/darwin/alloc-darwin.cpp \
379 r3/darwin/filelock-darwin.cpp \
380 r3/darwin/time-darwin.cpp \
381 r3/posix/dir-posix.cpp \
382 r3/posix/env-posix.cpp \
383 r3/posix/fileio-posix.cpp \
384 r3/posix/fs-posix.cpp \
385 r3/posix/ldrNative-posix.cpp \
386 r3/posix/path-posix.cpp \
387 r3/posix/process-posix.cpp \
388 r3/posix/rand-posix.cpp \
389 r3/posix/sems-posix.cpp \
390 r3/posix/system-posix.cpp \
391 r3/posix/thread-posix.cpp \
392 r3/posix/timelocal-posix.cpp \
393 r3/posix/utf8-posix.cpp
394
395## @todo Make BSD sched.
396RuntimeR3_SOURCES.freebsd = \
397 generic/pathhost-generic.cpp \
398 generic/RTDirQueryInfo-generic.cpp \
399 generic/RTDirSetTimes-generic.cpp \
400 generic/RTFileMove-generic.cpp \
401 generic/RTLogWriteDebugger-generic.cpp \
402 generic/RTTimeLocalNow-generic.cpp \
403 generic/RTTimerCreate-generic.cpp \
404 generic/sched-generic.cpp \
405 generic/utf16locale-generic.cpp \
406 generic/uuid-generic.cpp \
407 r3/freebsd/alloc-freebsd.cpp \
408 r3/posix/dir-posix.cpp \
409 r3/posix/env-posix.cpp \
410 r3/posix/fileio-posix.cpp \
411 r3/posix/filelock-posix.cpp \
412 r3/posix/fs-posix.cpp \
413 r3/posix/ldrNative-posix.cpp \
414 r3/posix/path-posix.cpp \
415 r3/posix/process-posix.cpp \
416 r3/posix/rand-posix.cpp \
417 r3/posix/RTTimeNow-posix.cpp \
418 r3/posix/sems-posix.cpp \
419 r3/posix/system-posix.cpp \
420 r3/posix/thread-posix.cpp \
421 r3/posix/time-posix.cpp \
422 r3/posix/timelocal-posix.cpp \
423 r3/posix/timer-posix.cpp \
424 r3/posix/utf8-posix.cpp
425
426RuntimeR3_SOURCES.solaris = \
427 generic/pathhost-generic.cpp \
428 generic/RTDirQueryInfo-generic.cpp \
429 generic/RTDirSetTimes-generic.cpp \
430 generic/RTFileMove-generic.cpp \
431 generic/RTLogWriteDebugger-generic.cpp \
432 generic/RTTimeLocalNow-generic.cpp \
433 generic/RTTimerCreate-generic.cpp \
434 generic/sched-generic.cpp \
435 generic/utf16locale-generic.cpp \
436 generic/uuid-generic.cpp \
437 r3/posix/dir-posix.cpp \
438 r3/posix/env-posix.cpp \
439 r3/posix/fileio-posix.cpp \
440 r3/posix/filelock-posix.cpp \
441 r3/posix/fs-posix.cpp \
442 r3/posix/ldrNative-posix.cpp \
443 r3/posix/path-posix.cpp \
444 r3/posix/process-posix.cpp \
445 r3/posix/rand-posix.cpp \
446 r3/posix/RTTimeNow-posix.cpp \
447 r3/posix/sems-posix.cpp \
448 r3/posix/system-posix.cpp \
449 r3/posix/thread-posix.cpp \
450 r3/posix/time-posix.cpp \
451 r3/posix/timelocal-posix.cpp \
452 r3/posix/timer-posix.cpp \
453 r3/posix/utf8-posix.cpp \
454 r3/solaris/alloc-solaris.cpp
455
456## PORTME: Porters add their selection of platform specific files for Ring-3 here.
457
458RuntimeR3Shared_SOURCES = \
459 common/err/errmsg.cpp \
460 common/err/RTErrConvertFromErrno.cpp \
461 common/log/logformat.cpp \
462 common/misc/assert.cpp \
463 common/misc/sanity-c.c \
464 common/misc/sanity-cpp.cpp \
465 common/string/strformat.cpp \
466 common/string/strformatrt.cpp \
467 common/string/string.cpp \
468 common/string/strprintf.cpp \
469 common/string/unidata.cpp \
470 common/string/utf-8.cpp \
471 common/string/utf-16.cpp \
472 generic/pathhost-generic.cpp \
473 generic/RTAssertDoBreakpoint-generic.cpp \
474 r3/alloc.cpp \
475 r3/fileio.cpp \
476 r3/fs.cpp \
477 r3/path.cpp
478
479# VBox specific stuff.
480RuntimeR3Shared_SOURCES += \
481 VBox/strformat-vbox.cpp
482
483RuntimeR3Shared_SOURCES.linux = \
484 r3/posix/fileio-posix.cpp \
485 r3/posix/path-posix.cpp \
486 r3/posix/utf8-posix.cpp
487
488
489RuntimeR3Shared_SOURCES.solaris = \
490 r3/posix/fileio-posix.cpp \
491 r3/posix/path-posix.cpp \
492 r3/posix/utf8-posix.cpp
493
494
495#
496# L4 RuntimeR3 subtarget since L4 headers won't work with VBOXR3.
497#
498RuntimeR3L4_TEMPLATE = VBOXR3NP
499RuntimeR3L4_DEFS = IN_RT_R3 IN_SUP_R3 LDR_WITH_NATIVE LDR_WITH_ELF LDR_WITH_PE
500ifneq ($(BUILD_TARGET_ARCH),amd64)
501RuntimeR3L4_DEFS += __PIC__
502endif
503RuntimeR3L4_INCS = $(L4_INCDIR)
504
505RuntimeR3L4_SOURCES = \
506 generic/fs-stubs-generic.cpp \
507 generic/pathhost-generic.cpp \
508 generic/RTDirQueryInfo-generic.cpp \
509 generic/RTDirSetTimes-generic.cpp \
510 generic/RTFileMove-generic.cpp \
511 generic/RTLogWriteDebugger-generic.cpp \
512 generic/RTTimeLocalNow-generic.cpp \
513 generic/sched-generic.cpp \
514 generic/semnoint-generic.cpp \
515 generic/semsrw-generic.cpp \
516 generic/utf16locale-generic.cpp \
517 generic/uuid-generic.cpp \
518 l4/l4-errno.cpp \
519 l4/process-l4env.cpp \
520 l4/sems-l4env.cpp \
521 l4/system-l4env.cpp \
522 l4/thread-l4env.cpp \
523 l4/timer-l4env.cpp \
524 l4/utf8-l4env.cpp \
525 r3/posix/alloc-posix.cpp \
526 r3/posix/dir-posix.cpp \
527 r3/posix/env-posix.cpp \
528 r3/posix/fileio-posix.cpp \
529 r3/posix/filelock-posix.cpp \
530 r3/posix/ldrNative-posix.cpp \
531 r3/posix/path-posix.cpp \
532 r3/posix/rand-posix.cpp \
533 r3/posix/RTTimeNow-posix.cpp \
534 r3/posix/time-posix.cpp \
535 r3/posix/timelocal-posix.cpp
536
537
538#
539# RuntimeGuestR3 - Guest Additions Runtime (static).
540#
541RuntimeGuestR3_TEMPLATE := VBOXGUESTR3LIB
542RuntimeGuestR3_SDKS.win := $(RuntimeR3_SDKS.win)
543RuntimeGuestR3_DEFS := $(filter-out RTCRITSECT_STRICT, $(RuntimeR3_DEFS))
544RuntimeGuestR3_DEFS.$(BUILD_TARGET) := $(RuntimeR3_DEFS.$(BUILD_TARGET))
545RuntimeGuestR3_INCS := $(RuntimeR3_INCS)
546RuntimeGuestR3_INCS.$(BUILD_TARGET) := $(RuntimeR3_INCS.$(BUILD_TARGET))
547RuntimeGuestR3_SOURCES := $(filter-out \
548 common/time/timesupref.cpp \
549 common/time/timesupA.asm \
550 common/time/timesup.cpp \
551 generic/RTLogWriteUser-generic.cpp \
552 , $(RuntimeR3_SOURCES))
553RuntimeGuestR3_SOURCES += \
554 common/time/timesysalias.cpp \
555 VBox/logbackdoor.cpp
556RuntimeGuestR3_SOURCES.$(BUILD_TARGET) := $(RuntimeR3_SOURCES.$(BUILD_TARGET))
557RuntimeGuestR3_SOURCES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH) := $(RuntimeR3_SOURCES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH))
558
559
560#
561# RuntimeGuestR3Shared - Guest Additions Runtime (static) which does not require initialisation.
562#
563RuntimeGuestR3Shared_TEMPLATE := VBOXGUESTR3LIB
564RuntimeGuestR3Shared_SDKS.win := $(RuntimeR3_SDKS.win)
565RuntimeGuestR3Shared_DEFS := $(filter-out RTCRITSECT_STRICT, $(RuntimeR3_DEFS)) \
566 VBOX_SHARED_RUNTIME
567RuntimeGuestR3Shared_DEFS.$(BUILD_TARGET) := $(RuntimeR3_DEFS.$(BUILD_TARGET))
568RuntimeGuestR3Shared_INCS := $(RuntimeR3_INCS)
569RuntimeGuestR3Shared_INCS.$(BUILD_TARGET) := $(RuntimeR3_INCS.$(BUILD_TARGET))
570RuntimeGuestR3Shared_SOURCES := $(filter-out \
571 generic/RTLogWriteUser-generic.cpp \
572 , $(RuntimeR3Shared_SOURCES))
573RuntimeGuestR3Shared_SOURCES += \
574 VBox/logbackdoor.cpp \
575 VBox/logbackdoor-redirect.cpp
576RuntimeGuestR3Shared_SOURCES.$(BUILD_TARGET) := $(RuntimeR3Shared_SOURCES.$(BUILD_TARGET))
577RuntimeGuestR3Shared_SOURCES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH) := $(RuntimeR3Shared_SOURCES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH))
578
579
580#
581# RuntimeW32GuestR3 - Win32 guest program runtime.
582#
583RuntimeW32GuestR3_TEMPLATE = VBOXW32GUESTR3LIB
584RuntimeW32GuestR3_SDKS = WINPSDK W2K3DDK
585RuntimeW32GuestR3_DEFS = IN_RT_R3 IN_SUP_R3 LDR_WITH_NATIVE LDR_WITH_ELF32 LDR_WITH_PE RT_WITH_VBOX
586ifdef IPRT_WITH_KSTUFF
587 RuntimeW32GuestR3_DEFS += LDR_WITH_KLDR
588endif
589RuntimeW32GuestR3_SOURCES = $(RuntimeR3_SOURCES.win) $(RuntimeR3_SOURCES)
590RuntimeW32GuestR3_INCS = $(RuntimeR3_INCS.win) $(RuntimeR3_INCS)
591
592
593#
594# RuntimeLnx32GuestR3 - 32-bit Linux guest program runtime.
595#
596RuntimeLnx32GuestR3_TEMPLATE = VBOXLNX32GUESTR3LIB
597RuntimeLnx32GuestR3_DEFS = IN_RT_R3 IN_SUP_R3 LDR_WITH_NATIVE LDR_WITH_ELF32 LDR_WITH_PE RT_WITH_VBOX
598ifdef IPRT_WITH_KSTUFF
599 RuntimeLnx32GuestR3_DEFS += LDR_WITH_KLDR
600endif
601RuntimeLnx32GuestR3_SOURCES = $(RuntimeR3_SOURCES.linux) $(RuntimeR3_SOURCES)
602RuntimeLnx32GuestR3_SOURCES += VBox/logbackdoor.cpp
603RuntimeLnx32GuestR3_INCS = $(RuntimeR3_INCS.linux) $(RuntimeR3_INCS)
604
605
606#
607# RuntimeLnx32GuestR3Shared - 32-bit Linux guest program runtime which does not require
608# initialisation.
609#
610RuntimeLnx32GuestR3Shared_TEMPLATE = VBOXLNX32GUESTR3LIB
611RuntimeLnx32GuestR3Shared_DEFS = IN_RT_R3 IN_SUP_R3 LDR_WITH_NATIVE LDR_WITH_ELF32 \
612 LDR_WITH_PE RT_WITH_VBOX VBOX_SHARED_RUNTIME
613ifdef IPRT_WITH_KSTUFF
614 RuntimeLnx32GuestR3Shared_DEFS += LDR_WITH_KLDR
615endif
616RuntimeLnx32GuestR3Shared_SOURCES = $(RuntimeR3Shared_SOURCES.linux) $(RuntimeR3Shared_SOURCES)
617RuntimeLnx32GuestR3Shared_SOURCES += \
618 VBox/logbackdoor.cpp \
619 VBox/logbackdoor-redirect.cpp
620RuntimeLnx32GuestR3Shared_INCS = $(RuntimeR3_INCS.linux) $(RuntimeR3_INCS)
621
622
623#
624# RuntimeOS2GuestR3 - OS/2 guest program runtime.
625#
626RuntimeOS2GuestR3_TEMPLATE = VBOXOS2GUESTR3LIB
627RuntimeOS2GuestR3_DEFS = IN_RT_R3 IN_SUP_R3 LDR_WITH_NATIVE LDR_WITH_ELF32 LDR_WITH_PE RT_WITH_VBOX
628ifdef IPRT_WITH_KSTUFF
629 RuntimeOS2GuestR3_DEFS += LDR_WITH_KLDR
630endif
631RuntimeOS2GuestR3_SOURCES = $(RuntimeR3_SOURCES.os2) $(RuntimeR3_SOURCES)
632RuntimeOS2GuestR3_INCS = $(RuntimeR3_INCS.os2) $(RuntimeR3_INCS)
633
634
635#
636# VBoxRT - Shared Object / DLL version.
637#
638VBoxRT_TEMPLATE = VBOXR3
639VBoxRT_SDKS.win = WINPSDK W2K3DDK VBOX_NTDLL
640ifeq ($(BUILD_TARGET),darwin)
641VBoxRT_INST = $(INST_DLL) $(INST_TESTCASE)
642endif
643VBoxRT_DEFS = $(RuntimeR3_DEFS) IN_SUP_R3 IN_SUP_R3
644VBoxRT_DEFS.$(BUILD_TYPE) = $(RuntimeR3_DEFS.$(BUILD_TYPE))
645VBoxRT_SOURCES = \
646 VBox/VBoxRTDeps.cpp \
647 $(RuntimeR3_SOURCES)
648VBoxRT_SOURCES.$(BUILD_TARGET) = $(RuntimeR3_SOURCES.$(BUILD_TARGET))
649VBoxRT_SOURCES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH) = $(RuntimeR3_SOURCES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH))
650VBoxRT_SOURCES.win += r3/win/dllmain-win.cpp
651VBoxRT_SOURCES.win.x86 += r3/win/VBoxRT-win32.def
652VBoxRT_SOURCES.win.amd64 += r3/win/VBoxRT-win64.def
653VBoxRT_INCS = $(RuntimeR3_INCS)
654VBoxRT_INCS.$(BUILD_TARGET) = $(RuntimeR3_INCS.$(BUILD_TARGET))
655VBoxRT_INCS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH) = $(RuntimeR3_INCS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH))
656VBoxRT_LIBS = \
657 $(PATH_LIB)/SUPR3$(VBOX_SUFF_LIB) \
658 $(PATH_LIB)/VBox-liblzf$(VBOX_SUFF_LIB)
659ifdef IPRT_WITH_KSTUFF
660 VBoxRT_LIBS += \
661 $(PATH_LIB)/VBox-kStuff$(VBOX_SUFF_LIB)
662endif
663VBoxRT_LIBS.darwin = \
664 iconv
665VBoxRT_LIBS.freebsd = \
666 iconv
667VBoxRT_LIBPATH.freebsd = \
668 /usr/local/lib
669VBoxRT_LDFLAGS.darwin = -framework IOKit -install_name @executable_path/VBoxRT.dylib
670ifdef VBOX_USE_VCC80
671VBoxRT_LDFLAGS.win = /MANIFEST
672endif
673VBoxRT_LDFLAGS.l4 = \
674 -Wl,-whole-archive \
675 $(PATH_LIB)/RuntimeR3L4$(VBOX_SUFF_LIB) \
676 -Wl,-no-whole-archive
677ifeq ($(BUILD_TARGET),l4)
678VBoxRT_LIBS += \
679 $(L4_LIBDIR)/libl4sys.a \
680 $(L4_LIBDIR)/libl4sys.p.a
681endif
682VBoxRT_LIBS.l4 = \
683 $(PATH_LIB)/RuntimeR3L4$(VBOX_SUFF_LIB)
684
685
686#
687# RuntimeR3NoCRTGCC - CRT replacement lib for VBoxREM.
688# This is used together with VBoxRT.
689#
690RuntimeR3NoCRTGCC_TEMPLATE = VBOXNOCRTGCC
691RuntimeR3NoCRTGCC_LIBSUFF = $(VBOX_SUFF_LIB)
692RuntimeR3NoCRTGCC_SOURCES = \
693 common/misc/sanity-cpp.cpp \
694 common/misc/sanity-c.c \
695 \
696 common/math/ceill.asm \
697 common/math/cosl.asm \
698 common/math/fabs.asm \
699 common/math/fabsf.asm \
700 common/math/fabsl.asm \
701 common/math/floor.asm \
702 common/math/floorf.asm \
703 common/math/floorl.asm \
704 common/math/ldexpl.asm \
705 common/math/llrint.asm \
706 common/math/llrintf.asm \
707 common/math/llrintl.asm \
708 common/math/logl.asm \
709 common/math/lrint.asm \
710 common/math/lrintf.asm \
711 common/math/lrintl.asm \
712 common/math/remainder.asm \
713 common/math/remainderf.asm \
714 common/math/remainderl.asm \
715 common/math/sinl.asm \
716 common/math/tanl.asm \
717 common/math/trunc.asm \
718 common/math/truncf.asm \
719 common/math/truncl.asm \
720 \
721 common/misc/setjmp.asm \
722 \
723 common/string/memchr.asm \
724 common/string/memchr_alias.c \
725 common/string/memcmp.asm \
726 common/string/memcmp_alias.c \
727 common/string/memcpy.asm \
728 common/string/memcpy_alias.c \
729 common/string/mempcpy.asm \
730 common/string/memset.asm \
731 common/string/memset_alias.c \
732 common/string/strchr.asm \
733 common/string/strchr_alias.c \
734 common/string/strcmp.asm \
735 common/string/strcmp_alias.c
736
737RuntimeR3NoCRTGCC_SOURCES.x86 = \
738 common/math/x86/fenv-x86.c \
739 common/math/gcc/adddi3.c \
740 common/math/gcc/anddi3.c \
741 common/math/gcc/ashldi3.c \
742 common/math/gcc/ashrdi3.c \
743 common/math/gcc/cmpdi2.c \
744 common/math/gcc/divdi3.c \
745 common/math/gcc/iordi3.c \
746 common/math/gcc/lshldi3.c \
747 common/math/gcc/lshrdi3.c \
748 common/math/gcc/moddi3.c \
749 common/math/gcc/muldi3.c \
750 common/math/gcc/negdi2.c \
751 common/math/gcc/notdi2.c \
752 common/math/gcc/qdivrem.c \
753 common/math/gcc/subdi3.c \
754 common/math/gcc/ucmpdi2.c \
755 common/math/gcc/udivdi3.c \
756 common/math/gcc/umoddi3.c \
757 common/math/gcc/xordi3.c
758
759
760## @todo stop using the old memcpy.c and memset.c code.
761
762#
763# RuntimeR0 - Ring0 library for VMMR0.
764#
765RuntimeR0_TEMPLATE = VBOXR0
766RuntimeR0_DEFS = IN_RT_R0 RT_WITH_VBOX RT_WITHOUT_NOCRT_WRAPPERS
767RuntimeR0_SOURCES = \
768 common/log/logcom.cpp \
769 common/log/logformat.cpp \
770 common/misc/assert.cpp \
771 common/misc/sanity-c.c \
772 common/misc/sanity-cpp.cpp \
773 common/string/memchr.cpp \
774 common/string/memcmp.cpp \
775 common/string/memcpy.cpp \
776 common/string/memset.cpp \
777 common/string/strcmp.asm \
778 common/string/strcpy.cpp \
779 common/string/strformat.cpp \
780 common/string/strformatrt.cpp \
781 common/string/strlen.cpp \
782 common/string/strncmp.cpp \
783 common/string/strpbrk.cpp \
784 common/string/strprintf.cpp \
785 common/table/avlgcptr.cpp \
786 common/table/avlhcphys.cpp \
787 common/table/avllu32.cpp \
788 common/table/avlogcphys.cpp \
789 common/table/avlogcptr.cpp \
790 common/table/avlohcphys.cpp \
791 common/table/avloioport.cpp \
792 common/table/avlpv.cpp \
793 common/table/avlrogcphys.cpp \
794 common/table/avlrogcptr.cpp \
795 common/table/avlroioport.cpp \
796 common/table/avlroogcptr.cpp \
797 common/table/avlu32.cpp \
798 common/time/timesup.cpp \
799 generic/RTAssertDoBreakpoint-generic.cpp \
800 VBox/strformat-vbox.cpp
801
802#if1of ($(BUILD_TARGET_ARCH),amd64 x86)
803# RuntimeR0_SOURCES += common/time/timesupA.asm
804#else
805 RuntimeR0_SOURCES += common/time/timesupref.cpp
806#endif
807
808RuntimeR0_SOURCES.win.amd64 = $(RuntimeWin64ASM_SOURCES)
809RuntimeR0_SOURCES.win.x86 = $(RuntimeWin32ASM_SOURCES)
810
811RuntimeR0_SOURCES.os2 = \
812 os2/RTErrConvertFromOS2.cpp \
813 os2/sys0.asm
814
815ifeq ($(filter-out darwin solaris freebsd,$(BUILD_TARGET)),)
816RuntimeR0_SOURCES += \
817 common/math/gcc/adddi3.c \
818 common/math/gcc/anddi3.c \
819 common/math/gcc/ashldi3.c \
820 common/math/gcc/ashrdi3.c \
821 common/math/gcc/cmpdi2.c \
822 common/math/gcc/divdi3.c \
823 common/math/gcc/iordi3.c \
824 common/math/gcc/lshldi3.c \
825 common/math/gcc/lshrdi3.c \
826 common/math/gcc/moddi3.c \
827 common/math/gcc/muldi3.c \
828 common/math/gcc/negdi2.c \
829 common/math/gcc/notdi2.c \
830 common/math/gcc/qdivrem.c \
831 common/math/gcc/subdi3.c \
832 common/math/gcc/ucmpdi2.c \
833 common/math/gcc/udivdi3.c \
834 common/math/gcc/umoddi3.c \
835 common/math/gcc/xordi3.c
836endif
837
838
839common/string/memchr.cpp_CXXFLAGS.win = -Oi-
840common/string/memcmp.cpp_CXXFLAGS.win = -Oi-
841common/string/memcpy.cpp_CXXFLAGS.win = -Oi-
842common/string/memset.cpp_CXXFLAGS.win = -Oi-
843common/string/strcpy.cpp_CXXFLAGS.win = -Oi-
844common/string/strlen.cpp_CXXFLAGS.win = -Oi-
845
846ifeq ($(BUILD_TARGET),l4)
847RuntimeR0Drv_BLD_TRG = linux
848RuntimeR0Drv_BLD_TRG_ARCH = x86
849RuntimeR0Drv_BLD_TRG_CPU = i386
850endif
851
852#
853# RuntimeR0Drv - Ring0 library for host drivers.
854#
855RuntimeR0Drv_TEMPLATE = VBOXR0DRV
856RuntimeR0Drv_SDKS.win = W2K3DDK WINPSDKINCS
857RuntimeR0Drv_INCS := $(PATH_SUB_CURRENT)
858RuntimeR0Drv_DEFS = IN_RT_R0 RT_WITH_VBOX RT_WITHOUT_NOCRT_WRAPPERS
859RuntimeR0Drv_DEFS.win = IN_SUP_R0
860RuntimeR0Drv_DEFS.linux = MODULE KBUILD_MODNAME=KBUILD_STR\(vboxdrv\) KBUILD_BASENAME=KBUILD_STR\(vboxdrv\) IN_SUP_R0 # why is IN_SUP_R0 here? because!
861
862RuntimeR0Drv_INCS.linux = \
863 r0drv/linux
864
865RuntimeR0Drv_SOURCES = \
866 common/checksum/crc32.cpp \
867 common/checksum/crc64.cpp \
868 common/log/log.cpp \
869 common/log/logcom.cpp \
870 common/log/logformat.cpp \
871 common/misc/assert.cpp \
872 common/misc/sanity-c.c \
873 common/misc/sanity-cpp.cpp \
874 common/string/strformat.cpp \
875 common/string/strformatrt.cpp \
876 common/string/strpbrk.cpp \
877 common/string/strprintf.cpp \
878 common/string/strtonum.cpp \
879 common/table/avlpv.cpp \
880 generic/RTLogWriteStdErr-stub-generic.cpp \
881 generic/RTLogWriteStdOut-stub-generic.cpp \
882 generic/RTLogWriteUser-generic.cpp \
883 r0drv/alloc-r0drv.cpp \
884 r0drv/initterm-r0drv.cpp \
885 VBox/log-vbox.cpp \
886 VBox/strformat-vbox.cpp
887
888RuntimeR0Drv_SOURCES.linux = \
889 common/alloc/heapsimple.cpp \
890 common/err/RTErrConvertToErrno.cpp \
891 generic/RTAssertDoBreakpoint-generic.cpp \
892 r0drv/linux/alloc-r0drv-linux.c \
893 r0drv/linux/initterm-r0drv-linux.c \
894 r0drv/linux/memobj-r0drv-linux.c \
895 r0drv/linux/process-r0drv-linux.c \
896 r0drv/linux/RTLogWriteDebugger-r0drv-linux.c \
897 r0drv/linux/semevent-r0drv-linux.c \
898 r0drv/linux/semeventmulti-r0drv-linux.c \
899 r0drv/linux/semfastmutex-r0drv-linux.c \
900 r0drv/linux/spinlock-r0drv-linux.c \
901 r0drv/linux/thread-r0drv-linux.c \
902 r0drv/memobj-r0drv.cpp
903## @todo thread2-r0drv-linux.c, timer-r0drv-linux.c and assert-r0drv-linux.c
904
905RuntimeR0Drv_SOURCES.win = \
906 common/misc/thread.cpp \
907 common/string/strncmp.cpp \
908 generic/RTAssertDoBreakpoint-generic.cpp \
909 nt/RTErrConvertFromNtStatus.cpp \
910 r0drv/memobj-r0drv.cpp \
911 r0drv/nt/alloc-r0drv-nt.cpp \
912 r0drv/nt/initterm-r0drv-nt.cpp \
913 r0drv/nt/memobj-r0drv-nt.cpp \
914 r0drv/nt/process-r0drv-nt.cpp \
915 r0drv/nt/RTLogWriteDebugger-r0drv-nt.cpp \
916 r0drv/nt/semevent-r0drv-nt.cpp \
917 r0drv/nt/semeventmulti-r0drv-nt.cpp \
918 r0drv/nt/semfastmutex-r0drv-nt.cpp \
919 r0drv/nt/semmutex-r0drv-nt.cpp \
920 r0drv/nt/spinlock-r0drv-nt.cpp \
921 r0drv/nt/thread-r0drv-nt.cpp \
922 r0drv/nt/thread2-r0drv-nt.cpp \
923 r0drv/nt/time-r0drv-nt.cpp
924## @todo timer-r0drv-nt.cpp and assert-r0drv-nt.cpp
925
926RuntimeR0Drv_SOURCES.win.amd64 = $(RuntimeWin64ASM_SOURCES)
927RuntimeR0Drv_SOURCES.win.x86 = $(RuntimeWin32ASM_SOURCES)
928
929RuntimeR0Drv_SOURCES.darwin = \
930 common/err/RTErrConvertFromErrno.cpp \
931 common/misc/thread.cpp \
932 common/string/memchr.asm \
933 darwin/RTErrConvertFromDarwinIO.cpp \
934 darwin/RTErrConvertFromDarwinKern.cpp \
935 generic/RTAssertDoBreakpoint-generic.cpp \
936 generic/RTTimerCreate-generic.cpp \
937 generic/timer-generic.cpp \
938 r0drv/darwin/alloc-r0drv-darwin.cpp \
939 r0drv/darwin/assert-r0drv-darwin.cpp \
940 r0drv/darwin/initterm-r0drv-darwin.cpp \
941 r0drv/darwin/memobj-r0drv-darwin.cpp \
942 r0drv/darwin/process-r0drv-darwin.cpp \
943 r0drv/darwin/RTLogWriteDebugger-r0drv-darwin.cpp \
944 r0drv/darwin/semaphore-r0drv-darwin.cpp \
945 r0drv/darwin/spinlock-r0drv-darwin.cpp \
946 r0drv/darwin/thread-r0drv-darwin.cpp \
947 r0drv/darwin/thread2-r0drv-darwin.cpp \
948 r0drv/darwin/time-r0drv-darwin.cpp \
949 r0drv/memobj-r0drv.cpp
950
951RuntimeR0Drv_DEFS.os2 += RT_WITHOUT_NOCRT_WRAPPERS
952RuntimeR0Drv_SOURCES.os2 = \
953 common/string/memchr.asm \
954 common/string/memcmp.asm \
955 common/string/memcpy.asm \
956 common/string/mempcpy.asm \
957 common/string/memset.asm \
958 common/string/strchr.asm \
959 common/string/strcmp.asm \
960 \
961 common/string/strcpy.cpp \
962 common/string/strlen.cpp \
963 common/string/strncmp.cpp \
964 \
965 common/misc/thread.cpp \
966 generic/RTLogWriteDebugger-generic.cpp \
967 os2/RTErrConvertFromOS2.cpp \
968 os2/sys0.asm \
969 r0drv/memobj-r0drv.cpp \
970 r0drv/os2/alloc-r0drv-os2.cpp \
971 r0drv/os2/assert-r0drv-os2.cpp \
972 r0drv/os2/assertA-r0drv-os2.asm \
973 r0drv/os2/initterm-r0drv-os2.cpp \
974 r0drv/os2/memobj-r0drv-os2.cpp \
975 r0drv/os2/os2imports.imp \
976 r0drv/os2/process-r0drv-os2.cpp \
977 r0drv/os2/RTAssertDoBreakpoint-r0drv-os2.asm \
978 r0drv/os2/RTR0Os2DHQueryDOSVar.asm \
979 r0drv/os2/RTR0Os2DHVMGlobalToProcess.asm \
980 r0drv/os2/semevent-r0drv-os2.cpp \
981 r0drv/os2/semeventmulti-r0drv-os2.cpp \
982 r0drv/os2/semfastmutex-r0drv-os2.cpp \
983 r0drv/os2/spinlock-r0drv-os2.cpp \
984 r0drv/os2/thread-r0drv-os2.cpp \
985 r0drv/os2/thread2-r0drv-os2.cpp \
986 r0drv/os2/time-r0drv-os2.cpp \
987 r0drv/os2/timer-r0drv-os2.cpp \
988 r0drv/os2/timerA-r0drv-os2.asm
989
990RuntimeR0Drv_SOURCES.freebsd = \
991 common/err/RTErrConvertFromErrno.cpp \
992 common/err/RTErrConvertToErrno.cpp \
993 common/misc/thread.cpp \
994 common/string/memchr.asm \
995 generic/RTAssertDoBreakpoint-generic.cpp \
996 generic/RTLogWriteDebugger-generic.cpp \
997 generic/RTTimerCreate-generic.cpp \
998 r0drv/freebsd/alloc-r0drv-freebsd.c \
999 r0drv/freebsd/assert-r0drv-freebsd.c \
1000 r0drv/freebsd/initterm-r0drv-freebsd.c \
1001 r0drv/freebsd/memobj-r0drv-freebsd.c \
1002 r0drv/freebsd/process-r0drv-freebsd.c \
1003 r0drv/freebsd/semevent-r0drv-freebsd.c \
1004 r0drv/freebsd/semeventmulti-r0drv-freebsd.c \
1005 r0drv/freebsd/semfastmutex-r0drv-freebsd.c \
1006 r0drv/freebsd/spinlock-r0drv-freebsd.c \
1007 r0drv/freebsd/thread-r0drv-freebsd.c \
1008 r0drv/freebsd/thread2-r0drv-freebsd.c \
1009 r0drv/freebsd/time-r0drv-freebsd.c \
1010 r0drv/freebsd/timer-r0drv-freebsd.c \
1011 r0drv/memobj-r0drv.cpp
1012
1013RuntimeR0Drv_SOURCES.solaris = \
1014 common/err/RTErrConvertFromErrno.cpp \
1015 common/misc/thread.cpp \
1016 common/string/memchr.asm \
1017 generic/RTAssertDoBreakpoint-generic.cpp \
1018 generic/RTTimerCreate-generic.cpp \
1019 r0drv/memobj-r0drv.cpp \
1020 r0drv/solaris/alloc-r0drv-solaris.c \
1021 r0drv/solaris/assert-r0drv-solaris.c \
1022 r0drv/solaris/initterm-r0drv-solaris.c \
1023 r0drv/solaris/memobj-r0drv-solaris.c \
1024 r0drv/solaris/process-r0drv-solaris.c \
1025 r0drv/solaris/RTLogWriteDebugger-r0drv-solaris.c \
1026 r0drv/solaris/semevent-r0drv-solaris.c \
1027 r0drv/solaris/semeventmulti-r0drv-solaris.c \
1028 r0drv/solaris/semfastmutex-r0drv-solaris.c \
1029 r0drv/solaris/spinlock-r0drv-solaris.c \
1030 r0drv/solaris/thread-r0drv-solaris.c \
1031 r0drv/solaris/thread2-r0drv-solaris.c \
1032 r0drv/solaris/time-r0drv-solaris.c \
1033 r0drv/solaris/timer-r0drv-solaris.c
1034
1035## PORTME: Porters create and add their selection of platform specific Ring-0 Driver files here.
1036
1037
1038#
1039# RuntimeGuestR0 - Guest driver runtime.
1040# This is almost the same as the RuntimeR0Drv, the main difference
1041# is in the backdoor logging and the lack of sup.h (which should be
1042# made irrelevant even for RuntimeR0Rdrv).
1043#
1044# TODO: RuntimeGuestR0_EXTENDS = RuntimeR0Drv (kBuild)
1045#
1046RuntimeGuestR0_TEMPLATE := VBOXGUESTR0LIB
1047RuntimeGuestR0_SDKS.win := W2K3DDKX86 WINPSDKINCS
1048RuntimeGuestR0_DEFS := $(RuntimeR0Drv_DEFS)
1049RuntimeGuestR0_DEFS.$(BUILD_TARGET) := $(RuntimeR0Drv_DEFS.$(BUILD_TARGET))
1050RuntimeGuestR0_INCS := $(PATH_SUB_CURRENT)
1051RuntimeGuestR0_INCS.$(BUILD_TARGET) := $(RuntimeR0Drv_INCS.$(BUILD_TARGET))
1052RuntimeGuestR0_SOURCES := $(filter-out generic/RTLogWriteUser-generic.cpp, $(RuntimeR0Drv_SOURCES))
1053RuntimeGuestR0_SOURCES += VBox/logbackdoor.cpp
1054RuntimeGuestR0_SOURCES.$(BUILD_TARGET) := $(RuntimeR0Drv_SOURCES.$(BUILD_TARGET))
1055RuntimeGuestR0_SOURCES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH) := $(RuntimeR0Drv_SOURCES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH))
1056ifdef VBOX_USE_VCC80
1057RuntimeGuestR0_SOURCES.win += \
1058 common/string/memchr.cpp \
1059 common/string/memcmp.cpp \
1060 common/string/memcpy.cpp \
1061 common/string/memset.cpp \
1062 common/string/strlen.cpp
1063endif
1064
1065
1066#
1067# RuntimeW32GuestR0 - Win32 guest driver runtime.
1068#
1069RuntimeW32GuestR0_TEMPLATE = VBOXW32GUESTR0LIB
1070RuntimeW32GuestR0_SDKS = W2K3DDKX86 WINPSDKINCS
1071RuntimeW32GuestR0_INCS := $(PATH_SUB_CURRENT)
1072RuntimeW32GuestR0_DEFS = IN_RT_R0 RT_WITH_VBOX RT_WITHOUT_NOCRT_WRAPPERS IN_SUP_R0
1073RuntimeW32GuestR0_DEFS.$(BUILD_TARGET) =
1074RuntimeW32GuestR0_SOURCES = \
1075 $(filter-out generic/RTLogWriteUser-generic.cpp,$(RuntimeR0Drv_SOURCES)) \
1076 $(RuntimeR0Drv_SOURCES.win) \
1077 VBox/logbackdoor.cpp
1078ifdef VBOX_USE_VCC80
1079RuntimeW32GuestR0_SOURCES += \
1080 common/string/memchr.cpp \
1081 common/string/memcmp.cpp \
1082 common/string/memcpy.cpp \
1083 common/string/memset.cpp \
1084 common/string/strlen.cpp
1085endif
1086
1087
1088#
1089# RuntimeW32NT4GuestR0 - Win32 NT4 guest driver runtime.
1090#
1091RuntimeW32NT4GuestR0_TEMPLATE = VBOXW32GUESTR0LIB
1092RuntimeW32NT4GuestR0_SDKS = $(RuntimeW32GuestR0_SDKS)
1093RuntimeW32NT4GuestR0_DEFS = $(RuntimeW32GuestR0_DEFS) IPRT_TARGET_NT4
1094RuntimeW32NT4GuestR0_INCS = $(RuntimeW32GuestR0_INCS)
1095RuntimeW32NT4GuestR0_SOURCES = $(RuntimeW32GuestR0_SOURCES)
1096
1097
1098#
1099# RuntimeLnx32GuestR0 - 32-bit Linux guest driver runtime.
1100#
1101RuntimeLnx32GuestR0_TEMPLATE = VBOXLNX32GUESTR0
1102RuntimeLnx32GuestR0_DEFS = RT_WITH_VBOX RT_WITHOUT_NOCRT_WRAPPERS IN_SUP_R0 \
1103 MODULE KBUILD_MODNAME=KBUILD_STR\(vboxdrv\) KBUILD_BASENAME=KBUILD_STR\(vboxdrv\)
1104RuntimeLnx32GuestR0_INCS = $(RuntimeR0Drv_INCS.linux) $(RuntimeR0Drv_INCS)
1105RuntimeLnx32GuestR0_SOURCES = \
1106 $(RuntimeR0Drv_SOURCES) \
1107 $(RuntimeR0Drv_SOURCES.linux) \
1108 VBox/logbackdoor.cpp
1109
1110
1111#
1112# RuntimeOS2GuestR0 - OS/2 Warp 4.5 guest driver runtime.
1113#
1114RuntimeOS2GuestR0_TEMPLATE = VBOXOS2GUESTR0LIB
1115RuntimeOS2GuestR0_INCS := $(PATH_SUB_CURRENT)
1116RuntimeOS2GuestR0_DEFS = RT_WITH_VBOX RT_WITHOUT_NOCRT_WRAPPERS
1117RuntimeOS2GuestR0_SOURCES = \
1118 $(filter-out common/misc/assert.cpp generic/RTLogWriteUser-generic.cpp,$(RuntimeR0Drv_SOURCES)) \
1119 $(RuntimeR0Drv_SOURCES.os2) \
1120 VBox/logbackdoor.cpp
1121
1122
1123#
1124# RuntimeGC - Guest context library.
1125#
1126RuntimeGC_TEMPLATE = VBOXGC
1127RuntimeGC_DEFS = IN_RT_GC RT_WITH_VBOX
1128RuntimeGC_SOURCES = \
1129 common/log/log.cpp \
1130 common/log/logcom.cpp \
1131 common/log/logformat.cpp \
1132 common/misc/assert.cpp \
1133 common/misc/sanity-c.c \
1134 common/misc/sanity-cpp.cpp \
1135 common/string/memchr.cpp \
1136 common/string/memcmp.cpp \
1137 common/string/memcpy.cpp \
1138 common/string/memset.cpp \
1139 common/string/strcpy.cpp \
1140 common/string/strformat.cpp \
1141 common/string/strformatrt.cpp \
1142 common/string/strlen.cpp \
1143 common/string/strncmp.cpp \
1144 common/string/strpbrk.cpp \
1145 common/string/strprintf.cpp \
1146 common/table/avllu32.cpp \
1147 common/table/avlogcphys.cpp \
1148 common/table/avlogcptr.cpp \
1149 common/table/avlohcphys.cpp \
1150 common/table/avloioport.cpp \
1151 common/table/avlrogcphys.cpp \
1152 common/table/avlrogcptr.cpp \
1153 common/table/avlroioport.cpp \
1154 common/table/avlroogcptr.cpp \
1155 common/table/avlu32.cpp \
1156 common/time/timeprog.cpp \
1157 common/time/timesup.cpp \
1158 gc/initterm-gc.cpp \
1159 generic/RTAssertDoBreakpoint-generic.cpp \
1160 VBox/strformat-vbox.cpp \
1161
1162#if1of ($(BUILD_TARGET_ARCH),amd64 x86)
1163# RuntimeGC_SOURCES += common/time/timesupA.asm
1164#else
1165 RuntimeGC_SOURCES += common/time/timesupref.cpp
1166#endif
1167
1168RuntimeGC_SOURCES.win.x86 = $(RuntimeWin32ASM_SOURCES)
1169
1170ifeq ($(VBOX_LDR_FMT32),lx)
1171 RuntimeGC_SOURCES += os2/sys0.asm
1172endif
1173
1174ifeq ($(filter-out darwin solaris freebsd,$(BUILD_TARGET)),)
1175RuntimeGC_SOURCES += \
1176 common/math/gcc/adddi3.c \
1177 common/math/gcc/anddi3.c \
1178 common/math/gcc/ashldi3.c \
1179 common/math/gcc/ashrdi3.c \
1180 common/math/gcc/cmpdi2.c \
1181 common/math/gcc/divdi3.c \
1182 common/math/gcc/iordi3.c \
1183 common/math/gcc/lshldi3.c \
1184 common/math/gcc/lshrdi3.c \
1185 common/math/gcc/moddi3.c \
1186 common/math/gcc/muldi3.c \
1187 common/math/gcc/negdi2.c \
1188 common/math/gcc/notdi2.c \
1189 common/math/gcc/qdivrem.c \
1190 common/math/gcc/subdi3.c \
1191 common/math/gcc/ucmpdi2.c \
1192 common/math/gcc/udivdi3.c \
1193 common/math/gcc/umoddi3.c \
1194 common/math/gcc/xordi3.c
1195endif
1196
1197
1198#
1199# Static library for new & delete for the electric fence.
1200#
1201RuntimeEFCPP_TEMPLATE = $(RuntimeR3_TEMPLATE)
1202RuntimeEFCPP_SDKS = $(RuntimeR3_SDKS)
1203RuntimeEFCPP_SDKS.$(BUILD_TARGET) = $(RuntimeR3_SDKS.$(BUILD_TARGET))
1204RuntimeEFCPP_DEFS = $(RuntimeR3_DEFS)
1205RuntimeEFCPP_DEFS.$(BUILD_TARGET) = $(RuntimeR3_DEFS.$(BUILD_TARGET))
1206RuntimeEFCPP_INCS = $(RuntimeR3_INCS)
1207RuntimeEFCPP_INCS.$(BUILD_TARGET) = $(RuntimeR3_INCS.$(BUILD_TARGET))
1208RuntimeEFCPP_SOURCES = r3/alloc-ef-cpp.cpp
1209
1210
1211
1212#
1213# errmsg.cpp depends on a generated header.
1214#
1215common/err/errmsg.cpp_DEPS = $(PATH_TARGET)/errmsgdata.h
1216common/err/errmsg.cpp_INCS = $(PATH_TARGET)
1217
1218win/errmsgwin.cpp_DEPS = $(PATH_TARGET)/errmsgcomdata.h
1219win/errmsgwin.cpp_INCS = $(PATH_TARGET)
1220
1221
1222# Generate the rules
1223include $(PATH_KBUILD)/footer.kmk
1224
1225
1226ifneq ($(wildcard /usr/bin/chcon),)
1227# this is needed for testcases executed at build time
1228$(PATH_BIN)/VBoxRT.so:
1229 $(INSTALL) $(out) $@
1230 chcon -t texrel_shlib_t $@ || true
1231endif
1232
1233
1234#
1235# Generate the status code data.
1236#
1237$(PATH_TARGET)/errmsgdata.h: common/err/errmsg.sed $(DEPTH)/include/iprt/err.h $(DEPTH)/include/VBox/err.h
1238 $(call MSG_GENERATE,,$@,$(filter %.h,$^))
1239 $(QUIET)$(MKDIR) -p $(PATH_TARGET)
1240 $(QUIET)$(REDIRECT) -wo $@ -- $(SED) -f $< $(filter %.h,$^)
1241
1242## @todo r=bird: rename this to indicate that it's not only COM errors, but all win32/64 errors.
1243$(PATH_TARGET)/errmsgcomdata.h: common/err/errmsgcom.sed $(PATH_SDK_WINPSDK_INC)/WinError.h
1244 $(call MSG_GENERATE,,$@,$(filter %.h,$^))
1245 $(QUIET)$(MKDIR) -p $(PATH_TARGET)
1246 $(QUIET)$(REDIRECT) -wo $@ -- $(SED) -f $< $(filter %.h,$^)
1247
1248$(PATH_TARGET)/errmsgxpcomdata.h: common/err/errmsgxpcom.sed $(DEPTH)/src/libs/xpcom18a4/xpcom/base/nsError.h
1249 $(call MSG_GENERATE,,$@,$(filter %.h,$^))
1250 $(QUIET)$(MKDIR) -p $(PATH_TARGET)
1251 $(QUIET)$(REDIRECT) -wo $@ -- $(SED) -f $< $(filter %.h,$^)
1252
1253
1254#
1255# Aliases for .cpp.h files so we can more easily do syntax checking from the editor.
1256#
1257ldrELFRelocatable.cpp.o: ldrELF.o
1258ldrELFRelocatable.cpp.obj: ldrELF.obj
1259
1260
1261#
1262# Doxygen documentation.
1263#
1264DOXYGEN_INPUT_DIRS = \
1265 $(PATH_ROOT)/include/iprt \
1266 $(PATH_ROOT)/include/iprt/nocrt \
1267 $(PATH_ROOT)/include/iprt/nocrt/x86 \
1268 $(PATH_ROOT)/include/iprt/nocrt/amd64 \
1269 include/internal \
1270 common/alloc \
1271 common/checksum \
1272 common/err \
1273 common/ldr \
1274 common/log \
1275 common/misc \
1276 common/string \
1277 common/table \
1278 common/time \
1279 $(foreach dir, . r3 r0drv,\
1280 $(dir) \
1281 $(dir)/darwin \
1282 $(dir)/l4 \
1283 $(dir)/linux \
1284 $(dir)/nt \
1285 $(dir)/os2 \
1286 $(dir)/win \
1287 $(dir)/win32 \
1288 $(dir)/win64 \
1289 $(dir)/generic \
1290 )
1291
1292# These must come first in order to make things look nice.
1293DOXYGEN_INPUT_FIRST =\
1294 $(PATH_ROOT)/include/iprt/cdefs.h \
1295 $(PATH_ROOT)/include/iprt/types.h \
1296 $(PATH_ROOT)/include/iprt/runtime.h \
1297 $(PATH_ROOT)/include/iprt/param.h \
1298 $(PATH_ROOT)/include/iprt/assert.h \
1299 $(PATH_ROOT)/include/iprt/asm.h \
1300
1301DOXYGEN_INPUT := \
1302 $(filter-out %.cpp.h, $(sort $(wildcard $(addsuffix /*.h, $(DOXYGEN_INPUT_DIRS)))) ) \
1303 $(foreach dir, $(DOXYGEN_INPUT_DIRS), $(wildcard $(dir)/*.cpp $(dir)/.c $(dir)/.asm))
1304DOXYGEN_INPUT := \
1305 $(DOXYGEN_INPUT_FIRST) \
1306 $(filter-out $(DOXYGEN_INPUT_FIRST), $(DOXYGEN_INPUT))
1307
1308
1309DOXYGEN_OUTPUT = $(PATH_OUT)/docs/iprt
1310
1311-include $(PATH_TARGET)/Doxyfile.dep
1312
1313# Generate the Doxyfile
1314$(PATH_TARGET)/Doxyfile: Doxyfile \
1315 $(comp-vars DOXYGEN_INPUT,DOXYGEN_INPUT_PREV,FORCE) \
1316 $(comp-vars DOXYGEN_OUTPUT,DOXYGEN_OUTPUT_PREV,FORCE) \
1317 | $(call DIRDEP, $(PATH_TARGET))
1318 $(RM) -f $@ [email protected] $(PATH_TARGET)/Doxyfile.dep
1319 $(CP) -f Doxyfile [email protected]
1320 $(APPEND) [email protected]
1321 $(APPEND) [email protected] "OUTPUT_DIRECTORY = $(DOXYGEN_OUTPUT)"
1322 $(APPEND) [email protected] "WARN_LOGFILE = $(DOXYGEN_OUTPUT)/errors"
1323 $(APPEND) [email protected] "INCLUDE_PATH = $(PATH_ROOT)/include include . common/table"
1324 $(APPEND) [email protected] "INCLUDE_FILE_PATTERNS = *.cpp.h"
1325 $(APPEND) [email protected]
1326 $(APPEND) [email protected] "INPUT = $(DOXYGEN_INPUT)"
1327 $(APPEND) [email protected]
1328 $(MV) -f [email protected] $@
1329 @$(APPEND) $(PATH_TARGET)/Doxyfile.dep "DOXYGEN_OUTPUT_PREV = $(DOXYGEN_OUTPUT)"
1330 @$(APPEND) $(PATH_TARGET)/Doxyfile.dep "DOXYGEN_INPUT_PREV = $(DOXYGEN_INPUT)"
1331
1332# Create the output directory.
1333$(call DIRDEP, $(DOXYGEN_OUTPUT)):
1334 $(MKDIR) -p $@
1335
1336# Do the actual job.
1337$(PATH_TARGET)/docs.iprt: $(PATH_TARGET)/Doxyfile $(DOXYGEN_INPUT) | $(call DIRDEP, $(DOXYGEN_OUTPUT))
1338 $(RM) -f $(wildcard $(DOXYGEN_OUTPUT)/html/*) $(PATH_TARGET)/docs.iprt
1339 doxygen $(PATH_TARGET)/Doxyfile
1340 $(APPEND) $(PATH_TARGET)/docs.iprt
1341
1342# alias
1343docs: $(PATH_TARGET)/docs.iprt
1344
1345test:
1346 @echo test-$(comp-vars DOXYGEN_OUTPUT,DOXYGEN_OUTPUT_PREV,FORCE)
1347 @echo $(DOXYGEN_OUTPUT)
1348 @echo $(DOXYGEN_OUTPUT_PREV)
1349
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette