VirtualBox

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

Last change on this file since 25379 was 25368, checked in by vboxsync, 15 years ago

RTCritSect,PDMCritSect,iprt/lockvalidator.h: Reworked the deadlocking detection for critical sections and preparing for lock order validation. This change generalizes the RTCRITSECT::Strict data and moves it out of the RTCRITSECT, leaving a pointer behind. This saves a bit of space in release builds.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 55.2 KB
Line 
1# $Id: Makefile.kmk 25368 2009-12-14 16:31:40Z vboxsync $
2## @file
3# Sub-Makefile for the IPRT (IPRT).
4#
5
6#
7# Copyright (C) 2006-2007 Sun Microsystems, Inc.
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# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
27# Clara, CA 95054 USA or visit http://www.sun.com if you need
28# additional information or have any questions.
29#
30
31SUB_DEPTH = ../../..
32include $(KBUILD_PATH)/subheader.kmk
33
34ifdef VBOX_ONLY_ADDITIONS
35 #
36 # Only build the additions, sort out the legacy names first.
37 #
38 LIBRARIES += RuntimeGuestR3 RuntimeGuestR3Shared RuntimeGuestR3Mini
39 ifdef VBOX_WITH_ADDITION_DRIVERS
40 LIBRARIES += RuntimeGuestR0
41 endif
42 #LIBRARIES.os2 += RuntimeGuestR0OS2Warp3
43 LIBRARIES.win.x86 += RuntimeGuestR0NT4
44
45else ifdef VBOX_ONLY_DOCS
46 #
47 # Build docs only - need just regular R3 runtime.
48 #
49 LIBRARIES += RuntimeR3
50 DLLS += VBoxRT
51
52else # !VBOX_ONLY_ADDITIONS && !VBOX_ONLY_DOCS
53
54 #
55 # Normal build.
56 #
57 include $(PATH_SUB_CURRENT)/testcase/Makefile.kmk
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 LIBRARIES += RuntimeGuestR3 RuntimeGuestR3Shared RuntimeGuestR3Mini
66 ifdef VBOX_WITH_ADDITION_DRIVERS
67 LIBRARIES += RuntimeGuestR0
68 endif
69 #LIBRARIES.os2 += RuntimeGuestR0OS2Warp3
70 LIBRARIES.win.x86 += RuntimeGuestR0NT4
71 endif # VBOX_WITH_ADDITIONS
72 LIBRARIES.l4 += RuntimeR3L4 RuntimeLnxHostR3
73 DLLS += VBoxRT
74endif
75
76# Where the generated stuff goes.
77IPRT_OUT_DIR := $(PATH_TARGET)/Runtime
78BLDDIRS += $(IPRT_OUT_DIR)
79OTHER_CLEAN += \
80 $(IPRT_OUT_DIR)/errmsgdata.h \
81 $(IPRT_OUT_DIR)/errmsgcomdata.h \
82 $(IPRT_OUT_DIR)/errmsgvboxcomdata.h \
83 $(IPRT_OUT_DIR)/Doxyfile.iprt \
84 $(IPRT_OUT_DIR)/Doxyfile.iprt.dep \
85 $(IPRT_OUT_DIR)/docs.iprt
86
87
88#
89# Globals
90#
91VBOX_PATH_RUNTIME_SRC := $(PATH_SUB_CURRENT)
92
93
94#
95# Set the defines that buildconfig.cpp needs. Its used by several targets.
96#
97common/misc/buildconfig.cpp_DEFS = \
98 IPRT_BLDCFG_SCM_REV=$(VBOX_SVN_REV) \
99 IPRT_BLDCFG_VERSION_STRING=\"$(VBOX_VERSION_STRING)\" \
100 IPRT_BLDCFG_VERSION_MAJOR=$(VBOX_VERSION_MAJOR) \
101 IPRT_BLDCFG_VERSION_MINOR=$(VBOX_VERSION_MINOR) \
102 IPRT_BLDCFG_VERSION_BUILD=$(VBOX_VERSION_BUILD)
103
104#
105# Unicode Specification reader used to regenerate unidata.cpp.
106#
107uniread_TEMPLATE = VBOXBLDPROG
108uniread_SOURCES = common/string/uniread.cpp
109uniread_INCS = include
110
111#
112# Win64 assembly sources.
113#
114RuntimeWin64ASM_SOURCES = \
115 win/amd64/ASMAtomicBitClear.asm \
116 win/amd64/ASMAtomicBitTestAndToggle.asm \
117 win/amd64/ASMAtomicBitToggle.asm \
118 win/amd64/ASMAtomicReadU64.asm \
119 win/amd64/ASMAtomicXchgU16.asm \
120 win/amd64/ASMAtomicXchgU8.asm \
121 win/amd64/ASMBitFirstClear.asm \
122 win/amd64/ASMBitFirstSet.asm \
123 win/amd64/ASMGetCS.asm \
124 win/amd64/ASMGetDS.asm \
125 win/amd64/ASMGetES.asm \
126 win/amd64/ASMGetFlags.asm \
127 win/amd64/ASMGetFS.asm \
128 win/amd64/ASMGetGS.asm \
129 win/amd64/ASMGetIDTR.asm \
130 win/amd64/ASMGetGDTR.asm \
131 win/amd64/ASMGetTR.asm \
132 win/amd64/ASMGetSS.asm \
133 win/amd64/ASMProbeReadByte.asm \
134 win/amd64/ASMSetFlags.asm \
135 win/amd64/ASMGetDR0.asm \
136 win/amd64/ASMGetDR1.asm \
137 win/amd64/ASMGetDR2.asm \
138 win/amd64/ASMGetDR3.asm \
139 win/amd64/ASMGetDR6.asm \
140 win/amd64/ASMGetDR7.asm \
141 common/asm/ASMMultU64ByU32DivByU32.asm \
142 common/asm/ASMNopPause.asm
143
144#
145# Win32 assembly sources.
146#
147RuntimeWin32ASM_SOURCES = \
148 common/asm/ASMMultU64ByU32DivByU32.asm
149
150#
151# NoCRT sources (minus math stuff).
152#
153RuntimeNoCrt_SOURCES = \
154 common/misc/setjmp.asm \
155 common/string/memchr.asm \
156 common/string/memcmp.asm \
157 common/string/memcpy.asm \
158 common/string/mempcpy.asm \
159 common/string/memmove.asm \
160 common/string/memset.asm \
161 common/string/strchr.asm \
162 common/string/strcpy.asm \
163 common/string/strcmp.asm \
164 common/string/strlen.asm
165
166
167#
168# RuntimeR3 - Static Runtime for Ring-3 executables.
169#
170RuntimeR3_TEMPLATE = VBOXR3STATIC
171RuntimeR3_SDKS = VBOX_LIBXML2 VBOX_BOOST
172RuntimeR3_SDKS.win = WINPSDK W2K3DDK
173RuntimeR3_DEFS = IN_RT_R3 IN_SUP_R3 LDR_WITH_NATIVE LDR_WITH_ELF32 LDR_WITH_PE RT_WITH_VBOX RT_NO_GIP
174ifdef IPRT_WITH_KSTUFF
175 RuntimeR3_DEFS += LDR_WITH_KLDR
176endif
177ifdef VBOX_MAIN_RELEASE_LOG ## @todo (dmik): temporary, until RTThreadSelf/RTThreadAdopt are properly updated
178 RuntimeR3_DEFS += RTCRITSECT_STRICT
179endif
180ifdef IPRT_WITH_LZJB
181 RuntimeR3_DEFS += RTZIP_USE_LZJB
182endif
183ifdef IPRT_WITH_LZO
184 RuntimeR3_DEFS += RTZIP_USE_LZO
185endif
186ifdef IPRT_WITH_FUTEX_BASED_SEMS
187 RuntimeR3_DEFS.linux += IPRT_WITH_FUTEX_BASED_SEMS
188endif
189RuntimeR3_INCS = \
190 include \
191 $(SDK_VBOX_ZLIB_INCS)
192RuntimeR3_INCS += \
193 $(PATH_ROOT)/src/libs/liblzf-3.4
194ifdef IPRT_WITH_KSTUFF
195 RuntimeR3_INCS += \
196 $(PATH_ROOT)/src/libs/kStuff/kStuff/include
197endif
198RuntimeR3_INCS.l4 = \
199 $(L4_INCDIR)
200
201# RuntimeR3_INCS.solaris = \
202# /usr/include
203
204RuntimeR3_SOURCES = \
205 common/alloc/alloc.cpp \
206 common/alloc/heapsimple.cpp \
207 common/alloc/heapoffset.cpp \
208 common/checksum/adler32.cpp \
209 common/checksum/crc32-zlib.cpp \
210 common/checksum/crc64.cpp \
211 common/checksum/md5.cpp \
212 common/checksum/md5str.cpp \
213 common/checksum/ipv4.cpp \
214 common/dbg/dbg.cpp \
215 common/dbg/dbgas.cpp \
216 common/dbg/dbgmod.cpp \
217 common/dbg/dbgmodcontainer.cpp \
218 common/dbg/dbgmodnm.cpp \
219 common/err/errmsg.cpp \
220 common/err/RTErrConvertFromErrno.cpp \
221 common/err/RTErrConvertToErrno.cpp \
222 common/ldr/ldr.cpp \
223 common/ldr/ldrELF.cpp \
224 common/ldr/ldrEx.cpp \
225 common/ldr/ldrFile.cpp \
226 common/ldr/ldrNative.cpp \
227 common/ldr/ldrPE.cpp \
228 common/log/log.cpp \
229 common/log/logellipsis.cpp \
230 common/log/logrel.cpp \
231 common/log/logrelellipsis.cpp \
232 common/log/logcom.cpp \
233 common/log/logformat.cpp \
234 common/misc/assert.cpp \
235 common/misc/buildconfig.cpp \
236 common/misc/cache.cpp \
237 common/misc/cidr.cpp \
238 common/misc/getopt.cpp \
239 common/misc/handletable.cpp \
240 common/misc/handletablectx.cpp \
241 common/misc/handletablesimple.cpp \
242 common/misc/lockvalidator.cpp \
243 common/misc/message.cpp \
244 common/misc/once.cpp \
245 common/misc/req.cpp \
246 common/misc/sanity-c.c \
247 common/misc/sanity-cpp.cpp \
248 common/misc/semspingpong.cpp \
249 common/misc/thread.cpp \
250 common/misc/zip.cpp \
251 common/misc/term.cpp \
252 common/misc/tar.cpp \
253 common/path/rtPathVolumeSpecLen.cpp \
254 common/path/RTPathAbsDup.cpp \
255 common/path/RTPathAbsEx.cpp \
256 common/path/RTPathAbsExDup.cpp \
257 common/path/RTPathAppend.cpp \
258 common/path/RTPathExt.cpp \
259 common/path/RTPathFilename.cpp \
260 common/path/RTPathHaveExt.cpp \
261 common/path/RTPathHavePath.cpp \
262 common/path/RTPathParse.cpp \
263 common/path/RTPathRealDup.cpp \
264 common/path/RTPathStripExt.cpp \
265 common/path/RTPathStripFilename.cpp \
266 common/path/RTPathStripTrailingSlash.cpp \
267 common/path/RTPathTraverseList.cpp \
268 common/path/comparepaths.cpp \
269 common/rand/rand.cpp \
270 common/rand/randadv.cpp \
271 common/rand/randparkmiller.cpp \
272 common/string/RTStrCmp.cpp \
273 common/string/RTStrConvertHexBytes.cpp \
274 common/string/RTStrNCmp.cpp \
275 common/string/RTStrNLen.cpp \
276 common/string/RTStrNLenEx.cpp \
277 common/string/RTStrPrintHexBytes.cpp \
278 common/string/RTStrStr.cpp \
279 common/string/base64.cpp \
280 common/string/simplepattern.cpp \
281 common/string/straprintf.cpp \
282 common/string/strformat.cpp \
283 common/string/strformatrt.cpp \
284 common/string/strformattype.cpp \
285 common/string/string.cpp \
286 common/string/strprintf.cpp \
287 common/string/strspace.cpp \
288 common/string/strstrip.cpp \
289 common/string/strtonum.cpp \
290 common/string/strversion.cpp \
291 common/string/uni.cpp \
292 common/string/unidata.cpp \
293 common/string/utf-16.cpp \
294 common/string/utf-8.cpp \
295 common/string/utf-8-case.cpp \
296 common/string/ministring.cpp \
297 common/table/avlgcptr.cpp \
298 common/table/avlhcphys.cpp \
299 common/table/avllu32.cpp \
300 common/table/avlou32.cpp \
301 common/table/avlogcphys.cpp \
302 common/table/avlogcptr.cpp \
303 common/table/avlohcphys.cpp \
304 common/table/avloioport.cpp \
305 common/table/avlpv.cpp \
306 common/table/avlrgcptr.cpp \
307 common/table/avlrogcphys.cpp \
308 common/table/avlrogcptr.cpp \
309 common/table/avlroioport.cpp \
310 common/table/avlroogcptr.cpp \
311 common/table/avlruintptr.cpp \
312 common/table/avlrfoff.cpp \
313 common/table/avlu32.cpp \
314 common/table/avluintptr.cpp \
315 common/table/avlul.cpp \
316 common/table/table.cpp \
317 common/time/time.cpp \
318 common/time/timeprog.cpp \
319 common/time/timesup.cpp \
320 generic/critsect-generic.cpp \
321 generic/env-generic.cpp \
322 generic/RTDirCreateTemp-generic.cpp \
323 generic/RTFileCopy-generic.cpp \
324 generic/RTFileQuerySize-generic.cpp \
325 generic/RTFileReadAll-generic.cpp \
326 generic/RTFileReadAllEx-generic.cpp \
327 generic/RTFileReadAllByHandle-generic.cpp \
328 generic/RTFileReadAllByHandleEx-generic.cpp \
329 generic/RTFileReadAllFree-generic.cpp \
330 generic/RTLogWriteStdErr-generic.cpp \
331 generic/RTLogWriteStdOut-generic.cpp \
332 generic/RTLogWriteUser-generic.cpp \
333 generic/RTMpGetDescription-generic.cpp \
334 generic/RTTimerLRCreate-generic.cpp \
335 generic/mempool-generic.cpp \
336 generic/semfastmutex-generic.cpp \
337 generic/spinlock-generic.cpp \
338 generic/strcache-stubs-generic.cpp \
339 generic/timerlr-generic.cpp \
340 r3/alloc-ef.cpp \
341 r3/alloc.cpp \
342 r3/dir.cpp \
343 r3/fileio.cpp \
344 r3/fs.cpp \
345 r3/init.cpp \
346 r3/path.cpp \
347 r3/process.cpp \
348 r3/stream.cpp \
349 r3/test.cpp \
350 r3/testi.cpp \
351 r3/tcp.cpp \
352 r3/generic/semspinmutex-r3-generic.cpp
353
354#if1of ($(KBUILD_TARGET_ARCH),amd64 x86)
355# RuntimeR3_SOURCES += common/time/timesupA.asm
356#else
357 RuntimeR3_SOURCES += common/time/timesupref.cpp
358#endif
359
360ifdef IPRT_WITH_LZJB
361 RuntimeR3_SOURCES += common/misc/lzjb.c
362endif
363
364# Some versions of GCC might require this.
365RuntimeR3_SOURCES.x86 += \
366 common/asm/ASMAtomicCmpXchgU64.asm \
367 common/asm/ASMAtomicReadU64.asm
368
369ifdef IPRT_WITH_KSTUFF
370 RuntimeR3_SOURCES += \
371 common/ldr/ldrkStuff.cpp
372endif
373
374# VBox specific stuff.
375RuntimeR3_SOURCES += \
376 VBox/strformat-vbox.cpp \
377 VBox/RTAssertShouldPanic-vbox.cpp \
378 VBox/log-vbox.cpp
379ifneq ($(KBUILD_TARGET),win)
380RuntimeR3_SOURCES += \
381 common/err/errmsgxpcom.cpp
382endif
383if1of ($(KBUILD_TARGET),freebsd linux netbsd openbsd solaris)
384RuntimeR3_SOURCES += \
385 $(if $(VBOX_WITH_DBUS),VBox/dbus.cpp,)
386endif
387
388RuntimeR3_SOURCES.win = \
389 generic/RTDirExists-generic.cpp \
390 generic/RTDirQueryInfo-generic.cpp \
391 generic/RTDirSetTimes-generic.cpp \
392 generic/RTFileExists-generic.cpp \
393 generic/RTMpGetCurFrequency-generic.cpp \
394 generic/RTMpGetMaxFrequency-generic.cpp \
395 generic/RTRandAdvCreateSystemFaster-generic.cpp \
396 generic/RTRandAdvCreateSystemTruer-generic.cpp \
397 generic/mppresent-generic.cpp \
398 generic/semnoint-generic.cpp \
399 generic/semsrw-generic.cpp \
400 generic/uuid-generic.cpp \
401 generic/RTProcIsRunningByName-generic.cpp \
402 nt/RTErrConvertFromNtStatus.cpp \
403 r3/posix/env-posix.cpp \
404 r3/win/RTSystemQueryOSInfo-win.cpp \
405 r3/win/alloc-win.cpp \
406 r3/win/dir-win.cpp \
407 r3/win/fileio-win.cpp \
408 r3/win/fs-win.cpp \
409 r3/win/ldrNative-win.cpp \
410 r3/win/localipc-win.cpp \
411 r3/win/mp-win.cpp \
412 r3/win/path-win.cpp \
413 r3/win/process-win.cpp \
414 r3/win/RTLogWriteDebugger-win.cpp \
415 r3/win/rtProcInitExePath-win.cpp \
416 r3/win/sched-win.cpp \
417 r3/win/sems-win.cpp \
418 r3/win/rtFileNativeSetAttributes-win.cpp \
419 r3/win/thread-win.cpp \
420 r3/win/time-win.cpp \
421 r3/win/timer-win.cpp \
422 r3/win/tls-win.cpp \
423 r3/win/utf16locale-win.cpp \
424 r3/win/utf8-win.cpp \
425 r3/win/RTUuidCreate-win.cpp \
426 win/errmsgwin.cpp \
427 win/RTErrConvertFromWin32.cpp
428
429RuntimeR3_SOURCES.win.amd64 = $(RuntimeWin64ASM_SOURCES)
430RuntimeR3_SOURCES.win.x86 = $(RuntimeWin32ASM_SOURCES)
431
432RuntimeR3_SOURCES.linux = \
433 generic/pathhost-generic.cpp \
434 generic/RTDirQueryInfo-generic.cpp \
435 generic/RTDirSetTimes-generic.cpp \
436 generic/RTFileMove-generic.cpp \
437 generic/RTLogWriteDebugger-generic.cpp \
438 generic/RTTimeLocalNow-generic.cpp \
439 generic/RTTimerCreate-generic.cpp \
440 generic/RTUuidCreate-generic.cpp \
441 generic/mppresent-generic.cpp \
442 generic/utf16locale-generic.cpp \
443 generic/uuid-generic.cpp \
444 r3/linux/mp-linux.cpp \
445 r3/linux/rtProcInitExePath-linux.cpp \
446 r3/linux/sched-linux.cpp \
447 r3/linux/sysfs.cpp \
448 r3/linux/time-linux.cpp \
449 r3/linux/RTProcIsRunningByName-linux.cpp \
450 r3/posix/RTFileQueryFsSizes-posix.cpp \
451 r3/posix/RTSystemQueryOSInfo-posix.cpp \
452 r3/posix/alloc-posix.cpp \
453 r3/posix/dir-posix.cpp \
454 r3/posix/env-posix.cpp \
455 r3/posix/fileio-posix.cpp \
456 r3/posix/filelock-posix.cpp \
457 r3/posix/fs-posix.cpp \
458 r3/posix/ldrNative-posix.cpp \
459 r3/posix/path-posix.cpp \
460 r3/posix/process-posix.cpp \
461 r3/posix/rand-posix.cpp \
462 r3/posix/RTTimeNow-posix.cpp \
463 r3/posix/semrw-posix.cpp \
464 r3/posix/thread-posix.cpp \
465 r3/posix/timelocal-posix.cpp \
466 r3/posix/timer-posix.cpp \
467 r3/posix/tls-posix.cpp \
468 r3/posix/utf8-posix.cpp
469ifdef IPRT_WITH_FUTEX_BASED_SEMS
470 RuntimeR3_SOURCES.linux += \
471 r3/linux/semevent-linux.cpp \
472 r3/linux/semeventmulti-linux.cpp \
473 r3/linux/semmutex-linux.cpp
474else
475 RuntimeR3_SOURCES.linux.x86 += \
476 r3/posix/semevent-posix.cpp \
477 r3/posix/semeventmulti-posix.cpp \
478 r3/posix/semmutex-posix.cpp
479 RuntimeR3_SOURCES.linux.amd64 += \
480 r3/linux/semevent-linux.cpp \
481 r3/linux/semeventmulti-linux.cpp
482 ifdef RT_NEW_LINUX_MUTEX_CODE
483 RuntimeR3_SOURCES.linux.amd64 += \
484 r3/linux/semmutex-linux.cpp
485 else
486 RuntimeR3_SOURCES.linux.amd64 += \
487 r3/posix/semmutex-posix.cpp
488 endif
489endif
490
491RuntimeR3_SOURCES.os2 = \
492 generic/pathhost-generic.cpp \
493 generic/RTDirQueryInfo-generic.cpp \
494 generic/RTDirSetTimes-generic.cpp \
495 generic/RTFileMove-generic.cpp \
496 generic/RTLogWriteDebugger-generic.cpp \
497 generic/RTRandAdvCreateSystemFaster-generic.cpp \
498 generic/RTRandAdvCreateSystemTruer-generic.cpp \
499 generic/RTTimeLocalNow-generic.cpp \
500 generic/RTTimerCreate-generic.cpp \
501 generic/RTUuidCreate-generic.cpp \
502 generic/mppresent-generic.cpp \
503 generic/semnoint-generic.cpp \
504 generic/semsrw-generic.cpp \
505 generic/timer-generic.cpp \
506 generic/utf16locale-generic.cpp \
507 generic/uuid-generic.cpp \
508 generic/RTMpGetCurFrequency-generic.cpp \
509 generic/RTMpGetMaxFrequency-generic.cpp \
510 generic/RTProcIsRunningByName-generic.cpp \
511 os2/RTErrConvertFromOS2.cpp \
512 r3/os2/filelock-os2.cpp \
513 r3/os2/mp-os2.cpp \
514 r3/os2/rtProcInitExePath-os2.cpp \
515 r3/os2/sched-os2.cpp \
516 r3/os2/sems-os2.cpp \
517 r3/os2/thread-os2.cpp \
518 r3/os2/time-os2.cpp \
519 r3/posix/RTFileQueryFsSizes-posix.cpp \
520 r3/posix/RTSystemQueryOSInfo-posix.cpp \
521 r3/posix/alloc-posix.cpp \
522 r3/posix/dir-posix.cpp \
523 r3/posix/env-posix.cpp \
524 r3/posix/fileio-posix.cpp \
525 r3/posix/fs-posix.cpp \
526 r3/posix/ldrNative-posix.cpp \
527 r3/posix/path-posix.cpp \
528 r3/posix/process-posix.cpp \
529 r3/posix/RTTimeNow-posix.cpp \
530 r3/posix/timelocal-posix.cpp \
531 r3/posix/utf8-posix.cpp
532
533RuntimeR3_SOURCES.darwin = \
534 darwin/RTErrConvertFromDarwin.cpp \
535 darwin/RTErrConvertFromDarwinCOM.cpp \
536 darwin/RTErrConvertFromDarwinIO.cpp \
537 darwin/RTErrConvertFromDarwinKern.cpp \
538 generic/pathhost-generic.cpp \
539 generic/RTDirQueryInfo-generic.cpp \
540 generic/RTDirSetTimes-generic.cpp \
541 generic/RTFileMove-generic.cpp \
542 generic/RTLogWriteDebugger-generic.cpp \
543 generic/RTTimeLocalNow-generic.cpp \
544 generic/RTTimerCreate-generic.cpp \
545 generic/RTUuidCreate-generic.cpp \
546 generic/mppresent-generic.cpp \
547 generic/timer-generic.cpp \
548 generic/utf16locale-generic.cpp \
549 generic/uuid-generic.cpp\
550 generic/RTProcIsRunningByName-generic.cpp \
551 r3/darwin/alloc-darwin.cpp \
552 r3/darwin/filelock-darwin.cpp \
553 r3/darwin/mp-darwin.cpp \
554 r3/darwin/rtProcInitExePath-darwin.cpp \
555 r3/darwin/sched-darwin.cpp \
556 r3/darwin/time-darwin.cpp \
557 r3/posix/RTFileQueryFsSizes-posix.cpp \
558 r3/posix/RTSystemQueryOSInfo-posix.cpp \
559 r3/posix/dir-posix.cpp \
560 r3/posix/env-posix.cpp \
561 r3/posix/fileio-posix.cpp \
562 r3/posix/fs-posix.cpp \
563 r3/posix/ldrNative-posix.cpp \
564 r3/posix/path-posix.cpp \
565 r3/posix/process-posix.cpp \
566 r3/posix/rand-posix.cpp \
567 r3/posix/semevent-posix.cpp \
568 r3/posix/semeventmulti-posix.cpp \
569 r3/posix/semmutex-posix.cpp \
570 r3/posix/semrw-posix.cpp \
571 r3/posix/thread-posix.cpp \
572 r3/posix/timelocal-posix.cpp \
573 r3/posix/tls-posix.cpp \
574 r3/posix/utf8-posix.cpp
575
576## @todo Make BSD sched, implement RTMP*.
577RuntimeR3_SOURCES.freebsd = \
578 generic/pathhost-generic.cpp \
579 generic/RTDirQueryInfo-generic.cpp \
580 generic/RTDirSetTimes-generic.cpp \
581 generic/RTFileMove-generic.cpp \
582 generic/RTLogWriteDebugger-generic.cpp \
583 generic/RTTimeLocalNow-generic.cpp \
584 generic/RTTimerCreate-generic.cpp \
585 generic/RTUuidCreate-generic.cpp \
586 generic/mppresent-generic.cpp \
587 generic/sched-generic.cpp \
588 generic/utf16locale-generic.cpp \
589 generic/uuid-generic.cpp \
590 generic/RTMpCpuId-generic.cpp \
591 generic/RTMpCpuIdFromSetIndex-generic.cpp \
592 generic/RTMpCpuIdToSetIndex-generic.cpp \
593 generic/RTMpIsCpuPossible-generic.cpp \
594 generic/RTMpGetMaxCpuId-generic.cpp \
595 generic/RTMpGetOnlineSet-generic.cpp \
596 generic/RTMpGetSet-generic.cpp \
597 generic/RTMpIsCpuOnline-generic.cpp \
598 generic/RTProcIsRunningByName-generic.cpp \
599 r3/freebsd/mp-freebsd.cpp \
600 r3/freebsd/alloc-freebsd.cpp \
601 r3/freebsd/rtProcInitExePath-freebsd.cpp \
602 r3/posix/RTFileQueryFsSizes-posix.cpp \
603 r3/posix/RTSystemQueryOSInfo-posix.cpp \
604 r3/posix/dir-posix.cpp \
605 r3/posix/env-posix.cpp \
606 r3/posix/fileio-posix.cpp \
607 r3/posix/filelock-posix.cpp \
608 r3/posix/fs-posix.cpp \
609 r3/posix/ldrNative-posix.cpp \
610 r3/posix/path-posix.cpp \
611 r3/posix/process-posix.cpp \
612 r3/posix/rand-posix.cpp \
613 r3/posix/RTMpGetCount-posix.cpp \
614 r3/posix/RTTimeNow-posix.cpp \
615 r3/posix/semevent-posix.cpp \
616 r3/posix/semeventmulti-posix.cpp \
617 r3/posix/semmutex-posix.cpp \
618 r3/posix/semrw-posix.cpp \
619 r3/posix/thread-posix.cpp \
620 r3/posix/time-posix.cpp \
621 r3/posix/timelocal-posix.cpp \
622 r3/posix/timer-posix.cpp \
623 r3/posix/tls-posix.cpp \
624 r3/posix/utf8-posix.cpp
625
626RuntimeR3_SOURCES.solaris = \
627 generic/pathhost-generic.cpp \
628 generic/RTDirQueryInfo-generic.cpp \
629 generic/RTDirSetTimes-generic.cpp \
630 generic/RTFileMove-generic.cpp \
631 generic/RTLogWriteDebugger-generic.cpp \
632 generic/RTTimeLocalNow-generic.cpp \
633 generic/RTTimerCreate-generic.cpp \
634 generic/RTUuidCreate-generic.cpp \
635 generic/sched-generic.cpp \
636 generic/utf16locale-generic.cpp \
637 generic/uuid-generic.cpp \
638 generic/RTProcIsRunningByName-generic.cpp \
639 r3/posix/RTFileQueryFsSizes-posix.cpp \
640 r3/posix/RTSystemQueryOSInfo-posix.cpp \
641 r3/posix/dir-posix.cpp \
642 r3/posix/env-posix.cpp \
643 r3/posix/fileio-posix.cpp \
644 r3/posix/filelock-posix.cpp \
645 r3/posix/fs-posix.cpp \
646 r3/posix/ldrNative-posix.cpp \
647 r3/posix/path-posix.cpp \
648 r3/posix/process-posix.cpp \
649 r3/posix/rand-posix.cpp \
650 r3/posix/RTTimeNow-posix.cpp \
651 r3/posix/semevent-posix.cpp \
652 r3/posix/semeventmulti-posix.cpp \
653 r3/posix/semmutex-posix.cpp \
654 r3/posix/semrw-posix.cpp \
655 r3/posix/thread-posix.cpp \
656 r3/posix/time-posix.cpp \
657 r3/posix/timelocal-posix.cpp \
658 r3/posix/timer-posix.cpp \
659 r3/posix/tls-posix.cpp \
660 r3/posix/utf8-posix.cpp \
661 r3/solaris/alloc-solaris.cpp \
662 r3/solaris/mp-solaris.cpp \
663 r3/solaris/rtProcInitExePath-solaris.cpp \
664
665## PORTME: Porters add their selection of platform specific files for Ring-3 here.
666
667
668#
669# L4 RuntimeR3 subtarget since L4 headers won't work with VBOXR3.
670#
671RuntimeR3L4_TEMPLATE = VBOXR3NP
672RuntimeR3L4_DEFS = IN_RT_R3 IN_SUP_R3 LDR_WITH_NATIVE LDR_WITH_ELF LDR_WITH_PE
673ifneq ($(KBUILD_TARGET_ARCH),amd64)
674RuntimeR3L4_DEFS += __PIC__
675endif
676RuntimeR3L4_INCS = \
677 include \
678 $(L4_INCDIR)
679
680RuntimeR3L4_SOURCES = \
681 generic/fs-stubs-generic.cpp \
682 generic/pathhost-generic.cpp \
683 generic/RTDirQueryInfo-generic.cpp \
684 generic/RTDirSetTimes-generic.cpp \
685 generic/RTFileMove-generic.cpp \
686 generic/RTLogWriteDebugger-generic.cpp \
687 generic/RTSystemQueryOSInfo-generic.cpp \
688 generic/RTTimeLocalNow-generic.cpp \
689 generic/RTUuidCreate-generic.cpp \
690 generic/mppresent-generic.cpp \
691 generic/sched-generic.cpp \
692 generic/semnoint-generic.cpp \
693 generic/semsrw-generic.cpp \
694 generic/utf16locale-generic.cpp \
695 generic/uuid-generic.cpp \
696 generic/RTProcIsRunningByName-generic.cpp \
697 l4/l4-errno.cpp \
698 l4/rtProcInitExePath-l4.cpp \
699 l4/process-l4env.cpp \
700 l4/sems-l4env.cpp \
701 l4/thread-l4env.cpp \
702 l4/timer-l4env.cpp \
703 l4/utf8-l4env.cpp \
704 r3/posix/RTFileQueryFsSizes-posix.cpp \
705 r3/posix/alloc-posix.cpp \
706 r3/posix/dir-posix.cpp \
707 r3/posix/env-posix.cpp \
708 r3/posix/fileio-posix.cpp \
709 r3/posix/filelock-posix.cpp \
710 r3/posix/ldrNative-posix.cpp \
711 r3/posix/path-posix.cpp \
712 r3/posix/rand-posix.cpp \
713 r3/posix/RTTimeNow-posix.cpp \
714 r3/posix/time-posix.cpp \
715 r3/posix/timelocal-posix.cpp
716
717
718#
719# RuntimeGuestR3 - Guest Additions Runtime (static/exe).
720# (The KBUILD_HOST inheritance here is for l4 cross building the linux
721# additions, while .x86 is for cross building x86 while targeting amd64.)
722#
723RuntimeGuestR3_TEMPLATE := VBOXGUESTR3LIB
724## @todo change this to EXTEND the RuntimeR3 target.
725RuntimeGuestR3_SDKS.win := $(RuntimeR3_SDKS.win)
726RuntimeGuestR3_DEFS := $(filter-out RTCRITSECT_STRICT RT_NO_GIP, $(RuntimeR3_DEFS))
727RuntimeGuestR3_DEFS.$(KBUILD_TARGET) := $(RuntimeR3_DEFS.$(KBUILD_TARGET))
728RuntimeGuestR3_DEFS.$(KBUILD_HOST) := $(RuntimeR3_DEFS.$(KBUILD_HOST))
729RuntimeGuestR3_INCS := $(RuntimeR3_INCS)
730RuntimeGuestR3_INCS.$(KBUILD_TARGET) := $(RuntimeR3_INCS.$(KBUILD_TARGET))
731RuntimeGuestR3_INCS.$(KBUILD_HOST) := $(RuntimeR3_INCS.$(KBUILD_HOST))
732RuntimeGuestR3_SOURCES := $(filter-out \
733 common/time/timesupref.cpp \
734 common/time/timesupA.asm \
735 common/time/timesup.cpp \
736 generic/RTLogWriteUser-generic.cpp \
737 , $(RuntimeR3_SOURCES))
738RuntimeGuestR3_SOURCES += \
739 common/time/timesysalias.cpp \
740 VBox/logbackdoor.cpp
741RuntimeGuestR3_SOURCES.$(KBUILD_TARGET) := $(RuntimeR3_SOURCES.$(KBUILD_TARGET))
742RuntimeGuestR3_SOURCES.$(KBUILD_HOST) := $(RuntimeR3_SOURCES.$(KBUILD_HOST))
743RuntimeGuestR3_SOURCES.$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH) := $(RuntimeR3_SOURCES.$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH))
744RuntimeGuestR3_SOURCES.$(KBUILD_HOST).$(KBUILD_TARGET_ARCH) := $(RuntimeR3_SOURCES.$(KBUILD_HOST).$(KBUILD_TARGET_ARCH))
745
746
747#
748# RuntimeGuestR3Shared - Guest Additions Runtime (static/dll).
749#
750RuntimeGuestR3Shared_TEMPLATE := VBOXGUESTR3DLL
751RuntimeGuestR3Shared_EXTENDS := RuntimeGuestR3
752RuntimeGuestR3Shared_INST = $(INST_ADDITIONS_LIB)
753
754
755#
756# RuntimeGuestR3Mini - Minimal Guest Additions Runtime which does not require
757# initialization and can be linked into an .so. Intended
758# for X11 drivers, GRADD and similar.
759#
760RuntimeGuestR3Mini_TEMPLATE := VBOXGUESTR3DLL
761## @todo change this to EXTEND the RuntimeGuestR3 target.
762RuntimeGuestR3Mini_INST := $(INST_ADDITIONS_LIB)
763RuntimeGuestR3Mini_SDKS.win := $(RuntimeR3_SDKS.win)
764RuntimeGuestR3Mini_DEFS := $(filter-out RTCRITSECT_STRICT RT_NO_GIP, $(RuntimeR3_DEFS)) RT_MINI
765RuntimeGuestR3Mini_DEFS.$(KBUILD_TARGET) := $(RuntimeR3_DEFS.$(KBUILD_TARGET))
766RuntimeGuestR3Mini_DEFS.$(KBUILD_HOST) := $(RuntimeR3_DEFS.$(KBUILD_HOST))
767RuntimeGuestR3Mini_INCS := $(RuntimeR3_INCS)
768RuntimeGuestR3Mini_INCS.$(KBUILD_TARGET) := $(RuntimeR3_INCS.$(KBUILD_TARGET))
769RuntimeGuestR3Mini_INCS.$(KBUILD_HOST) := $(RuntimeR3_INCS.$(KBUILD_HOST))
770RuntimeGuestR3Mini_SOURCES = \
771 common/err/errmsg.cpp \
772 common/err/errmsgxpcom.cpp \
773 common/err/RTErrConvertFromErrno.cpp \
774 common/log/logformat.cpp \
775 common/misc/assert.cpp \
776 common/misc/buildconfig.cpp \
777 common/misc/sanity-c.c \
778 common/misc/sanity-cpp.cpp \
779 common/path/rtPathVolumeSpecLen.cpp \
780 common/path/RTPathAbsDup.cpp \
781 common/path/RTPathAbsEx.cpp \
782 common/path/RTPathAbsExDup.cpp \
783 common/path/RTPathAppend.cpp \
784 common/path/RTPathExt.cpp \
785 common/path/RTPathFilename.cpp \
786 common/path/RTPathHaveExt.cpp \
787 common/path/RTPathHavePath.cpp \
788 common/path/RTPathParse.cpp \
789 common/path/RTPathRealDup.cpp \
790 common/path/RTPathStripExt.cpp \
791 common/path/RTPathStripFilename.cpp \
792 common/path/RTPathStripTrailingSlash.cpp \
793 common/string/RTStrCmp.cpp \
794 common/string/RTStrNCmp.cpp \
795 common/string/RTStrNLen.cpp \
796 common/string/RTStrNLenEx.cpp \
797 common/string/RTStrStr.cpp \
798 common/string/straprintf.cpp \
799 common/string/strformat.cpp \
800 common/string/strformatrt.cpp \
801 common/string/strformattype.cpp \
802 common/string/string.cpp \
803 common/string/strprintf.cpp \
804 common/string/strtonum.cpp \
805 common/string/unidata.cpp \
806 common/string/utf-8.cpp \
807 common/string/utf-8-case.cpp \
808 common/string/utf-16.cpp \
809 generic/pathhost-generic.cpp \
810 generic/RTAssertShouldPanic-generic.cpp \
811 r3/alloc.cpp \
812 r3/fileio.cpp \
813 r3/fs.cpp
814RuntimeGuestR3Mini_SOURCES.freebsd = \
815 r3/posix/env-posix.cpp \
816 r3/posix/fileio-posix.cpp \
817 r3/posix/path-posix.cpp \
818 r3/posix/utf8-posix.cpp
819RuntimeGuestR3Mini_SOURCES.linux = \
820 r3/posix/env-posix.cpp \
821 r3/posix/fileio-posix.cpp \
822 r3/posix/path-posix.cpp \
823 r3/posix/utf8-posix.cpp
824RuntimeGuestR3Mini_SOURCES.solaris = \
825 r3/posix/env-posix.cpp \
826 r3/posix/fileio-posix.cpp \
827 r3/posix/path-posix.cpp \
828 r3/posix/utf8-posix.cpp
829RuntimeGuestR3Mini_SOURCES.win = \
830 r3/win/fileio-win.cpp \
831 r3/win/path-win.cpp \
832 r3/win/utf8-win.cpp \
833 win/errmsgwin.cpp \
834 win/RTErrConvertFromWin32.cpp
835
836# VBox specific stuff.
837RuntimeGuestR3Mini_SOURCES += \
838 VBox/logbackdoor.cpp \
839 VBox/logbackdoor-redirect.cpp \
840 VBox/strformat-vbox.cpp
841
842
843#
844# RuntimeLnxHostR3 Linux host program runtime
845# (Only used when building L4.)
846#
847RuntimeLnxHostR3_TEMPLATE = VBOXLNXHOSTR3LIB
848RuntimeLnxHostR3_DEFS = IN_RT_R3 IN_SUP_R3 RT_WITH_VBOX RT_NO_GIP
849RuntimeLnxHostR3_SOURCES = \
850 $(RuntimeR3_SOURCES.linux.$(KBUILD_TARGET_ARCH)) \
851 $(RuntimeR3_SOURCES.linux) \
852 $(RuntimeR3_SOURCES)
853RuntimeLnxHostR3_INCS = \
854 $(RuntimeR3_INCS.linux.$(KBUILD_TARGET_ARCH)) \
855 $(RuntimeR3_INCS.linux) \
856 $(RuntimeR3_INCS)
857
858
859#
860# VBoxRT - Shared Object / DLL version.
861#
862VBoxRT_TEMPLATE = VBOXR3
863VBoxRT_SDKS = VBOX_OPENSSL VBOX_LIBXML2 VBOX_LIBCURL VBOX_BOOST
864VBoxRT_SDKS.win = WINPSDK W2K3DDK VBOX_NTDLL
865ifeq ($(KBUILD_TARGET)$(VBOX_WITH_HARDENING),darwin)
866VBoxRT_INST = $(INST_DLL) $(INST_TESTCASE)
867endif
868VBoxRT_DEFS = $(filter-out RT_NO_GIP,$(RuntimeR3_DEFS)) IN_SUP_R3 IN_SUP_R3
869VBoxRT_DEFS.$(KBUILD_TYPE) = $(RuntimeR3_DEFS.$(KBUILD_TYPE))
870VBoxRT_SOURCES = \
871 VBox/VBoxRTDeps.cpp \
872 $(RuntimeR3_SOURCES)
873VBoxRT_SOURCES += \
874 common/misc/s3.cpp \
875 r3/xml.cpp \
876 common/checksum/RTSha1Digest.cpp \
877 common/checksum/manifest.cpp \
878 common/checksum/sha1.cpp \
879 common/checksum/sha1str.cpp \
880 common/checksum/sha256.cpp \
881 common/checksum/sha256str.cpp \
882 common/checksum/sha512.cpp \
883 common/checksum/sha512str.cpp
884VBoxRT_SOURCES.$(KBUILD_TARGET) = $(RuntimeR3_SOURCES.$(KBUILD_TARGET))
885VBoxRT_SOURCES.$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH) = $(RuntimeR3_SOURCES.$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH))
886VBoxRT_SOURCES.$(KBUILD_TARGET_ARCH) = $(RuntimeR3_SOURCES.$(KBUILD_TARGET_ARCH))
887VBoxRT_SOURCES.win += \
888 r3/win/dllmain-win.cpp \
889 r3/win/fileaio-win.cpp \
890 $(VBoxRT_0_OUTDIR)/VBoxRT.def
891VBoxRT_SOURCES.linux += \
892 r3/linux/fileaio-linux.cpp
893VBoxRT_SOURCES.solaris += \
894 r3/solaris/fileaio-solaris.cpp
895VBoxRT_SOURCES.darwin += \
896 r3/posix/fileaio-posix.cpp
897VBoxRT_SOURCES.freebsd += \
898 r3/freebsd/fileaio-freebsd.cpp
899VBoxRT_INCS = $(RuntimeR3_INCS)
900VBoxRT_INCS.$(KBUILD_TARGET) = $(RuntimeR3_INCS.$(KBUILD_TARGET))
901VBoxRT_INCS.$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH) = $(RuntimeR3_INCS.$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH))
902VBoxRT_LIBS = \
903 $(PATH_LIB)/SUPR3$(VBOX_SUFF_LIB) \
904 $(PATH_LIB)/VBox-liblzf$(VBOX_SUFF_LIB) \
905 $(SDK_VBOX_ZLIB_LIBS)
906ifdef IPRT_WITH_KSTUFF
907 VBoxRT_LIBS += \
908 $(PATH_LIB)/VBox-kStuff$(VBOX_SUFF_LIB)
909endif
910ifndef SDK_VBOX_LIBXML2_LIBS
911 VBoxRT_LIBS += \
912 $(PATH_LIB)/VBox-libxml2$(VBOX_SUFF_LIB)
913endif
914ifndef SDK_VBOX_OPENSSL_LIBS
915 VBoxRT_LIBS += \
916 $(PATH_LIB)/VBox-libcrypto$(VBOX_SUFF_LIB)
917endif
918ifdef IPRT_WITH_LZO
919 VBoxRT_LIBS += lzo2
920endif
921VBoxRT_LIBS.darwin = \
922 iconv
923VBoxRT_LIBS.freebsd = \
924 iconv \
925 rt
926VBoxRT_LIBS.solaris = \
927 kstat
928VBoxRT_LDFLAGS.darwin = -framework IOKit -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/VBoxRT.dylib
929ifdef VBOX_USE_VCC80
930VBoxRT_LDFLAGS.win = /MANIFEST
931endif
932VBoxRT_LDFLAGS.l4 = \
933 -Wl,-whole-archive \
934 $(PATH_LIB)/RuntimeR3L4$(VBOX_SUFF_LIB) \
935 -Wl,-no-whole-archive
936ifeq ($(KBUILD_TARGET),l4)
937VBoxRT_LIBS += \
938 $(L4_LIBDIR)/libl4sys.a \
939 $(L4_LIBDIR)/libl4sys.p.a
940endif
941VBoxRT_LIBS.l4 = \
942 $(PATH_LIB)/RuntimeR3L4$(VBOX_SUFF_LIB)
943
944if1of ($(DLLS), VBoxRT)
945$$(VBoxRT_0_OUTDIR)/VBoxRT.def: \
946 $(PATH_SUB_CURRENT)/r3/win/VBoxRT-$$(if-expr $$(KBUILD_TARGET_ARCH) == amd64,win64,win32).def \
947 $(PATH_SUB_CURRENT)/r3/win/$(if $(VBOX_OSE),VBoxRT-openssl-ose.def,VBoxRT-openssl.def)
948 $(RM) -f -- $@
949 $(REDIRECT) -wto $@ -- $(CAT_EXT) $^
950endif
951
952
953#
954# HACK ALLERT! Make testcase run during build on SELinux boxes.
955# Create a dummy DLL that ensure that VBoxRT is installed
956# during the DLL pass and cleaned up later.
957#
958ifeq ($(KBUILD_TARGET),linux)
959 if1of (VBoxRT, $(DLLS))
960 ifneq ($(wildcard /usr/bin/chcon),)
961VBoxRT_NOINST = true
962
963DLLS += VBoxRTDummy
964VBoxRTDummy_TEMPLATE = VBOXR3
965VBoxRTDummy_NOINST = true
966VBoxRTDummy_LIBS = $(PATH_BIN)/VBoxRT.so
967VBoxRTDummy_CLEAN= $(PATH_BIN)/VBoxRT.so
968BLDDIRS += $(PATH_BIN)
969
970$(PATH_BIN)/VBoxRT.so: $$(TARGET_VBoxRT) | $$(dir $$@)
971 $(INSTALL) $< $@
972 chcon -t texrel_shlib_t $@ || true
973
974VBoxRT:: VBoxRTDummy
975 endif # chcon present.
976 endif # building VBoxRT
977endif # linux
978
979#
980# RuntimeR3NoCRTGCC - CRT replacement lib for VBoxREM.
981# This is used together with VBoxRT.
982#
983## @todo the *_alias.c stuff is busted, remove and use RT_WITH_NOCRT_ALIASES instead.
984RuntimeR3NoCRTGCC_TEMPLATE = VBOXNOCRTGCC
985RuntimeR3NoCRTGCC_LIBSUFF = $(VBOX_SUFF_LIB)
986RuntimeR3NoCRTGCC_INCS = include
987RuntimeR3NoCRTGCC_SOURCES = \
988 common/misc/sanity-cpp.cpp \
989 common/misc/sanity-c.c \
990 \
991 common/math/ceill.asm \
992 common/math/cosl.asm \
993 common/math/fabs.asm \
994 common/math/fabsf.asm \
995 common/math/fabsl.asm \
996 common/math/floor.asm \
997 common/math/floorf.asm \
998 common/math/floorl.asm \
999 common/math/ldexpl.asm \
1000 common/math/llrint.asm \
1001 common/math/llrintf.asm \
1002 common/math/llrintl.asm \
1003 common/math/logl.asm \
1004 common/math/lrint.asm \
1005 common/math/lrintf.asm \
1006 common/math/lrintl.asm \
1007 common/math/remainder.asm \
1008 common/math/remainderf.asm \
1009 common/math/remainderl.asm \
1010 common/math/sinl.asm \
1011 common/math/tanl.asm \
1012 common/math/trunc.asm \
1013 common/math/truncf.asm \
1014 common/math/truncl.asm \
1015 \
1016 $(RuntimeNoCrt_SOURCES) \
1017 \
1018 common/string/memchr_alias.c \
1019 common/string/memcmp_alias.c \
1020 common/string/memcpy_alias.c \
1021 common/string/memmove_alias.c \
1022 common/string/memset_alias.c \
1023 common/string/strchr_alias.c \
1024 common/string/strcmp_alias.c \
1025 common/string/strlen_alias.c
1026
1027RuntimeR3NoCRTGCC_SOURCES.x86 = \
1028 common/math/x86/fenv-x86.c \
1029 common/math/gcc/adddi3.c \
1030 common/math/gcc/anddi3.c \
1031 common/math/gcc/ashldi3.c \
1032 common/math/gcc/ashrdi3.c \
1033 common/math/gcc/cmpdi2.c \
1034 common/math/gcc/divdi3.c \
1035 common/math/gcc/iordi3.c \
1036 common/math/gcc/lshldi3.c \
1037 common/math/gcc/lshrdi3.c \
1038 common/math/gcc/moddi3.c \
1039 common/math/gcc/muldi3.c \
1040 common/math/gcc/negdi2.c \
1041 common/math/gcc/notdi2.c \
1042 common/math/gcc/qdivrem.c \
1043 common/math/gcc/subdi3.c \
1044 common/math/gcc/ucmpdi2.c \
1045 common/math/gcc/udivdi3.c \
1046 common/math/gcc/umoddi3.c \
1047 common/math/gcc/xordi3.c
1048
1049
1050## @todo stop using the old memcpy.c and memset.c code.
1051
1052#
1053# RuntimeR0 - Ring0 library for VMMR0.
1054#
1055RuntimeR0_TEMPLATE = VBOXR0
1056RuntimeR0_DEFS = IN_RT_R0 RT_WITH_VBOX
1057RuntimeR0_INCS = include
1058RuntimeR0_SOURCES = \
1059 common/checksum/crc32.cpp \
1060 common/checksum/crc64.cpp \
1061 common/checksum/md5.cpp \
1062 common/checksum/ipv4.cpp \
1063 common/log/logellipsis.cpp \
1064 common/log/logrelellipsis.cpp \
1065 common/log/logcom.cpp \
1066 common/log/logformat.cpp \
1067 common/misc/assert.cpp \
1068 common/misc/buildconfig.cpp \
1069 common/misc/handletable.cpp \
1070 common/misc/handletablectx.cpp \
1071 common/misc/handletablesimple.cpp \
1072 common/misc/sanity-c.c \
1073 common/misc/sanity-cpp.cpp \
1074 common/misc/RTAssertMsg2.cpp \
1075 common/misc/term.cpp \
1076 common/string/strformat.cpp \
1077 common/string/strformatrt.cpp \
1078 common/string/strformattype.cpp \
1079 common/string/strncmp.cpp \
1080 common/string/strpbrk.cpp \
1081 common/string/strprintf.cpp \
1082 common/table/avlgcptr.cpp \
1083 common/table/avlhcphys.cpp \
1084 common/table/avllu32.cpp \
1085 common/table/avlogcphys.cpp \
1086 common/table/avlogcptr.cpp \
1087 common/table/avlohcphys.cpp \
1088 common/table/avloioport.cpp \
1089 common/table/avlpv.cpp \
1090 common/table/avlrogcphys.cpp \
1091 common/table/avlrogcptr.cpp \
1092 common/table/avlroioport.cpp \
1093 common/table/avlroogcptr.cpp \
1094 common/table/avlu32.cpp \
1095 common/table/avlou32.cpp \
1096 common/time/timesup.cpp \
1097 generic/RTAssertShouldPanic-generic.cpp \
1098 VBox/strformat-vbox.cpp \
1099 \
1100 $(RuntimeNoCrt_SOURCES)
1101
1102if1of ($(KBUILD_TARGET), darwin solaris freebsd)
1103RuntimeR0_SOURCES += \
1104 common/math/gcc/adddi3.c \
1105 common/math/gcc/anddi3.c \
1106 common/math/gcc/ashldi3.c \
1107 common/math/gcc/ashrdi3.c \
1108 common/math/gcc/cmpdi2.c \
1109 common/math/gcc/divdi3.c \
1110 common/math/gcc/iordi3.c \
1111 common/math/gcc/lshldi3.c \
1112 common/math/gcc/lshrdi3.c \
1113 common/math/gcc/moddi3.c \
1114 common/math/gcc/muldi3.c \
1115 common/math/gcc/negdi2.c \
1116 common/math/gcc/notdi2.c \
1117 common/math/gcc/qdivrem.c \
1118 common/math/gcc/subdi3.c \
1119 common/math/gcc/ucmpdi2.c \
1120 common/math/gcc/udivdi3.c \
1121 common/math/gcc/umoddi3.c \
1122 common/math/gcc/xordi3.c
1123endif
1124
1125#if1of ($(KBUILD_TARGET_ARCH),amd64 x86)
1126# RuntimeR0_SOURCES += common/time/timesupA.asm
1127#else
1128 RuntimeR0_SOURCES += common/time/timesupref.cpp
1129#endif
1130
1131RuntimeR0_SOURCES.win.amd64 = $(RuntimeWin64ASM_SOURCES)
1132RuntimeR0_SOURCES.win.x86 = $(RuntimeWin32ASM_SOURCES)
1133RuntimeR0_SOURCES.win = \
1134 nt/NtProcessStartup-stub.cpp
1135
1136RuntimeR0_SOURCES.os2 = \
1137 os2/RTErrConvertFromOS2.cpp \
1138 os2/sys0.asm
1139
1140
1141#
1142# RuntimeR0Drv - Ring0 library for host drivers.
1143#
1144RuntimeR0Drv_TEMPLATE = VBOXR0DRV
1145RuntimeR0Drv_SDKS.win = W2K3DDK WINPSDKINCS
1146RuntimeR0Drv_DEFS = IN_RT_R0 RT_WITH_VBOX RT_WITHOUT_NOCRT_WRAPPERS RT_NO_EXPORT_SYMBOL
1147RuntimeR0Drv_DEFS.win = IN_SUP_R0
1148RuntimeR0Drv_DEFS.linux = MODULE KBUILD_MODNAME=KBUILD_STR\(vboxdrv\) KBUILD_BASENAME=KBUILD_STR\(vboxdrv\) IN_SUP_R0
1149
1150RuntimeR0Drv_INCS := $(PATH_SUB_CURRENT) include
1151RuntimeR0Drv_INCS.freebsd = \
1152 $(PATH_INS)/gen-sys-hdrs
1153RuntimeR0Drv_INCS.linux = \
1154 r0drv/linux
1155RuntimeR0Drv_INCS.solaris = \
1156 r0drv/solaris/vbi/i86pc \
1157 r0drv/solaris/vbi/i86pc/sys
1158
1159RuntimeR0Drv_SOURCES = \
1160 common/alloc/alloc.cpp \
1161 common/alloc/heapsimple.cpp \
1162 common/alloc/heapoffset.cpp \
1163 common/misc/RTAssertMsg2.cpp \
1164 common/checksum/crc32.cpp \
1165 common/checksum/crc64.cpp \
1166 common/checksum/md5.cpp \
1167 common/checksum/ipv4.cpp \
1168 common/log/log.cpp \
1169 common/log/logellipsis.cpp \
1170 common/log/logrel.cpp \
1171 common/log/logrelellipsis.cpp \
1172 common/log/logcom.cpp \
1173 common/log/logformat.cpp \
1174 common/misc/assert.cpp \
1175 common/misc/buildconfig.cpp \
1176 common/misc/handletable.cpp \
1177 common/misc/handletablectx.cpp \
1178 common/misc/handletablesimple.cpp \
1179 common/misc/once.cpp \
1180 common/misc/sanity-c.c \
1181 common/misc/sanity-cpp.cpp \
1182 common/misc/term.cpp \
1183 common/path/rtPathVolumeSpecLen.cpp \
1184 common/path/RTPathAbsDup.cpp \
1185 common/path/RTPathAbsEx.cpp \
1186 common/path/RTPathAbsExDup.cpp \
1187 common/path/RTPathAppend.cpp \
1188 common/path/RTPathExt.cpp \
1189 common/path/RTPathFilename.cpp \
1190 common/path/RTPathHaveExt.cpp \
1191 common/path/RTPathHavePath.cpp \
1192 common/path/RTPathParse.cpp \
1193 common/path/RTPathRealDup.cpp \
1194 common/path/RTPathStripExt.cpp \
1195 common/path/RTPathStripFilename.cpp \
1196 common/path/RTPathStripTrailingSlash.cpp \
1197 common/rand/rand.cpp \
1198 common/rand/randadv.cpp \
1199 common/rand/randparkmiller.cpp \
1200 common/string/strformat.cpp \
1201 common/string/strformatrt.cpp \
1202 common/string/strformattype.cpp \
1203 common/string/strprintf.cpp \
1204 common/string/strtonum.cpp \
1205 common/string/string.cpp \
1206 common/string/utf-16.cpp \
1207 common/string/utf-8.cpp \
1208 common/table/avlpv.cpp \
1209 generic/RTLogWriteStdErr-stub-generic.cpp \
1210 generic/RTLogWriteUser-generic.cpp \
1211 generic/RTRandAdvCreateSystemFaster-generic.cpp \
1212 generic/uuid-generic.cpp \
1213 r0drv/alloc-r0drv.cpp \
1214 r0drv/initterm-r0drv.cpp \
1215 r0drv/generic/semspinmutex-r0drv-generic.c \
1216 VBox/log-vbox.cpp \
1217 VBox/strformat-vbox.cpp
1218
1219## @todo: Linking against RuntimeR0Drv on Linux will result in unresolved external
1220## references to several string functions (e.g. strlen). We could include the
1221## missing functions here but our own implementations conflict with declarations
1222## of some Linux kernels (inline versus not inline, size_t versus unsigned int).
1223##
1224## The prototypes for the unresolved externals are declared in <linux/string.h>.
1225## This file is not included with extern "C" { ... } and therefore the function
1226## prototypes are mangled during C++ compilation. That's why we have to provide
1227## implementations with mangled function names.
1228##
1229## bird: Why don't we just extern "C" {} that file then?
1230RuntimeR0Drv_SOURCES.linux = \
1231 common/string/strpbrk.cpp \
1232 common/err/RTErrConvertToErrno.cpp \
1233 common/err/RTErrConvertFromErrno.cpp \
1234 generic/RTAssertShouldPanic-generic.cpp \
1235 generic/RTLogWriteStdOut-stub-generic.cpp \
1236 generic/mppresent-generic.cpp \
1237 r0drv/linux/alloc-r0drv-linux.c \
1238 r0drv/linux/assert-r0drv-linux.c \
1239 r0drv/linux/initterm-r0drv-linux.c \
1240 r0drv/linux/memobj-r0drv-linux.c \
1241 r0drv/linux/memuserkernel-r0drv-linux.c \
1242 r0drv/linux/mp-r0drv-linux.c \
1243 r0drv/linux/mpnotification-r0drv-linux.c \
1244 r0drv/linux/process-r0drv-linux.c \
1245 r0drv/linux/RTLogWriteDebugger-r0drv-linux.c \
1246 r0drv/linux/semevent-r0drv-linux.c \
1247 r0drv/linux/semeventmulti-r0drv-linux.c \
1248 r0drv/linux/semfastmutex-r0drv-linux.c \
1249 r0drv/linux/spinlock-r0drv-linux.c \
1250 r0drv/linux/thread-r0drv-linux.c \
1251 r0drv/linux/thread2-r0drv-linux.c \
1252 r0drv/linux/time-r0drv-linux.c \
1253 r0drv/linux/timer-r0drv-linux.c \
1254 r0drv/memobj-r0drv.cpp \
1255 r0drv/mpnotification-r0drv.c \
1256 r0drv/powernotification-r0drv.c
1257## @todo thread2-r0drv-linux.c and assert-r0drv-linux.c
1258
1259RuntimeR0Drv_SOURCES.win = \
1260 common/misc/lockvalidator.cpp \
1261 common/misc/thread.cpp \
1262 common/string/memcmp.asm \
1263 common/string/memchr.asm \
1264 common/string/memcpy.asm \
1265 common/string/memset.asm \
1266 common/string/memmove.asm \
1267 common/string/strlen.asm \
1268 common/string/strncmp.cpp \
1269 common/string/strpbrk.cpp \
1270 generic/RTAssertShouldPanic-generic.cpp \
1271 generic/RTLogWriteStdOut-stub-generic.cpp \
1272 generic/mppresent-generic.cpp \
1273 nt/RTErrConvertFromNtStatus.cpp \
1274 r0drv/memobj-r0drv.cpp \
1275 r0drv/mpnotification-r0drv.c \
1276 r0drv/powernotification-r0drv.c \
1277 r0drv/nt/alloc-r0drv-nt.cpp \
1278 r0drv/nt/assert-r0drv-nt.cpp \
1279 r0drv/nt/initterm-r0drv-nt.cpp \
1280 r0drv/nt/memobj-r0drv-nt.cpp \
1281 r0drv/nt/memuserkernel-r0drv-nt.cpp \
1282 r0drv/nt/mp-r0drv-nt.cpp \
1283 r0drv/nt/mpnotification-r0drv-nt.cpp \
1284 r0drv/nt/process-r0drv-nt.cpp \
1285 r0drv/nt/RTLogWriteDebugger-r0drv-nt.cpp \
1286 r0drv/nt/semevent-r0drv-nt.cpp \
1287 r0drv/nt/semeventmulti-r0drv-nt.cpp \
1288 r0drv/nt/semfastmutex-r0drv-nt.cpp \
1289 r0drv/nt/semmutex-r0drv-nt.cpp \
1290 r0drv/nt/spinlock-r0drv-nt.cpp \
1291 r0drv/nt/thread-r0drv-nt.cpp \
1292 r0drv/nt/thread2-r0drv-nt.cpp \
1293 r0drv/nt/time-r0drv-nt.cpp \
1294 r0drv/nt/timer-r0drv-nt.cpp
1295
1296RuntimeR0Drv_SOURCES.win.amd64 = $(RuntimeWin64ASM_SOURCES)
1297RuntimeR0Drv_SOURCES.win.x86 = $(RuntimeWin32ASM_SOURCES)
1298
1299RuntimeR0Drv_SOURCES.darwin = \
1300 common/err/RTErrConvertFromErrno.cpp \
1301 common/misc/RTAssertMsg1Weak.cpp \
1302 common/misc/RTAssertMsg2Weak.cpp \
1303 common/misc/lockvalidator.cpp \
1304 common/misc/thread.cpp \
1305 common/string/memchr.asm \
1306 common/string/strpbrk.cpp \
1307 darwin/RTErrConvertFromDarwin.cpp \
1308 darwin/RTErrConvertFromDarwinIO.cpp \
1309 darwin/RTErrConvertFromDarwinKern.cpp \
1310 generic/RTAssertShouldPanic-generic.cpp \
1311 generic/RTTimerCreate-generic.cpp \
1312 generic/mppresent-generic.cpp \
1313 generic/timer-generic.cpp \
1314 r0drv/generic/mpnotification-r0drv-generic.cpp \
1315 r0drv/darwin/alloc-r0drv-darwin.cpp \
1316 r0drv/darwin/assert-r0drv-darwin.cpp \
1317 r0drv/darwin/initterm-r0drv-darwin.cpp \
1318 r0drv/darwin/memobj-r0drv-darwin.cpp \
1319 r0drv/darwin/mp-r0drv-darwin.cpp \
1320 r0drv/darwin/memuserkernel-r0drv-darwin.cpp \
1321 r0drv/darwin/process-r0drv-darwin.cpp \
1322 r0drv/darwin/RTLogWriteDebugger-r0drv-darwin.cpp \
1323 r0drv/darwin/RTLogWriteStdOut-r0drv-darwin.cpp \
1324 r0drv/darwin/semaphore-r0drv-darwin.cpp \
1325 r0drv/darwin/spinlock-r0drv-darwin.cpp \
1326 r0drv/darwin/thread-r0drv-darwin.cpp \
1327 r0drv/darwin/thread2-r0drv-darwin.cpp \
1328 r0drv/darwin/threadpreempt-r0drv-darwin.cpp \
1329 r0drv/darwin/time-r0drv-darwin.cpp \
1330 r0drv/memobj-r0drv.cpp \
1331 r0drv/powernotification-r0drv.c
1332
1333RuntimeR0Drv_SOURCES.os2 = \
1334 common/string/memchr.asm \
1335 common/string/memcmp.asm \
1336 common/string/memcpy.asm \
1337 common/string/mempcpy.asm \
1338 common/string/memmove.asm \
1339 common/string/memset.asm \
1340 common/string/strchr.asm \
1341 common/string/strcmp.asm \
1342 common/string/strcpy.asm \
1343 common/string/strlen.asm \
1344 \
1345 common/string/strncmp.cpp \
1346 common/string/strpbrk.cpp \
1347 \
1348 common/misc/lockvalidator.cpp \
1349 common/misc/thread.cpp \
1350 generic/RTAssertShouldPanic-generic.cpp \
1351 generic/RTLogWriteDebugger-generic.cpp \
1352 generic/RTLogWriteStdOut-stub-generic.cpp \
1353 generic/RTMpCpuId-generic.cpp \
1354 generic/RTMpCpuIdFromSetIndex-generic.cpp \
1355 generic/RTMpCpuIdToSetIndex-generic.cpp \
1356 generic/RTMpIsCpuPossible-generic.cpp \
1357 generic/RTMpGetCount-generic.cpp \
1358 generic/RTMpGetMaxCpuId-generic.cpp \
1359 generic/RTMpGetOnlineCount-generic.cpp \
1360 generic/RTMpGetOnlineSet-generic.cpp \
1361 generic/RTMpGetSet-generic.cpp \
1362 generic/RTMpIsCpuOnline-generic.cpp \
1363 generic/RTTimerCreate-generic.cpp \
1364 generic/mppresent-generic.cpp \
1365 os2/RTErrConvertFromOS2.cpp \
1366 os2/sys0.asm \
1367 r0drv/generic/RTMpIsCpuWorkPending-r0drv-generic.cpp \
1368 r0drv/generic/RTMpOn-r0drv-generic.cpp \
1369 r0drv/generic/mpnotification-r0drv-generic.cpp \
1370 r0drv/memobj-r0drv.cpp \
1371 r0drv/powernotification-r0drv.c \
1372 r0drv/os2/alloc-r0drv-os2.cpp \
1373 r0drv/os2/assert-r0drv-os2.cpp \
1374 r0drv/os2/assertA-r0drv-os2.asm \
1375 r0drv/os2/initterm-r0drv-os2.cpp \
1376 r0drv/os2/memobj-r0drv-os2.cpp \
1377 r0drv/os2/memuserkernel-r0drv-os2.cpp \
1378 r0drv/os2/os2imports.imp \
1379 r0drv/os2/process-r0drv-os2.cpp \
1380 r0drv/os2/RTR0AssertPanicSystem-r0drv-os2.asm \
1381 r0drv/os2/RTR0Os2DHQueryDOSVar.asm \
1382 r0drv/os2/RTR0Os2DHVMGlobalToProcess.asm \
1383 r0drv/os2/semevent-r0drv-os2.cpp \
1384 r0drv/os2/semeventmulti-r0drv-os2.cpp \
1385 r0drv/os2/semfastmutex-r0drv-os2.cpp \
1386 r0drv/os2/spinlock-r0drv-os2.cpp \
1387 r0drv/os2/thread-r0drv-os2.cpp \
1388 r0drv/os2/thread2-r0drv-os2.cpp \
1389 r0drv/os2/time-r0drv-os2.cpp \
1390 r0drv/os2/timer-r0drv-os2.cpp \
1391 r0drv/os2/timerA-r0drv-os2.asm
1392
1393RuntimeR0Drv_SOURCES.freebsd = \
1394 common/err/RTErrConvertFromErrno.cpp \
1395 common/err/RTErrConvertToErrno.cpp \
1396 common/misc/lockvalidator.cpp \
1397 common/misc/thread.cpp \
1398 common/string/memchr.asm \
1399 common/string/memmove.asm \
1400 common/string/strpbrk.cpp \
1401 common/string/memcmp.asm \
1402 common/string/strchr.asm \
1403 generic/RTAssertShouldPanic-generic.cpp \
1404 generic/RTLogWriteDebugger-generic.cpp \
1405 generic/RTLogWriteStdOut-stub-generic.cpp \
1406 generic/RTTimerCreate-generic.cpp \
1407 generic/mppresent-generic.cpp \
1408 r0drv/generic/RTMpIsCpuWorkPending-r0drv-generic.cpp \
1409 r0drv/generic/mpnotification-r0drv-generic.cpp \
1410 r0drv/freebsd/alloc-r0drv-freebsd.c \
1411 r0drv/freebsd/assert-r0drv-freebsd.c \
1412 r0drv/freebsd/initterm-r0drv-freebsd.c \
1413 r0drv/freebsd/memobj-r0drv-freebsd.c \
1414 r0drv/freebsd/memuserkernel-r0drv-freebsd.c \
1415 r0drv/freebsd/process-r0drv-freebsd.c \
1416 r0drv/freebsd/semevent-r0drv-freebsd.c \
1417 r0drv/freebsd/semeventmulti-r0drv-freebsd.c \
1418 r0drv/freebsd/semfastmutex-r0drv-freebsd.c \
1419 r0drv/freebsd/spinlock-r0drv-freebsd.c \
1420 r0drv/freebsd/thread-r0drv-freebsd.c \
1421 r0drv/freebsd/thread2-r0drv-freebsd.c \
1422 r0drv/freebsd/time-r0drv-freebsd.c \
1423 r0drv/freebsd/mp-r0drv-freebsd.c \
1424 generic/timer-generic.cpp \
1425 r0drv/memobj-r0drv.cpp \
1426 r0drv/powernotification-r0drv.c
1427
1428RuntimeR0Drv_SOURCES.solaris = \
1429 common/err/RTErrConvertFromErrno.cpp \
1430 common/err/RTErrConvertToErrno.cpp \
1431 common/misc/lockvalidator.cpp \
1432 common/misc/thread.cpp \
1433 common/string/memchr.asm \
1434 generic/RTAssertShouldPanic-generic.cpp \
1435 generic/RTLogWriteStdOut-stub-generic.cpp \
1436 generic/RTTimerCreate-generic.cpp \
1437 generic/mppresent-generic.cpp \
1438 r0drv/memobj-r0drv.cpp \
1439 r0drv/mpnotification-r0drv.c \
1440 r0drv/powernotification-r0drv.c \
1441 r0drv/solaris/RTLogWriteDebugger-r0drv-solaris.c \
1442 r0drv/solaris/assert-r0drv-solaris.c \
1443 r0drv/solaris/initterm-r0drv-solaris.c \
1444 r0drv/solaris/memuserkernel-r0drv-solaris.c \
1445 r0drv/solaris/semevent-r0drv-solaris.c \
1446 r0drv/solaris/semeventmulti-r0drv-solaris.c \
1447 r0drv/solaris/semfastmutex-r0drv-solaris.c \
1448 r0drv/solaris/spinlock-r0drv-solaris.c
1449
1450 # VBI is now compiled into IPRT
1451 RuntimeR0Drv_SOURCES.solaris += \
1452 r0drv/solaris/vbi/RTMpPokeCpu-r0drv-solaris.c \
1453 r0drv/solaris/vbi/mpnotification-r0drv-solaris.c \
1454 r0drv/solaris/vbi/alloc-r0drv-solaris.c \
1455 r0drv/solaris/vbi/memobj-r0drv-solaris.c \
1456 r0drv/solaris/vbi/mp-r0drv-solaris.c \
1457 r0drv/solaris/vbi/process-r0drv-solaris.c \
1458 r0drv/solaris/vbi/thread-r0drv-solaris.c \
1459 r0drv/solaris/vbi/thread2-r0drv-solaris.c \
1460 r0drv/solaris/vbi/time-r0drv-solaris.c \
1461 r0drv/solaris/vbi/timer-r0drv-solaris.c \
1462 r0drv/solaris/vbi/i86pc/os/vbi.c
1463
1464
1465## PORTME: Porters create and add their selection of platform specific Ring-0 Driver files here.
1466
1467RuntimeR0Drv_ORDERDEPS.freebsd = \
1468 $(PATH_INS)/gen-sys-hdrs/bus_if.h \
1469 $(PATH_INS)/gen-sys-hdrs/device_if.h
1470
1471
1472#
1473# RuntimeGuestR0 - Guest driver runtime.
1474# This is almost the same as the RuntimeR0Drv, the main difference
1475# is in the backdoor logging and the lack of sup.h (which should be
1476# made irrelevant even for RuntimeR0Drv).
1477#
1478RuntimeGuestR0_TEMPLATE := VBOXGUESTR0LIB
1479RuntimeGuestR0_SOURCES := $(filter-out generic/RTLogWriteUser-generic.cpp, $(RuntimeR0Drv_SOURCES))
1480RuntimeGuestR0_SOURCES += \
1481 VBox/logbackdoor.cpp
1482RuntimeGuestR0_EXTENDS = RuntimeR0Drv
1483
1484
1485#
1486# RuntimeGuestR0NT4 - Win32 NT4 guest driver runtime.
1487#
1488RuntimeGuestR0NT4_EXTENDS = RuntimeGuestR0
1489RuntimeGuestR0NT4_EXTENDS_BY = appending
1490RuntimeGuestR0NT4_DEFS = IPRT_TARGET_NT4
1491
1492
1493#
1494# RuntimeGC - Guest context library.
1495#
1496RuntimeGC_TEMPLATE = VBOXGC
1497RuntimeGC_DEFS = IN_RT_GC RT_WITH_VBOX
1498RuntimeGC_INCS = include
1499RuntimeGC_SOURCES = \
1500 common/log/log.cpp \
1501 common/log/logellipsis.cpp \
1502 common/log/logrel.cpp \
1503 common/log/logrelellipsis.cpp \
1504 common/log/logcom.cpp \
1505 common/log/logformat.cpp \
1506 common/misc/assert.cpp \
1507 common/misc/buildconfig.cpp \
1508 common/misc/sanity-c.c \
1509 common/misc/sanity-cpp.cpp \
1510 common/string/strformat.cpp \
1511 common/string/strformatrt.cpp \
1512 common/string/strformattype.cpp \
1513 common/string/strncmp.cpp \
1514 common/string/strpbrk.cpp \
1515 common/string/strprintf.cpp \
1516 common/table/avllu32.cpp \
1517 common/table/avlou32.cpp \
1518 common/table/avlogcphys.cpp \
1519 common/table/avlogcptr.cpp \
1520 common/table/avlohcphys.cpp \
1521 common/table/avloioport.cpp \
1522 common/table/avlrogcphys.cpp \
1523 common/table/avlrogcptr.cpp \
1524 common/table/avlroioport.cpp \
1525 common/table/avlroogcptr.cpp \
1526 common/table/avlu32.cpp \
1527 common/time/timeprog.cpp \
1528 common/time/timesup.cpp \
1529 gc/initterm-gc.cpp \
1530 generic/RTAssertShouldPanic-generic.cpp \
1531 VBox/strformat-vbox.cpp \
1532 \
1533 $(RuntimeNoCrt_SOURCES)
1534
1535#if1of ($(KBUILD_TARGET_ARCH),amd64 x86)
1536# RuntimeGC_SOURCES += common/time/timesupA.asm
1537#else
1538 RuntimeGC_SOURCES += common/time/timesupref.cpp
1539#endif
1540
1541RuntimeGC_SOURCES.win.x86 = $(RuntimeWin32ASM_SOURCES)
1542
1543ifeq ($(VBOX_LDR_FMT32),lx)
1544 RuntimeGC_SOURCES += os2/sys0.asm
1545endif
1546
1547if1of ($(KBUILD_TARGET), darwin solaris freebsd)
1548RuntimeGC_SOURCES += \
1549 common/math/gcc/adddi3.c \
1550 common/math/gcc/anddi3.c \
1551 common/math/gcc/ashldi3.c \
1552 common/math/gcc/ashrdi3.c \
1553 common/math/gcc/cmpdi2.c \
1554 common/math/gcc/divdi3.c \
1555 common/math/gcc/iordi3.c \
1556 common/math/gcc/lshldi3.c \
1557 common/math/gcc/lshrdi3.c \
1558 common/math/gcc/moddi3.c \
1559 common/math/gcc/muldi3.c \
1560 common/math/gcc/negdi2.c \
1561 common/math/gcc/notdi2.c \
1562 common/math/gcc/qdivrem.c \
1563 common/math/gcc/subdi3.c \
1564 common/math/gcc/ucmpdi2.c \
1565 common/math/gcc/udivdi3.c \
1566 common/math/gcc/umoddi3.c \
1567 common/math/gcc/xordi3.c
1568endif
1569
1570
1571#
1572# Static library for new & delete for the electric fence.
1573#
1574RuntimeEFCPP_TEMPLATE = $(RuntimeR3_TEMPLATE)
1575RuntimeEFCPP_SDKS = $(RuntimeR3_SDKS)
1576RuntimeEFCPP_SDKS.$(KBUILD_TARGET) = $(RuntimeR3_SDKS.$(KBUILD_TARGET))
1577RuntimeEFCPP_DEFS = $(RuntimeR3_DEFS)
1578RuntimeEFCPP_DEFS.$(KBUILD_TARGET) = $(RuntimeR3_DEFS.$(KBUILD_TARGET))
1579RuntimeEFCPP_INCS = $(RuntimeR3_INCS)
1580RuntimeEFCPP_INCS.$(KBUILD_TARGET) = $(RuntimeR3_INCS.$(KBUILD_TARGET))
1581RuntimeEFCPP_SOURCES = r3/alloc-ef-cpp.cpp
1582
1583
1584
1585#
1586# errmsg.cpp depends on a generated header.
1587#
1588common/err/errmsg.cpp_DEPS = $(IPRT_OUT_DIR)/errmsgdata.h
1589common/err/errmsg.cpp_INCS = $(IPRT_OUT_DIR)
1590
1591win/errmsgwin.cpp_DEPS = $(IPRT_OUT_DIR)/errmsgcomdata.h
1592win/errmsgwin.cpp_INCS = $(IPRT_OUT_DIR)
1593
1594# Our COM errors only for R3 libraries on the host
1595define def_errmsgwin_deps
1596 $(lib)_win/errmsgwin.cpp_DEPS = $(IPRT_OUT_DIR)/errmsgvboxcomdata.h
1597 $(lib)_common/err/errmsgxpcom.cpp_INCS = $(IPRT_OUT_DIR)
1598 $(lib)_common/err/errmsgxpcom.cpp_DEPS = $(IPRT_OUT_DIR)/errmsgvboxcomdata.h
1599endef
1600$(foreach lib,RuntimeR3 VBoxRT RuntimeLnxHostR3,$(eval $(def_errmsgwin_deps)))
1601
1602
1603#
1604# Generate the status code data.
1605#
1606$(IPRT_OUT_DIR)/errmsgdata.h: \
1607 $(VBOX_PATH_RUNTIME_SRC)/common/err/errmsg.sed \
1608 $(PATH_ROOT)/include/iprt/err.h \
1609 $(PATH_ROOT)/include/VBox/err.h \
1610 | $$(dir $$@)
1611 $(call MSG_GENERATE,,$@,$(filter %.h,$^))
1612 $(QUIET)$(REDIRECT) -wo $@ -- $(SED) -f $< $(filter %.h,$^)
1613
1614## @todo r=bird: rename this to indicate that it's not only COM errors, but all win32/64 errors.
1615$(IPRT_OUT_DIR)/errmsgcomdata.h: \
1616 $(VBOX_PATH_RUNTIME_SRC)/common/err/errmsgcom.sed \
1617 $$(PATH_SDK_WINPSDK_INC)/WinError.h \
1618 | $$(dir $$@)
1619 $(call MSG_GENERATE,,$@,$(filter %.h,$^))
1620 $(QUIET)$(REDIRECT) -wo $@ -- $(SED) -f $< $(filter %.h,$^)
1621
1622$(IPRT_OUT_DIR)/errmsgvboxcomdata.h: \
1623 $(VBOX_PATH_RUNTIME_SRC)/VBox/errmsgvboxcom.xsl \
1624 $(VBOX_XIDL_FILE_SRC) \
1625 | $$(dir $$@)
1626 $(call MSG_GENERATE,,$@,$(filter %.xidl,$^))
1627 $(VBOX_XSLTPROC) -o $@ $< $(filter %.xidl,$^)
1628
1629
1630if "$(KBUILD_TARGET)" == "freebsd"
1631#
1632# FreeBSDGeneratedKernelHeaders - Generate some kernel interface headers.
1633#
1634# These are used by:
1635# - The RTMp* API in IPRT.
1636# - VBoxGuest
1637#
1638# Note! We cannot give a output path to the awk program, it will always
1639# generate the header next to the source. So, we'll have to temporarily copy
1640# the source file to the destination directory to work.
1641#
1642VBOX_AWK := /usr/bin/awk
1643INSTALLS += FreeBSDGeneratedKernelHeaders
1644FreeBSDGeneratedKernelHeaders_INST = gen-sys-hdrs/
1645FreeBSDGeneratedKernelHeaders_SOURCES = \
1646 $(FreeBSDGeneratedKernelHeaders_0_OUTDIR)/bus_if.h \
1647 $(FreeBSDGeneratedKernelHeaders_0_OUTDIR)/device_if.h \
1648 $(FreeBSDGeneratedKernelHeaders_0_OUTDIR)/pci_if.h
1649FreeBSDGeneratedKernelHeaders_CLEAN = $(FreeBSDGeneratedKernelHeaders_SOURCES)
1650
1651$$(FreeBSDGeneratedKernelHeaders_0_OUTDIR)/bus_if.h: $(VBOX_FREEBSD_SRC)/kern/bus_if.m | $$(dir $$@)
1652 $(call MSG_TOOL,awk,FreeBSDGeneratedKernelHeaders,$<,$@)
1653 $(QUIET)$(CP) -f $< $(@D)/bus_if.m
1654 $(QUIET)$(VBOX_AWK) -f $(VBOX_FREEBSD_SRC)/tools/makeobjops.awk $(@D)/bus_if.m -h -p
1655 $(QUIET)$(RM) $(@D)/bus_if.m
1656
1657$$(FreeBSDGeneratedKernelHeaders_0_OUTDIR)/device_if.h: $(VBOX_FREEBSD_SRC)/kern/device_if.m | $$(dir $$@)
1658 $(call MSG_TOOL,awk,FreeBSDGeneratedKernelHeaders,$<,$@)
1659 $(QUIET)$(CP) -f $< $(@D)/device_if.m
1660 $(QUIET)$(VBOX_AWK) -f $(VBOX_FREEBSD_SRC)/tools/makeobjops.awk $(@D)/device_if.m -h -p
1661 $(QUIET)$(RM) $(@D)/device_if.m
1662
1663$$(FreeBSDGeneratedKernelHeaders_0_OUTDIR)/pci_if.h: $(VBOX_FREEBSD_SRC)/dev/pci/pci_if.m | $$(dir $$@)
1664 $(call MSG_TOOL,awk,FreeBSDGeneratedKernelHeaders,$<,$@)
1665 $(QUIET)$(CP) -f $< $(@D)/pci_if.m
1666 $(QUIET)$(VBOX_AWK) -f $(VBOX_FREEBSD_SRC)/tools/makeobjops.awk $(@D)/pci_if.m -h -p
1667 $(QUIET)$(RM) $(@D)/pci_if.m
1668endif # FreeBSD
1669
1670
1671#
1672# Aliases for .cpp.h files so we can more easily do syntax checking from the editor.
1673#
1674ldrELFRelocatable.cpp.o: ldrELF.o
1675ldrELFRelocatable.cpp.obj: ldrELF.obj
1676
1677
1678#
1679# Doxygen documentation.
1680#
1681IPRT_DOXYFILE_INPUT_DIRS = \
1682 $(PATH_ROOT)/include/iprt \
1683 $(PATH_ROOT)/include/iprt/nocrt \
1684 $(PATH_ROOT)/include/iprt/nocrt/x86 \
1685 $(PATH_ROOT)/include/iprt/nocrt/amd64 \
1686 $(VBOX_PATH_RUNTIME_SRC)/include/internal \
1687 $(VBOX_PATH_RUNTIME_SRC)/common/alloc \
1688 $(VBOX_PATH_RUNTIME_SRC)/common/checksum \
1689 $(VBOX_PATH_RUNTIME_SRC)/common/err \
1690 $(VBOX_PATH_RUNTIME_SRC)/common/ldr \
1691 $(VBOX_PATH_RUNTIME_SRC)/common/log \
1692 $(VBOX_PATH_RUNTIME_SRC)/common/misc \
1693 $(VBOX_PATH_RUNTIME_SRC)/common/string \
1694 $(VBOX_PATH_RUNTIME_SRC)/common/table \
1695 $(VBOX_PATH_RUNTIME_SRC)/common/time \
1696 $(VBOX_PATH_RUNTIME_SRC)/VBox \
1697 $(foreach dir, $(VBOX_PATH_RUNTIME_SRC) $(VBOX_PATH_RUNTIME_SRC)/r3 $(VBOX_PATH_RUNTIME_SRC)/r0drv,\
1698 $(dir) \
1699 $(dir)/darwin \
1700 $(dir)/l4 \
1701 $(dir)/linux \
1702 $(dir)/nt \
1703 $(dir)/os2 \
1704 $(dir)/win \
1705 $(dir)/win32 \
1706 $(dir)/win64 \
1707 $(dir)/generic \
1708 )
1709
1710# These must come first in order to make things look nice.
1711IPRT_DOXYFILE_INPUT_FIRST =\
1712 $(PATH_ROOT)/include/iprt/cdefs.h \
1713 $(PATH_ROOT)/include/iprt/types.h \
1714 $(PATH_ROOT)/include/iprt/runtime.h \
1715 $(PATH_ROOT)/include/iprt/param.h \
1716 $(PATH_ROOT)/include/iprt/assert.h \
1717 $(PATH_ROOT)/include/iprt/asm.h \
1718
1719IPRT_DOXYFILE_INPUT := \
1720 $(filter-out %.cpp.h, $(sort $(wildcard $(addsuffix /*.h, $(IPRT_DOXYFILE_INPUT_DIRS)))) ) \
1721 $(foreach dir, $(IPRT_DOXYFILE_INPUT_DIRS), $(wildcard $(dir)/*.cpp $(dir)/.c $(dir)/.asm))
1722IPRT_DOXYFILE_INPUT := \
1723 $(IPRT_DOXYFILE_INPUT_FIRST) \
1724 $(filter-out $(IPRT_DOXYFILE_INPUT_FIRST), $(IPRT_DOXYFILE_INPUT))
1725
1726
1727IPRT_DOXYFILE_OUTPUT = $(PATH_OUT)/docs/iprt
1728BLDDIRS += $(IPRT_DOXYFILE_OUTPUT)
1729
1730includedep $(IPRT_OUT_DIR)/Doxyfile.iprt.dep
1731
1732# Generate the Doxyfile
1733$(IPRT_OUT_DIR)/Doxyfile.iprt: \
1734 $(VBOX_PATH_RUNTIME_SRC)/Doxyfile \
1735 $(VBOX_PATH_RUNTIME_SRC)/Makefile.kmk \
1736 $(comp-vars IPRT_DOXYFILE_INPUT,DOXYGEN_INPUT_PREV,FORCE) \
1737 $(comp-vars IPRT_DOXYFILE_OUTPUT,DOXYGEN_OUTPUT_PREV,FORCE) \
1738 | $$(dir $$@)
1739 $(RM) -f $@ [email protected] [email protected]
1740 $(CP) -f $(VBOX_PATH_RUNTIME_SRC)/Doxyfile [email protected]
1741 $(APPEND) [email protected]
1742 $(APPEND) [email protected] "OUTPUT_DIRECTORY = $(IPRT_DOXYFILE_OUTPUT)"
1743 $(APPEND) [email protected] "WARN_LOGFILE = $(IPRT_DOXYFILE_OUTPUT)/errors"
1744 $(APPEND) [email protected] "INCLUDE_PATH = $(PATH_ROOT)/include include . common/table"
1745 $(APPEND) [email protected] "INCLUDE_FILE_PATTERNS = *.cpp.h"
1746 $(APPEND) [email protected] "PREDEFINED += $(ARCH_BITS_DEFS)"
1747 $(APPEND) [email protected]
1748 $(APPEND) [email protected] "INPUT = $(IPRT_DOXYFILE_INPUT)"
1749 $(APPEND) [email protected]
1750 $(MV) -f [email protected] $@
1751 @$(APPEND) [email protected] "DOXYGEN_OUTPUT_PREV = $(IPRT_DOXYFILE_OUTPUT)"
1752 @$(APPEND) [email protected] "DOXYGEN_INPUT_PREV = $(IPRT_DOXYFILE_INPUT)"
1753
1754# Do the actual job.
1755$(IPRT_OUT_DIR)/docs.iprt: $(IPRT_OUT_DIR)/Doxyfile.iprt $$(IPRT_DOXYFILE_INPUT) | $(IPRT_DOXYFILE_OUTPUT)/
1756 $(RM) -f $(wildcard $(IPRT_DOXYFILE_OUTPUT)/html/*) $(IPRT_OUT_DIR)/docs.iprt
1757 doxygen $(IPRT_OUT_DIR)/Doxyfile.iprt
1758 $(APPEND) $(IPRT_OUT_DIR)/docs.iprt
1759
1760# aliases
1761docs.iprt: $(IPRT_OUT_DIR)/docs.iprt
1762if !defined(VBOX_ONLY_DOCS) && defined(VBOX_WITH_ALL_DOXYGEN_TARGETS)
1763docs: $(IPRT_OUT_DIR)/docs.iprt
1764endif
1765
1766test-doxygen::
1767 @echo test-$(comp-vars IPRT_DOXYFILE_OUTPUT,DOXYGEN_OUTPUT_PREV,FORCE)
1768 @echo $(IPRT_DOXYFILE_OUTPUT)
1769 @echo $(DOXYGEN_OUTPUT_PREV)
1770 @echo $(IPRT_DOXYFILE_INPUT)
1771
1772#
1773# Generate the rules (we're the to sub-makefile).
1774#
1775include $(KBUILD_PATH)/subfooter.kmk
1776
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