VirtualBox

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

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

IPRT: Split up r3/path.cpp.

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