VirtualBox

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

Last change on this file since 22561 was 22561, checked in by vboxsync, 16 years ago

IPRT: Added a RTBldCfg API group for stuffing away the SVN_REV and version of the product IPRT is used by.

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