VirtualBox

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

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

*: The rest of the %V* format specifiers are history.

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