VirtualBox

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

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

Makefiles: Just test for VBOX_WITH_ADDITIONS_DRIVERS.

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