VirtualBox

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

Last change on this file since 34962 was 34801, checked in by vboxsync, 14 years ago

Cross building 32-bit additions binaries while building the win.amd64 additions.

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