VirtualBox

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

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

Config.kmk,Makefiles,liblzf-1.51: Removed src/lib/liblzf-1.51 and VBOX_WITH_NEW_LIBLZF.

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