VirtualBox

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

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

sem*-linux.cpp,Makefile.kmk: Added check for cMillies==0 in RTSemEvent and introduced a build config variable IPRT_WITH_FUTEX_BASED_SEMS. Corrected comment in semeventmulti about the futex variable values.

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

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