VirtualBox

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

Last change on this file since 49598 was 49547, checked in by vboxsync, 11 years ago

Runtime+Main: the x86 directory is only used for Windows, Solaris doesn't need it right now

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 81.6 KB
Line 
1# $Id: Makefile.kmk 49547 2013-11-19 09:58:32Z vboxsync $
2## @file
3# Sub-Makefile for the IPRT.
4#
5
6#
7# Copyright (C) 2006-2013 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 RuntimeGuestR3Shared-x86
36 ifdef VBOX_WITH_ADDITION_DRIVERS
37 LIBRARIES += RuntimeGuestR0
38 #LIBRARIES.os2 += RuntimeGuestR0OS2Warp3
39 LIBRARIES.win.x86 += RuntimeGuestR0NT4
40 endif
41 ifneq ($(VBOX_WITH_COMPATIBLE_LINUX_GUEST_PACKAGE),)
42 LIBRARIES.linux.amd64 += \
43 RuntimeGuestR3-x86 \
44 RuntimeGuestR3Mini-x86 \
45 RuntimeGuestR3Shared-x86
46 endif
47
48else ifdef VBOX_ONLY_TESTSUITE
49 #
50 # Only build the testsuite.
51 #
52 LIBRARIES += RuntimeGuestR3 RuntimeGuestR3Shared RuntimeR3 RuntimeR0
53 LIBRARIES.solaris += RuntimeR0Stub
54 LIBRARIES.win += RuntimeR0Stub
55 LIBRARIES.win.x86 += RuntimeR3VccTricks
56
57else ifdef VBOX_ONLY_DOCS
58 #
59 # Build docs only - need just regular R3 runtime.
60 #
61 LIBRARIES += RuntimeR3 RuntimeBldProg
62
63else ifdef VBOX_ONLY_EXTPACKS_USE_IMPLIBS
64 #
65 # Build docs only - need just regular R3 runtime.
66 #
67 LIBRARIES += RuntimeBldProg
68 LIBRARIES.solaris += RuntimeR0Stub
69 LIBRARIES.win += RuntimeR0Stub RuntimeRCStub
70 include $(PATH_SUB_CURRENT)/tools/Makefile.kmk
71
72else # !VBOX_ONLY_ADDITIONS && !VBOX_ONLY_TESTSUITE && !VBOX_ONLY_DOCS
73
74 #
75 # Normal build.
76 #
77 ifndef VBOX_ONLY_EXTPACKS
78 include $(PATH_SUB_CURRENT)/testcase/Makefile.kmk
79 endif
80 include $(PATH_SUB_CURRENT)/tools/Makefile.kmk
81
82 BLDPROGS += uniread
83 LIBRARIES += RuntimeR3 RuntimeBldProg RuntimeR0 RuntimeEFCPP RuntimeR3NoCRTGCC
84 LIBRARIES.solaris += RuntimeR0Stub
85 LIBRARIES.win += RuntimeR0Stub
86 ifdef VBOX_WITH_RAW_MODE
87 LIBRARIES += RuntimeRC
88 LIBRARIES.win += RuntimeRCStub
89 endif
90 ifdef VBOX_WITH_VBOXDRV
91 LIBRARIES += RuntimeR0Drv
92 endif
93 ifdef VBOX_WITH_ADDITIONS
94 LIBRARIES += RuntimeGuestR3 RuntimeGuestR3Shared RuntimeGuestR3Mini
95 LIBRARIES.win.amd64 += RuntimeGuestR3-x86 RuntimeGuestR3Shared-x86
96 ifneq ($(VBOX_WITH_COMPATIBLE_LINUX_GUEST_PACKAGE),)
97 LIBRARIES.linux.amd64 += \
98 RuntimeGuestR3-x86 \
99 RuntimeGuestR3Mini-x86 \
100 RuntimeGuestR3Shared-x86
101 endif
102 ifdef VBOX_WITH_ADDITION_DRIVERS
103 LIBRARIES += RuntimeGuestR0
104 endif
105 #LIBRARIES.os2 += RuntimeGuestR0OS2Warp3
106 LIBRARIES.win.x86 += RuntimeGuestR0NT4
107 endif # VBOX_WITH_ADDITIONS
108 LIBRARIES.win.x86 += RuntimeR3VccTricks
109 DLLS += VBoxRT
110 ifdef VBOX_WITH_32_ON_64_MAIN_API
111 DLLS += VBoxRT-x86
112 endif
113endif
114
115
116# Always build the ntdll import libraries on windows.
117LIBRARIES.win += RuntimeR3NtDll-x86
118if1of (amd64, $(KBUILD_TARGET_ARCH) $(KBUILD_HOST_ARCH))
119 LIBRARIES.win += RuntimeR3NtDll-amd64
120endif
121
122
123# Always build the import library.
124IMPORT_LIBS += VBoxRTImp
125
126
127# Where the generated stuff goes.
128IPRT_OUT_DIR := $(PATH_TARGET)/Runtime
129BLDDIRS += $(IPRT_OUT_DIR)
130OTHER_CLEAN += \
131 $(IPRT_OUT_DIR)/errmsgdata.h \
132 $(IPRT_OUT_DIR)/errmsgcomdata.h \
133 $(IPRT_OUT_DIR)/errmsgvboxcomdata.h \
134 $(IPRT_OUT_DIR)/errmsgvboxcomdata.h.ts \
135 $(IPRT_OUT_DIR)/Doxyfile.iprt \
136 $(IPRT_OUT_DIR)/Doxyfile.iprt.dep \
137 $(IPRT_OUT_DIR)/docs.iprt
138
139
140#
141# Globals
142#
143VBOX_PATH_RUNTIME_SRC := $(PATH_SUB_CURRENT)
144
145
146#
147# Set the defines that buildconfig.cpp needs. Its used by several targets.
148#
149common/misc/buildconfig.cpp_DEFS = \
150 IPRT_BLDCFG_SCM_REV=$(VBOX_SVN_REV) \
151 IPRT_BLDCFG_VERSION_STRING=\"$(VBOX_VERSION_STRING)\" \
152 IPRT_BLDCFG_VERSION_MAJOR=$(VBOX_VERSION_MAJOR) \
153 IPRT_BLDCFG_VERSION_MINOR=$(VBOX_VERSION_MINOR) \
154 IPRT_BLDCFG_VERSION_BUILD=$(VBOX_VERSION_BUILD) \
155 IPRT_BLDCFG_TARGET=\"$(KBUILD_TARGET)\" \
156 IPRT_BLDCFG_TARGET_ARCH=\"$(KBUILD_TARGET_ARCH)\" \
157 IPRT_BLDCFG_TYPE=\"$(KBUILD_TYPE)\"
158
159#
160# Unicode Specification reader used to regenerate unidata.cpp.
161#
162uniread_TEMPLATE = VBoxBldProg
163uniread_SOURCES = common/string/uniread.cpp
164uniread_INCS = include
165
166#
167# Win64 assembly sources.
168#
169RuntimeWin64ASM_SOURCES = \
170 win/amd64/ASMAtomicBitClear.asm \
171 win/amd64/ASMAtomicBitTestAndToggle.asm \
172 win/amd64/ASMAtomicBitToggle.asm \
173 win/amd64/ASMAtomicReadU64.asm \
174 win/amd64/ASMAtomicXchgU16.asm \
175 win/amd64/ASMAtomicXchgU8.asm \
176 win/amd64/ASMBitFirstClear.asm \
177 win/amd64/ASMBitFirstSet.asm \
178 win/amd64/ASMGetCS.asm \
179 win/amd64/ASMGetDS.asm \
180 win/amd64/ASMGetES.asm \
181 win/amd64/ASMGetFlags.asm \
182 win/amd64/ASMGetFS.asm \
183 win/amd64/ASMGetGS.asm \
184 win/amd64/ASMGetSS.asm \
185 win/amd64/ASMProbeReadByte.asm \
186 win/amd64/ASMSetFlags.asm \
187 win/amd64/ASMGetDR0.asm \
188 win/amd64/ASMGetDR1.asm \
189 win/amd64/ASMGetDR2.asm \
190 win/amd64/ASMGetDR3.asm \
191 win/amd64/ASMGetDR6.asm \
192 win/amd64/ASMGetDR7.asm \
193 common/asm/ASMAtomicCmpXchgU8.asm \
194 common/asm/ASMMultU64ByU32DivByU32.asm \
195 common/asm/ASMCpuId_Idx_ECX.asm \
196 common/asm/ASMNopPause.asm \
197 common/asm/ASMGetIDTR.asm \
198 common/asm/ASMGetGDTR.asm \
199 common/asm/ASMGetLDTR.asm \
200 common/asm/ASMGetSegAttr.asm \
201 common/asm/ASMGetTR.asm
202
203#
204# Win32 assembly sources.
205#
206RuntimeWin32ASM_SOURCES = \
207 common/asm/ASMAtomicCmpXchgU8.asm \
208 common/asm/ASMMultU64ByU32DivByU32.asm \
209 common/asm/ASMCpuId_Idx_ECX.asm \
210 common/asm/ASMGetSegAttr.asm
211
212#
213# NoCRT sources (minus math stuff).
214#
215if1of ($(KBUILD_TARGET_ARCH), amd64 x86)
216RuntimeNoCrt_SOURCES = \
217 common/misc/setjmp.asm \
218 common/string/memchr.asm \
219 common/string/memcmp.asm \
220 common/string/memcpy.asm \
221 common/string/mempcpy.asm \
222 common/string/memmove.asm \
223 common/string/memset.asm \
224 common/string/strchr.asm \
225 common/string/strcpy.asm \
226 common/string/strncpy.asm \
227 common/string/strcmp.asm \
228 common/string/strlen.asm
229endif
230
231
232#
233# RuntimeR3 - Static Runtime for Ring-3 executables.
234#
235RuntimeR3_TEMPLATE = VBoxR3Static
236RuntimeR3_SDKS = VBOX_OPENSSL VBOX_LIBXML2
237RuntimeR3_SDKS.win = $(VBOX_WINPSDK) $(VBOX_WINDDK)
238RuntimeR3_DEFS = IN_RT_R3 IN_SUP_R3 LDR_WITH_NATIVE LDR_WITH_ELF32 LDR_WITH_PE RT_WITH_VBOX RT_NO_GIP
239#RuntimeR3_DEFS += RTMEM_WRAP_TO_EF_APIS
240ifdef IPRT_WITH_KSTUFF
241 RuntimeR3_DEFS += LDR_WITH_KLDR
242endif
243ifdef IPRT_WITH_LZJB
244 RuntimeR3_DEFS += RTZIP_USE_LZJB
245endif
246ifdef IPRT_WITH_LZO
247 RuntimeR3_DEFS += RTZIP_USE_LZO
248endif
249ifn1of ($(KBUILD_TARGET), win)
250 RuntimeR3_DEFS += RT_WITH_ICONV_CACHE
251endif
252ifdef IPRT_WITH_FUTEX_BASED_SEMS
253 RuntimeR3_DEFS.linux += IPRT_WITH_FUTEX_BASED_SEMS
254endif
255RuntimeR3_INCS = \
256 include \
257 $(SDK_VBOX_ZLIB_INCS)
258RuntimeR3_INCS += \
259 $(PATH_ROOT)/src/libs/liblzf-3.4
260ifdef IPRT_WITH_KSTUFF
261 RuntimeR3_INCS += \
262 $(PATH_ROOT)/src/libs/kStuff/kStuff/include
263endif
264
265# RuntimeR3_INCS.solaris = \
266# /usr/include
267
268RuntimeR3_SOURCES = \
269 common/alloc/alloc.cpp \
270 common/alloc/heapsimple.cpp \
271 common/alloc/heapoffset.cpp \
272 common/alloc/memcache.cpp \
273 common/alloc/memtracker.cpp \
274 common/checksum/adler32.cpp \
275 common/checksum/crc32.cpp \
276 common/checksum/crc64.cpp \
277 common/checksum/md5.cpp \
278 common/checksum/md5str.cpp \
279 common/checksum/ipv4.cpp \
280 common/checksum/ipv6.cpp \
281 common/checksum/manifest.cpp \
282 common/checksum/manifest2.cpp \
283 common/checksum/manifest3.cpp \
284 common/checksum/manifest-file.cpp \
285 common/checksum/RTSha1Digest.cpp \
286 common/checksum/RTSha256Digest.cpp \
287 common/checksum/sha1.cpp \
288 common/checksum/sha1str.cpp \
289 common/checksum/sha256.cpp \
290 common/checksum/sha256str.cpp \
291 common/checksum/sha512.cpp \
292 common/checksum/sha512str.cpp \
293 common/dbg/dbg.cpp \
294 common/dbg/dbgas.cpp \
295 common/dbg/dbgcfg.cpp \
296 common/dbg/dbgmod.cpp \
297 common/dbg/dbgmodldr.cpp \
298 common/dbg/dbgmodcontainer.cpp \
299 common/dbg/dbgmoddeferred.cpp \
300 common/dbg/dbgmodexports.cpp \
301 common/dbg/dbgmodcodeview.cpp \
302 common/dbg/dbgmoddwarf.cpp \
303 common/dbg/dbgmodnm.cpp \
304 common/dvm/dvm.cpp \
305 common/dvm/dvmbsdlabel.cpp \
306 common/dvm/dvmgpt.cpp \
307 common/dvm/dvmmbr.cpp \
308 common/dvm/dvmvfs.cpp \
309 common/err/errinfo.cpp \
310 common/err/errmsg.cpp \
311 common/err/RTErrConvertFromErrno.cpp \
312 common/err/RTErrConvertToErrno.cpp \
313 common/filesystem/filesystem.cpp \
314 common/filesystem/filesystemext.cpp \
315 common/ldr/ldr.cpp \
316 common/ldr/ldrELF.cpp \
317 common/ldr/ldrEx.cpp \
318 common/ldr/ldrFile.cpp \
319 common/ldr/ldrMemory.cpp \
320 common/ldr/ldrNative.cpp \
321 common/ldr/ldrPE.cpp \
322 common/log/log.cpp \
323 common/log/logellipsis.cpp \
324 common/log/logrel.cpp \
325 common/log/logrelellipsis.cpp \
326 common/log/logcom.cpp \
327 common/log/logformat.cpp \
328 common/log/tracebuf.cpp \
329 common/log/tracedefault.cpp \
330 common/misc/RTAssertMsg1Weak.cpp \
331 common/misc/RTAssertMsg2.cpp \
332 common/misc/RTAssertMsg2Add.cpp \
333 common/misc/RTAssertMsg2AddWeak.cpp \
334 common/misc/RTAssertMsg2AddWeakV.cpp \
335 common/misc/RTAssertMsg2Weak.cpp \
336 common/misc/RTAssertMsg2WeakV.cpp \
337 common/misc/RTFileModeToFlags.cpp \
338 common/misc/RTFileOpenF.cpp \
339 common/misc/RTFileOpenV.cpp \
340 common/misc/RTMemWipeThoroughly.cpp \
341 common/misc/assert.cpp \
342 common/misc/buildconfig.cpp \
343 common/misc/cidr.cpp \
344 common/misc/getopt.cpp \
345 common/misc/getoptargv.cpp \
346 common/misc/handle.cpp \
347 common/misc/handletable.cpp \
348 common/misc/handletablectx.cpp \
349 common/misc/handletablesimple.cpp \
350 common/misc/lockvalidator.cpp \
351 common/misc/message.cpp \
352 common/misc/once.cpp \
353 common/misc/req.cpp \
354 common/misc/reqpool.cpp \
355 common/misc/reqqueue.cpp \
356 common/misc/sanity-c.c \
357 common/misc/sanity-cpp.cpp \
358 common/misc/semspingpong.cpp \
359 common/misc/sg.cpp \
360 common/misc/circbuf.cpp \
361 common/misc/thread.cpp \
362 common/misc/term.cpp \
363 common/misc/uri.cpp \
364 common/net/netaddrstr.cpp \
365 common/net/netaddrstr2.cpp \
366 common/net/macstr.cpp \
367 common/path/rtPathRootSpecLen.cpp \
368 common/path/rtPathVolumeSpecLen.cpp \
369 common/path/RTPathAbsDup.cpp \
370 common/path/RTPathAbsEx.cpp \
371 common/path/RTPathAbsExDup.cpp \
372 common/path/RTPathAppend.cpp \
373 common/path/RTPathAppendEx.cpp \
374 common/path/RTPathCalcRelative.cpp \
375 common/path/RTPathChangeToDosSlashes.cpp \
376 common/path/RTPathChangeToUnixSlashes.cpp \
377 common/path/RTPathCopyComponents.cpp \
378 common/path/RTPathCountComponents.cpp \
379 common/path/RTPathExt.cpp \
380 common/path/RTPathFilename.cpp \
381 common/path/RTPathHasExt.cpp \
382 common/path/RTPathHasPath.cpp \
383 common/path/RTPathJoin.cpp \
384 common/path/RTPathJoinA.cpp \
385 common/path/RTPathJoinEx.cpp \
386 common/path/RTPathParse.cpp \
387 common/path/RTPathParsedReassemble.cpp \
388 common/path/RTPathParseSimple.cpp \
389 common/path/RTPathRealDup.cpp \
390 common/path/RTPathRmCmd.cpp \
391 common/path/RTPathSplit.cpp \
392 common/path/RTPathSplitA.cpp \
393 common/path/RTPathSplitReassemble.cpp \
394 common/path/RTPathStartsWithRoot.cpp \
395 common/path/RTPathStripExt.cpp \
396 common/path/RTPathStripFilename.cpp \
397 common/path/RTPathStripTrailingSlash.cpp \
398 common/path/RTPathTraverseList.cpp \
399 common/path/comparepaths.cpp \
400 common/rand/rand.cpp \
401 common/rand/randadv.cpp \
402 common/rand/randparkmiller.cpp \
403 common/sort/RTSortIsSorted.cpp \
404 common/sort/RTSortApvIsSorted.cpp \
405 common/sort/shellsort.cpp \
406 common/string/RTStrCat.cpp \
407 common/string/RTStrCatEx.cpp \
408 common/string/RTStrCatP.cpp \
409 common/string/RTStrCatPEx.cpp \
410 common/string/RTStrCmp.cpp \
411 common/string/RTStrCopy.cpp \
412 common/string/RTStrCopyEx.cpp \
413 common/string/RTStrCopyP.cpp \
414 common/string/RTStrCopyPEx.cpp \
415 common/string/RTStrNCmp.cpp \
416 common/string/RTStrNLen.cpp \
417 common/string/RTStrNLenEx.cpp \
418 common/string/RTStrPrintHexBytes.cpp \
419 common/string/RTStrStr.cpp \
420 common/string/base64.cpp \
421 common/string/simplepattern.cpp \
422 common/string/straprintf.cpp \
423 common/string/strformat.cpp \
424 common/string/strformatnum.cpp \
425 common/string/strformatrt.cpp \
426 common/string/strformattype.cpp \
427 common/string/strhash1.cpp \
428 common/string/stringalloc.cpp \
429 common/string/strprintf.cpp \
430 common/string/strcache.cpp \
431 common/string/strspace.cpp \
432 common/string/strstrip.cpp \
433 common/string/strtonum.cpp \
434 common/string/strversion.cpp \
435 common/string/uni.cpp \
436 common/string/unidata.cpp \
437 common/string/utf-16.cpp \
438 common/string/utf-8.cpp \
439 common/string/utf-8-case.cpp \
440 common/string/ministring.cpp \
441 common/table/avlgcptr.cpp \
442 common/table/avlhcphys.cpp \
443 common/table/avlgcphys.cpp \
444 common/table/avllu32.cpp \
445 common/table/avlou32.cpp \
446 common/table/avlogcphys.cpp \
447 common/table/avlogcptr.cpp \
448 common/table/avlohcphys.cpp \
449 common/table/avloioport.cpp \
450 common/table/avlpv.cpp \
451 common/table/avlrgcptr.cpp \
452 common/table/avlrogcphys.cpp \
453 common/table/avlrogcptr.cpp \
454 common/table/avlroioport.cpp \
455 common/table/avlroogcptr.cpp \
456 common/table/avlrpv.cpp \
457 common/table/avlruintptr.cpp \
458 common/table/avlrfoff.cpp \
459 common/table/avlru64.cpp \
460 common/table/avlu32.cpp \
461 common/table/avluintptr.cpp \
462 common/table/avlul.cpp \
463 common/table/table.cpp \
464 common/time/time.cpp \
465 common/time/timeprog.cpp \
466 common/time/timesup.cpp \
467 common/vfs/vfsbase.cpp \
468 common/vfs/vfschain.cpp \
469 common/vfs/vfsiosmisc.cpp \
470 common/vfs/vfsmemory.cpp \
471 common/vfs/vfsmisc.cpp \
472 common/vfs/vfsstdfile.cpp \
473 common/zip/tar.cpp \
474 common/zip/tarcmd.cpp \
475 common/zip/tarvfs.cpp \
476 common/zip/gzipvfs.cpp \
477 common/zip/zip.cpp \
478 generic/createtemp-generic.cpp \
479 generic/critsect-generic.cpp \
480 generic/critsectrw-generic.cpp \
481 generic/env-generic.cpp \
482 generic/RTDirCreateUniqueNumbered-generic.cpp \
483 generic/RTEnvDupEx-generic.cpp \
484 generic/RTFileCopy-generic.cpp \
485 generic/RTFileQuerySize-generic.cpp \
486 generic/RTFileReadAll-generic.cpp \
487 generic/RTFileReadAllEx-generic.cpp \
488 generic/RTFileReadAllByHandle-generic.cpp \
489 generic/RTFileReadAllByHandleEx-generic.cpp \
490 generic/RTFileReadAllFree-generic.cpp \
491 generic/RTLogWriteStdErr-generic.cpp \
492 generic/RTLogWriteStdOut-generic.cpp \
493 generic/RTLogWriteUser-generic.cpp \
494 generic/RTPathIsSame-generic.cpp \
495 generic/RTProcessQueryUsernameA-generic.cpp \
496 generic/RTTimerLRCreate-generic.cpp \
497 generic/mempool-generic.cpp \
498 generic/semfastmutex-generic.cpp \
499 generic/semxroads-generic.cpp \
500 generic/spinlock-generic.cpp \
501 generic/timerlr-generic.cpp \
502 r3/alloc-ef.cpp \
503 r3/alloc.cpp \
504 r3/allocex.cpp \
505 r3/dir.cpp \
506 r3/dir2.cpp \
507 r3/fileio.cpp \
508 r3/fs.cpp \
509 r3/init.cpp \
510 r3/isofs.cpp \
511 r3/path.cpp \
512 r3/poll.cpp \
513 r3/process.cpp \
514 r3/socket.cpp \
515 r3/stream.cpp \
516 r3/test.cpp \
517 r3/testi.cpp \
518 r3/tcp.cpp \
519 r3/udp.cpp \
520 r3/generic/semspinmutex-r3-generic.cpp \
521 r3/xml.cpp \
522 common/zip/xarvfs.cpp
523
524
525#if1of ($(KBUILD_TARGET_ARCH),amd64 x86)
526# RuntimeR3_SOURCES += common/time/timesupA.asm
527#else
528 RuntimeR3_SOURCES += common/time/timesupref.cpp
529#endif
530
531RuntimeR3_SOURCES.x86 += \
532 generic/RTMpGetDescription-generic.cpp
533RuntimeR3_SOURCES.amd64 += \
534 generic/RTMpGetDescription-generic.cpp
535RuntimeR3_SOURCES.sparc32 += \
536 generic/RTMpGetDescription-generic-stub.cpp \
537 common/asm/asm-fake.cpp
538RuntimeR3_SOURCES.sparc64 += \
539 generic/RTMpGetDescription-generic-stub.cpp \
540 common/asm/asm-fake.cpp
541
542ifdef IPRT_WITH_LZJB
543 RuntimeR3_SOURCES += common/misc/lzjb.c
544endif
545
546# AMD64 / x86 assembly code.
547RuntimeR3_SOURCES.x86 += \
548 common/asm/ASMCpuIdExSlow.asm
549RuntimeR3_SOURCES.amd64 += \
550 common/asm/ASMCpuIdExSlow.asm
551
552# Some versions of GCC might require this.
553RuntimeR3_SOURCES.x86 += \
554 common/asm/ASMAtomicXchgU64.asm \
555 common/asm/ASMAtomicCmpXchgU64.asm \
556 common/asm/ASMAtomicCmpXchgExU64.asm \
557 common/asm/ASMAtomicReadU64.asm \
558 common/asm/ASMAtomicUoReadU64.asm
559
560ifdef IPRT_WITH_KSTUFF
561 RuntimeR3_SOURCES += \
562 common/ldr/ldrkStuff.cpp
563endif
564
565# VBox specific stuff.
566RuntimeR3_SOURCES += \
567 VBox/RTAssertShouldPanic-vbox.cpp \
568 VBox/log-vbox.cpp
569ifneq ($(KBUILD_TARGET),win)
570RuntimeR3_SOURCES += \
571 common/err/errmsgxpcom.cpp
572endif
573if1of ($(KBUILD_TARGET),freebsd linux netbsd openbsd solaris)
574RuntimeR3_SOURCES += \
575 $(if $(VBOX_WITH_DBUS),VBox/dbus.cpp,)
576endif
577
578VBOX_WITH_NT_DIRENUM = 1
579RuntimeR3_SOURCES.win = \
580 common/dbg/dbgmoddbghelp.cpp \
581 generic/cdrom-generic.cpp \
582 generic/RTDirExists-generic.cpp \
583 generic/RTDirQueryInfo-generic.cpp \
584 generic/RTDirSetTimes-generic.cpp \
585 generic/RTFileExists-generic.cpp \
586 generic/RTMpGetCurFrequency-generic.cpp \
587 generic/RTMpGetMaxFrequency-generic.cpp \
588 generic/RTRandAdvCreateSystemFaster-generic.cpp \
589 generic/RTRandAdvCreateSystemTruer-generic.cpp \
590 generic/RTSemEventWait-generic.cpp \
591 generic/RTSemEventMultiWait-2-ex-generic.cpp \
592 generic/RTSemEventMultiWaitNoResume-2-ex-generic.cpp \
593 generic/RTSemMutexRequest-generic.cpp \
594 generic/RTSemMutexRequestDebug-generic.cpp \
595 generic/RTThreadSetAffinityToCpu-generic.cpp \
596 generic/mppresent-generic.cpp \
597 generic/semrw-$(if-expr defined(VBOX_WITH_LOCKLESS_SEMRW),lockless-,)generic.cpp \
598 generic/uuid-generic.cpp \
599 generic/RTProcDaemonize-generic.cpp \
600 generic/RTProcIsRunningByName-generic.cpp \
601 generic/RTThreadGetNativeState-generic.cpp \
602 nt/RTErrConvertFromNtStatus.cpp \
603 r3/nt/fs-nt.cpp \
604 r3/nt/pathint-nt.cpp \
605 r3/posix/env-posix.cpp \
606 r3/win/RTHandleGetStandard-win.cpp \
607 r3/win/RTSystemQueryOSInfo-win.cpp \
608 r3/win/RTSystemShutdown-win.cpp \
609 r3/win/RTSystemQueryDmiString-win.cpp \
610 r3/win/RTSystemQueryTotalRam-win.cpp \
611 r3/win/alloc-win.cpp \
612 r3/win/allocex-win.cpp \
613 r3/win/dir-win.cpp \
614 $(if-expr defined(VBOX_WITH_NT_DIRENUM),r3/nt/direnum-r3-nt.cpp,r3/win/direnum-win.cpp) \
615 r3/win/errvars-win.cpp \
616 r3/win/fileio-win.cpp \
617 r3/win/init-win.cpp \
618 r3/win/ldrNative-win.cpp \
619 r3/win/localipc-win.cpp \
620 r3/win/mp-win.cpp \
621 r3/win/path-win.cpp \
622 r3/win/pipe-win.cpp \
623 r3/win/process-win.cpp \
624 r3/win/RTLogWriteDebugger-win.cpp \
625 r3/win/rtProcInitExePath-win.cpp \
626 r3/win/sched-win.cpp \
627 r3/win/semevent-win.cpp \
628 r3/win/semeventmulti-win.cpp \
629 r3/win/semmutex-win.cpp \
630 r3/win/symlink-win.cpp \
631 r3/win/rtFileNativeSetAttributes-win.cpp \
632 r3/win/thread-win.cpp \
633 r3/win/thread2-win.cpp \
634 r3/win/time-win.cpp \
635 r3/win/timer-win.cpp \
636 r3/win/tls-win.cpp \
637 r3/win/utf16locale-win.cpp \
638 r3/win/utf8-win.cpp \
639 r3/win/RTUuidCreate-win.cpp \
640 win/errmsgwin.cpp \
641 win/RTErrConvertFromWin32.cpp
642
643RuntimeR3_SOURCES.win.amd64 := $(RuntimeWin64ASM_SOURCES)
644RuntimeR3_SOURCES.win.x86 := $(RuntimeWin32ASM_SOURCES)
645
646RuntimeR3_SOURCES.linux = \
647 generic/cdrom-generic.cpp \
648 generic/RTDirQueryInfo-generic.cpp \
649 generic/RTDirSetTimes-generic.cpp \
650 generic/RTFileMove-generic.cpp \
651 generic/RTLogWriteDebugger-generic.cpp \
652 generic/RTProcDaemonize-generic.cpp \
653 generic/RTSemEventMultiWait-2-ex-generic.cpp \
654 generic/RTSemEventMultiWaitNoResume-2-ex-generic.cpp \
655 generic/RTTimeLocalNow-generic.cpp \
656 generic/RTTimerCreate-generic.cpp \
657 generic/RTThreadSetAffinityToCpu-generic.cpp \
658 generic/RTUuidCreate-generic.cpp \
659 generic/mppresent-generic.cpp \
660 generic/utf16locale-generic.cpp \
661 generic/uuid-generic.cpp \
662 r3/posix/allocex-r3-posix.cpp \
663 r3/linux/RTThreadGetNativeState-linux.cpp \
664 r3/linux/mp-linux.cpp \
665 r3/linux/rtProcInitExePath-linux.cpp \
666 r3/linux/sched-linux.cpp \
667 r3/linux/sysfs.cpp \
668 r3/linux/time-linux.cpp \
669 r3/linux/thread-affinity-linux.cpp \
670 r3/linux/RTProcIsRunningByName-linux.cpp \
671 r3/linux/RTSystemQueryDmiString-linux.cpp \
672 r3/linux/RTSystemShutdown-linux.cpp \
673 r3/posix/RTFileQueryFsSizes-posix.cpp \
674 r3/posix/RTHandleGetStandard-posix.cpp \
675 r3/posix/RTMemProtect-posix.cpp \
676 r3/posix/RTPathUserHome-posix.cpp \
677 r3/posix/RTSystemQueryOSInfo-posix.cpp \
678 r3/linux/systemmem-linux.cpp \
679 r3/posix/RTTimeNow-posix.cpp \
680 r3/posix/RTTimeSet-posix.cpp \
681 r3/posix/rtmempage-exec-mmap-heap-posix.cpp \
682 r3/posix/dir-posix.cpp \
683 r3/posix/env-posix.cpp \
684 r3/posix/errvars-posix.cpp \
685 r3/posix/fileio-posix.cpp \
686 r3/posix/fileio2-posix.cpp \
687 r3/posix/filelock-posix.cpp \
688 r3/posix/fs-posix.cpp \
689 r3/posix/fs2-posix.cpp \
690 r3/posix/fs3-posix.cpp \
691 r3/posix/ldrNative-posix.cpp \
692 r3/posix/path-posix.cpp \
693 r3/posix/path2-posix.cpp \
694 r3/posix/pathhost-posix.cpp \
695 r3/posix/RTPathUserDocuments-posix.cpp \
696 r3/posix/pipe-posix.cpp \
697 r3/posix/process-posix.cpp \
698 r3/posix/process-creation-posix.cpp \
699 r3/posix/rand-posix.cpp \
700 r3/posix/semrw-posix.cpp \
701 r3/posix/symlink-posix.cpp \
702 r3/posix/thread-posix.cpp \
703 r3/posix/thread2-posix.cpp \
704 r3/posix/timelocal-posix.cpp \
705 r3/posix/timer-posix.cpp \
706 r3/posix/tls-posix.cpp \
707 r3/posix/utf8-posix.cpp
708ifdef IPRT_WITH_FUTEX_BASED_SEMS
709 RuntimeR3_SOURCES.linux += \
710 r3/linux/semevent-linux.cpp \
711 r3/linux/semeventmulti-linux.cpp \
712 r3/linux/semmutex-linux.cpp
713else
714 RuntimeR3_SOURCES.linux.x86 += \
715 r3/posix/semevent-posix.cpp \
716 r3/posix/semeventmulti-posix.cpp \
717 r3/posix/semmutex-posix.cpp
718 RuntimeR3_SOURCES.linux.amd64 += \
719 r3/linux/semevent-linux.cpp \
720 r3/linux/semeventmulti-linux.cpp
721 ifdef RT_NEW_LINUX_MUTEX_CODE
722 RuntimeR3_SOURCES.linux.amd64 += \
723 r3/linux/semmutex-linux.cpp
724 else
725 RuntimeR3_SOURCES.linux.amd64 += \
726 r3/posix/semmutex-posix.cpp
727 endif
728endif
729
730RuntimeR3_SOURCES.os2 = \
731 generic/cdrom-generic.cpp \
732 generic/RTDirQueryInfo-generic.cpp \
733 generic/RTDirSetTimes-generic.cpp \
734 generic/RTFileMove-generic.cpp \
735 generic/RTLogWriteDebugger-generic.cpp \
736 generic/RTProcDaemonize-generic.cpp \
737 generic/RTRandAdvCreateSystemFaster-generic.cpp \
738 generic/RTRandAdvCreateSystemTruer-generic.cpp \
739 generic/RTSystemQueryDmiString-generic.cpp \
740 generic/RTSystemShutdown-generic.cpp \
741 generic/RTTimeLocalNow-generic.cpp \
742 generic/RTTimerCreate-generic.cpp \
743 generic/RTThreadSetAffinityToCpu-generic.cpp \
744 generic/RTUuidCreate-generic.cpp \
745 generic/mppresent-generic.cpp \
746 generic/RTSemEventWait-generic.cpp \
747 generic/RTSemEventMultiWait-generic.cpp \
748 generic/RTSemMutexRequest-generic.cpp \
749 generic/RTSemMutexRequestDebug-generic.cpp \
750 generic/semrw-$(if-expr defined(VBOX_WITH_LOCKLESS_SEMRW),lockless-,)generic.cpp \
751 generic/timer-generic.cpp \
752 generic/utf16locale-generic.cpp \
753 generic/uuid-generic.cpp \
754 generic/RTMpGetCoreCount-generic.cpp \
755 generic/RTMpGetOnlineCoreCount-generic.cpp \
756 generic/RTMpGetCurFrequency-generic.cpp \
757 generic/RTMpGetMaxFrequency-generic.cpp \
758 generic/RTProcIsRunningByName-generic.cpp \
759 generic/RTThreadGetNativeState-generic.cpp \
760 os2/RTErrConvertFromOS2.cpp \
761 r3/generic/allocex-r3-generic.cpp \
762 r3/os2/filelock-os2.cpp \
763 r3/os2/mp-os2.cpp \
764 r3/os2/pipe-os2.cpp \
765 r3/os2/rtProcInitExePath-os2.cpp \
766 r3/os2/sched-os2.cpp \
767 r3/os2/sems-os2.cpp \
768 r3/os2/systemmem-os2.cpp \
769 r3/os2/thread-os2.cpp \
770 r3/os2/time-os2.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/RTTimeNow-posix.cpp \
777 r3/posix/RTTimeSet-posix.cpp \
778 r3/posix/dir-posix.cpp \
779 r3/posix/env-posix.cpp \
780 r3/posix/errvars-posix.cpp \
781 r3/posix/fileio-posix.cpp \
782 r3/posix/fileio2-posix.cpp \
783 r3/posix/fs-posix.cpp \
784 r3/posix/fs2-posix.cpp \
785 r3/posix/fs3-posix.cpp \
786 r3/posix/ldrNative-posix.cpp \
787 r3/posix/path-posix.cpp \
788 r3/posix/path2-posix.cpp \
789 r3/posix/pathhost-posix.cpp \
790 r3/posix/rtmempage-exec-mmap-heap-posix.cpp \
791 r3/posix/RTPathUserDocuments-posix.cpp \
792 r3/posix/process-posix.cpp \
793 r3/posix/process-creation-posix.cpp \
794 r3/posix/symlink-posix.cpp \
795 r3/posix/timelocal-posix.cpp \
796 r3/posix/utf8-posix.cpp
797
798RuntimeR3_SOURCES.darwin = \
799 darwin/RTErrConvertFromDarwin.cpp \
800 darwin/RTErrConvertFromDarwinCOM.cpp \
801 darwin/RTErrConvertFromDarwinIO.cpp \
802 darwin/RTErrConvertFromDarwinKern.cpp \
803 generic/cdrom-generic.cpp \
804 generic/RTDirQueryInfo-generic.cpp \
805 generic/RTDirSetTimes-generic.cpp \
806 generic/RTFileMove-generic.cpp \
807 generic/RTLogWriteDebugger-generic.cpp \
808 generic/RTProcDaemonize-generic.cpp \
809 generic/RTThreadGetAffinity-stub-generic.cpp \
810 generic/RTThreadSetAffinity-stub-generic.cpp \
811 generic/RTThreadSetAffinityToCpu-generic.cpp \
812 generic/RTTimeLocalNow-generic.cpp \
813 generic/RTTimerCreate-generic.cpp \
814 generic/RTUuidCreate-generic.cpp \
815 generic/mppresent-generic.cpp \
816 generic/RTMpGetOnlineCoreCount-generic.cpp \
817 generic/RTSemEventMultiWait-2-ex-generic.cpp \
818 generic/RTSemEventMultiWaitNoResume-2-ex-generic.cpp \
819 generic/semrw-$(if-expr defined(VBOX_WITH_LOCKLESS_SEMRW),lockless-,)generic.cpp \
820 generic/RTSystemShutdown-generic.cpp \
821 generic/timer-generic.cpp \
822 generic/utf16locale-generic.cpp \
823 generic/uuid-generic.cpp\
824 generic/RTProcIsRunningByName-generic.cpp \
825 generic/RTThreadGetNativeState-generic.cpp \
826 r3/darwin/filelock-darwin.cpp \
827 r3/darwin/mp-darwin.cpp \
828 r3/darwin/pathhost-darwin.cpp \
829 r3/darwin/rtProcInitExePath-darwin.cpp \
830 r3/darwin/RTSystemQueryDmiString-darwin.cpp \
831 r3/darwin/sched-darwin.cpp \
832 r3/darwin/systemmem-darwin.cpp \
833 r3/darwin/time-darwin.cpp \
834 r3/darwin/RTPathUserDocuments-darwin.cpp \
835 r3/generic/allocex-r3-generic.cpp \
836 r3/posix/RTFileQueryFsSizes-posix.cpp \
837 r3/posix/RTHandleGetStandard-posix.cpp \
838 r3/posix/RTMemProtect-posix.cpp \
839 r3/posix/RTPathUserHome-posix.cpp \
840 r3/posix/RTSystemQueryOSInfo-posix.cpp \
841 r3/posix/RTTimeSet-posix.cpp \
842 r3/posix/dir-posix.cpp \
843 r3/posix/env-posix.cpp \
844 r3/posix/errvars-posix.cpp \
845 r3/posix/fileio-posix.cpp \
846 r3/posix/fileio2-posix.cpp \
847 r3/posix/fs-posix.cpp \
848 r3/posix/fs2-posix.cpp \
849 r3/posix/fs3-posix.cpp \
850 r3/posix/ldrNative-posix.cpp \
851 r3/posix/rtmempage-exec-mmap-heap-posix.cpp \
852 r3/posix/path-posix.cpp \
853 r3/posix/path2-posix.cpp \
854 r3/posix/pipe-posix.cpp \
855 r3/posix/process-posix.cpp \
856 r3/posix/process-creation-posix.cpp \
857 r3/posix/rand-posix.cpp \
858 r3/posix/semevent-posix.cpp \
859 r3/posix/semeventmulti-posix.cpp \
860 r3/posix/semmutex-posix.cpp \
861 r3/posix/symlink-posix.cpp \
862 r3/posix/thread-posix.cpp \
863 r3/posix/thread2-posix.cpp \
864 r3/posix/timelocal-posix.cpp \
865 r3/posix/tls-posix.cpp \
866 r3/posix/utf8-posix.cpp
867
868## @todo Make BSD sched, implement RTMP*.
869RuntimeR3_SOURCES.freebsd = \
870 generic/cdrom-generic.cpp \
871 generic/RTDirQueryInfo-generic.cpp \
872 generic/RTDirSetTimes-generic.cpp \
873 generic/RTFileMove-generic.cpp \
874 generic/RTLogWriteDebugger-generic.cpp \
875 generic/RTSemEventMultiWait-2-ex-generic.cpp \
876 generic/RTSemEventMultiWaitNoResume-2-ex-generic.cpp \
877 generic/RTSystemQueryDmiString-generic.cpp \
878 generic/RTSystemShutdown-generic.cpp \
879 generic/RTThreadGetAffinity-stub-generic.cpp \
880 generic/RTThreadSetAffinity-stub-generic.cpp \
881 generic/RTThreadSetAffinityToCpu-generic.cpp \
882 generic/RTTimeLocalNow-generic.cpp \
883 generic/RTTimerCreate-generic.cpp \
884 generic/RTUuidCreate-generic.cpp \
885 generic/mppresent-generic.cpp \
886 generic/sched-generic.cpp \
887 generic/utf16locale-generic.cpp \
888 generic/uuid-generic.cpp \
889 generic/RTMpCpuId-generic.cpp \
890 generic/RTMpGetCoreCount-generic.cpp \
891 generic/RTMpGetOnlineCoreCount-generic.cpp \
892 generic/RTProcDaemonize-generic.cpp \
893 generic/RTProcIsRunningByName-generic.cpp \
894 generic/RTThreadGetNativeState-generic.cpp \
895 r3/freebsd/mp-freebsd.cpp \
896 r3/freebsd/rtProcInitExePath-freebsd.cpp \
897 r3/generic/allocex-r3-generic.cpp \
898 r3/posix/RTFileQueryFsSizes-posix.cpp \
899 r3/posix/RTHandleGetStandard-posix.cpp \
900 r3/posix/RTMemProtect-posix.cpp \
901 r3/posix/RTPathUserHome-posix.cpp \
902 r3/posix/RTSystemQueryOSInfo-posix.cpp \
903 r3/posix/RTSystemQueryTotalRam-posix.cpp \
904 r3/posix/RTTimeNow-posix.cpp \
905 r3/posix/RTTimeSet-posix.cpp \
906 r3/posix/dir-posix.cpp \
907 r3/posix/env-posix.cpp \
908 r3/posix/errvars-posix.cpp \
909 r3/posix/fileio-posix.cpp \
910 r3/posix/fileio2-posix.cpp \
911 r3/posix/filelock-posix.cpp \
912 r3/posix/fs-posix.cpp \
913 r3/posix/fs2-posix.cpp \
914 r3/posix/fs3-posix.cpp \
915 r3/posix/ldrNative-posix.cpp \
916 r3/posix/rtmempage-exec-mmap-heap-posix.cpp \
917 r3/posix/path-posix.cpp \
918 r3/posix/path2-posix.cpp \
919 r3/posix/pathhost-posix.cpp \
920 r3/posix/RTPathUserDocuments-posix.cpp \
921 r3/posix/pipe-posix.cpp \
922 r3/posix/process-posix.cpp \
923 r3/posix/process-creation-posix.cpp \
924 r3/posix/rand-posix.cpp \
925 r3/posix/semevent-posix.cpp \
926 r3/posix/semeventmulti-posix.cpp \
927 r3/posix/semmutex-posix.cpp \
928 r3/posix/semrw-posix.cpp \
929 r3/posix/symlink-posix.cpp \
930 r3/posix/thread-posix.cpp \
931 r3/posix/thread2-posix.cpp \
932 r3/posix/time-posix.cpp \
933 r3/posix/timelocal-posix.cpp \
934 r3/posix/timer-posix.cpp \
935 r3/posix/tls-posix.cpp \
936 r3/posix/utf8-posix.cpp
937
938RuntimeR3_SOURCES.solaris = \
939 generic/cdrom-generic.cpp \
940 generic/RTDirQueryInfo-generic.cpp \
941 generic/RTDirSetTimes-generic.cpp \
942 generic/RTFileMove-generic.cpp \
943 generic/RTLogWriteDebugger-generic.cpp \
944 generic/RTProcDaemonize-generic.cpp \
945 generic/RTProcIsRunningByName-generic.cpp \
946 generic/RTSemEventMultiWait-2-ex-generic.cpp \
947 generic/RTSemEventMultiWaitNoResume-2-ex-generic.cpp \
948 generic/RTThreadSetAffinityToCpu-generic.cpp \
949 generic/RTTimeLocalNow-generic.cpp \
950 generic/RTTimerCreate-generic.cpp \
951 generic/RTUuidCreate-generic.cpp \
952 generic/sched-generic.cpp \
953 generic/utf16locale-generic.cpp \
954 generic/uuid-generic.cpp \
955 generic/RTThreadGetNativeState-generic.cpp \
956 r3/generic/allocex-r3-generic.cpp \
957 r3/posix/RTFileQueryFsSizes-posix.cpp \
958 r3/posix/RTHandleGetStandard-posix.cpp \
959 r3/posix/RTMemProtect-posix.cpp \
960 r3/posix/RTPathUserHome-posix.cpp \
961 r3/posix/RTSystemQueryOSInfo-posix.cpp \
962 r3/posix/RTTimeNow-posix.cpp \
963 r3/posix/RTTimeSet-posix.cpp \
964 r3/posix/dir-posix.cpp \
965 r3/posix/env-posix.cpp \
966 r3/posix/errvars-posix.cpp \
967 r3/posix/fileio-posix.cpp \
968 r3/posix/fileio2-posix.cpp \
969 r3/posix/filelock-posix.cpp \
970 r3/posix/fs-posix.cpp \
971 r3/posix/fs2-posix.cpp \
972 r3/posix/fs3-posix.cpp \
973 r3/posix/ldrNative-posix.cpp \
974 r3/posix/rtmempage-exec-mmap-heap-posix.cpp \
975 r3/posix/path-posix.cpp \
976 r3/posix/path2-posix.cpp \
977 r3/posix/pathhost-posix.cpp \
978 r3/posix/RTPathUserDocuments-posix.cpp \
979 r3/posix/pipe-posix.cpp \
980 r3/posix/process-posix.cpp \
981 r3/posix/process-creation-posix.cpp \
982 r3/posix/rand-posix.cpp \
983 r3/posix/semevent-posix.cpp \
984 r3/posix/semeventmulti-posix.cpp \
985 r3/posix/semmutex-posix.cpp \
986 r3/posix/semrw-posix.cpp \
987 r3/posix/symlink-posix.cpp \
988 r3/posix/thread-posix.cpp \
989 r3/posix/thread2-posix.cpp \
990 r3/posix/time-posix.cpp \
991 r3/posix/timelocal-posix.cpp \
992 r3/posix/timer-posix.cpp \
993 r3/posix/tls-posix.cpp \
994 r3/posix/utf8-posix.cpp \
995 r3/solaris/systemmem-solaris.cpp \
996 r3/solaris/mp-solaris.cpp \
997 r3/solaris/rtProcInitExePath-solaris.cpp \
998 r3/solaris/RTSystemShutdown-solaris.cpp \
999 r3/solaris/thread-affinity-solaris.cpp
1000RuntimeR3_SOURCES.solaris.amd64 = \
1001 r3/solaris/coredumper-solaris.cpp \
1002 r3/solaris/RTSystemQueryDmiString-solaris.cpp
1003RuntimeR3_SOURCES.solaris.x86 = \
1004 r3/solaris/coredumper-solaris.cpp \
1005 r3/solaris/RTSystemQueryDmiString-solaris.cpp
1006RuntimeR3_SOURCES.solaris.sparc32 = \
1007 generic/RTSystemQueryDmiString-generic.cpp
1008RuntimeR3_SOURCES.solaris.sparc64 = \
1009 generic/RTSystemQueryDmiString-generic.cpp
1010
1011RuntimeR3_SOURCES.haiku = \
1012 generic/RTDirQueryInfo-generic.cpp \
1013 generic/RTDirSetTimes-generic.cpp \
1014 generic/RTFileMove-generic.cpp \
1015 generic/RTLogWriteDebugger-generic.cpp \
1016 generic/RTProcDaemonize-generic.cpp \
1017 generic/RTTimeLocalNow-generic.cpp \
1018 generic/RTTimerCreate-generic.cpp \
1019 generic/RTUuidCreate-generic.cpp \
1020 generic/mppresent-generic.cpp \
1021 generic/RTSemEventMultiWait-2-ex-generic.cpp \
1022 generic/RTSemEventMultiWaitNoResume-2-ex-generic.cpp \
1023 generic/sched-generic.cpp \
1024 generic/semrw-$(if-expr defined(VBOX_WITH_LOCKLESS_SEMRW),ockless-,)generic.cpp \
1025 generic/timer-generic.cpp \
1026 generic/utf16locale-generic.cpp \
1027 generic/uuid-generic.cpp\
1028 generic/RTProcIsRunningByName-generic.cpp \
1029 generic/RTThreadGetNativeState-generic.cpp \
1030 generic/RTMpGetCoreCount-generic.cpp \
1031 generic/RTMpGetOnlineCoreCount-generic.cpp \
1032 r3/haiku/rtProcInitExePath-haiku.cpp \
1033 r3/haiku/time-haiku.cpp \
1034 r3/generic/allocex-r3-generic.cpp \
1035 r3/posix/RTFileQueryFsSizes-posix.cpp \
1036 r3/posix/RTHandleGetStandard-posix.cpp \
1037 r3/posix/RTMemProtect-posix.cpp \
1038 r3/posix/RTPathUserHome-posix.cpp \
1039 r3/posix/RTSystemQueryOSInfo-posix.cpp \
1040 r3/posix/RTSystemQueryTotalRam-posix.cpp \
1041 r3/posix/RTTimeNow-posix.cpp \
1042 r3/posix/dir-posix.cpp \
1043 r3/posix/env-posix.cpp \
1044 r3/posix/errvars-posix.cpp \
1045 r3/posix/fileio-posix.cpp \
1046 r3/posix/fileio2-posix.cpp \
1047 r3/posix/filelock-posix.cpp \
1048 r3/posix/fs-posix.cpp \
1049 r3/posix/fs2-posix.cpp \
1050 r3/posix/fs3-posix.cpp \
1051 r3/posix/ldrNative-posix.cpp \
1052 r3/posix/rtmempage-exec-mmap-heap-posix.cpp \
1053 r3/posix/path-posix.cpp \
1054 r3/posix/path2-posix.cpp \
1055 r3/posix/pathhost-posix.cpp \
1056 r3/posix/pipe-posix.cpp \
1057 r3/posix/process-posix.cpp \
1058 r3/posix/process-creation-posix.cpp \
1059 r3/posix/rand-posix.cpp \
1060 r3/posix/semevent-posix.cpp \
1061 r3/posix/semeventmulti-posix.cpp \
1062 r3/posix/semmutex-posix.cpp \
1063 r3/posix/symlink-posix.cpp \
1064 r3/posix/thread-posix.cpp \
1065 r3/posix/thread2-posix.cpp \
1066 r3/posix/timelocal-posix.cpp \
1067 r3/posix/tls-posix.cpp \
1068 r3/posix/utf8-posix.cpp
1069
1070## PORTME: Porters add their selection of platform specific files for Ring-3 here.
1071
1072
1073#
1074# RuntimeBldProg - Static Runtime for build programs.
1075#
1076# Note! This is a bit of hacky since kBuild doesn't support building libraries
1077# for build programs.
1078#
1079RuntimeBldProg_TEMPLATE := VBoxAdvBldProg
1080RuntimeBldProg_EXTENDS := RuntimeR3
1081RuntimeBldProg_BLD_TRG := $(KBUILD_HOST)
1082RuntimeBldProg_BLD_TRG_ARCH := $(KBUILD_HOST_ARCH)
1083RuntimeBldProg_BLD_TRG_CPU := $(KBUILD_HOST_CPU)
1084RuntimeBldProg_SOURCES = $(filter-out \
1085 r3/xml.cpp \
1086 common/zip/xarvfs.cpp \
1087 , $(RuntimeR3_SOURCES))
1088
1089
1090
1091#
1092# RuntimeGuestR3 - Guest Additions Runtime (static/exe).
1093# (The KBUILD_HOST inheritance here is for cross building the linux
1094# additions, while .x86 is for cross building x86 while targeting amd64.)
1095#
1096RuntimeGuestR3_TEMPLATE := VBoxGuestR3Lib
1097## @todo change this to EXTEND the RuntimeR3 target.
1098RuntimeGuestR3_SDKS.win := $(RuntimeR3_SDKS.win)
1099RuntimeGuestR3_DEFS := $(filter-out RTCRITSECT_STRICT RT_NO_GIP, $(RuntimeR3_DEFS))
1100RuntimeGuestR3_DEFS.$(KBUILD_TARGET) := $(RuntimeR3_DEFS.$(KBUILD_TARGET))
1101RuntimeGuestR3_DEFS.$(KBUILD_HOST) := $(RuntimeR3_DEFS.$(KBUILD_HOST))
1102RuntimeGuestR3_INCS := $(RuntimeR3_INCS)
1103RuntimeGuestR3_INCS.$(KBUILD_TARGET) := $(RuntimeR3_INCS.$(KBUILD_TARGET))
1104RuntimeGuestR3_INCS.$(KBUILD_HOST) := $(RuntimeR3_INCS.$(KBUILD_HOST))
1105RuntimeGuestR3_SOURCES := $(filter-out \
1106 common/time/timesupref.cpp \
1107 common/time/timesupA.asm \
1108 common/time/timesup.cpp \
1109 common/checksum/RTSha1Digest.cpp \
1110 common/checksum/RTSha256Digest.cpp \
1111 common/checksum/sha% \
1112 generic/RTLogWriteUser-generic.cpp \
1113 r3/xml.cpp \
1114 common/zip/xarvfs.cpp \
1115 , $(RuntimeR3_SOURCES))
1116RuntimeGuestR3_SOURCES += \
1117 common/time/timesysalias.cpp \
1118 VBox/logbackdoor.cpp
1119RuntimeGuestR3_SOURCES.$(KBUILD_TARGET) := $(RuntimeR3_SOURCES.$(KBUILD_TARGET))
1120RuntimeGuestR3_SOURCES.$(KBUILD_HOST) := $(RuntimeR3_SOURCES.$(KBUILD_HOST))
1121RuntimeGuestR3_SOURCES.$(KBUILD_TARGET_ARCH) := $(RuntimeR3_SOURCES.$(KBUILD_TARGET_ARCH))
1122RuntimeGuestR3_SOURCES.x86 := $(RuntimeR3_SOURCES.x86)
1123RuntimeGuestR3_SOURCES.amd64 := $(RuntimeR3_SOURCES.amd64)
1124RuntimeGuestR3_SOURCES.$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH) := $(RuntimeR3_SOURCES.$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH))
1125RuntimeGuestR3_SOURCES.$(KBUILD_TARGET).x86 := $(RuntimeR3_SOURCES.$(KBUILD_TARGET).x86)
1126RuntimeGuestR3_SOURCES.$(KBUILD_TARGET).amd64:= $(RuntimeR3_SOURCES.$(KBUILD_TARGET).amd64)
1127RuntimeGuestR3_SOURCES.$(KBUILD_HOST).$(KBUILD_TARGET_ARCH) := $(RuntimeR3_SOURCES.$(KBUILD_HOST).$(KBUILD_TARGET_ARCH))
1128RuntimeGuestR3_SOURCES.win.x86 += \
1129 r3/win/vcc100-kernel32-fakes.cpp \
1130 r3/win/vcc100-kernel32-fakesA.asm
1131
1132#
1133# RuntimeGuestR3-x86 - Same as RuntimeGuestR3, except that it's targeting x86.
1134#
1135RuntimeGuestR3-x86_EXTENDS := RuntimeGuestR3
1136RuntimeGuestR3-x86_BLD_TRG_ARCH := x86
1137
1138
1139#
1140# RuntimeGuestR3Shared - Guest Additions Runtime (static/dll).
1141#
1142RuntimeGuestR3Shared_TEMPLATE := VBoxGuestR3Dll
1143RuntimeGuestR3Shared_EXTENDS := RuntimeGuestR3
1144RuntimeGuestR3Shared_INST = $(INST_ADDITIONS_LIB)
1145
1146
1147#
1148# RuntimeGuestR3Shared-x86 - Same as RuntimeGuestR3Shared, except that it's targeting x86.
1149#
1150RuntimeGuestR3Shared-x86_EXTENDS := RuntimeGuestR3Shared
1151RuntimeGuestR3Shared-x86_BLD_TRG_ARCH := x86
1152
1153
1154#
1155# RuntimeGuestR3Mini - Minimal Guest Additions Runtime which does not require
1156# initialization and can be linked into an .so. Intended
1157# for X11 drivers, GRADD and similar.
1158#
1159RuntimeGuestR3Mini_TEMPLATE := VBoxGuestR3Dll
1160## @todo change this to EXTEND the RuntimeGuestR3 target.
1161RuntimeGuestR3Mini_INST := $(INST_ADDITIONS_LIB)
1162RuntimeGuestR3Mini_SDKS.win := $(RuntimeR3_SDKS.win)
1163RuntimeGuestR3Mini_DEFS := \
1164 $(filter-out RTCRITSECT_STRICT RT_NO_GIP RT_WITH_ICONV_CACHE, $(RuntimeR3_DEFS)) \
1165 RT_MINI IN_RT_STATIC RTMEM_NO_WRAP_TO_EF_APIS
1166RuntimeGuestR3Mini_DEFS.$(KBUILD_TARGET) := $(RuntimeR3_DEFS.$(KBUILD_TARGET))
1167RuntimeGuestR3Mini_DEFS.$(KBUILD_HOST) := $(RuntimeR3_DEFS.$(KBUILD_HOST))
1168RuntimeGuestR3Mini_INCS := $(RuntimeR3_INCS)
1169RuntimeGuestR3Mini_INCS.$(KBUILD_TARGET) := $(RuntimeR3_INCS.$(KBUILD_TARGET))
1170RuntimeGuestR3Mini_INCS.$(KBUILD_HOST) := $(RuntimeR3_INCS.$(KBUILD_HOST))
1171RuntimeGuestR3Mini_SOURCES = \
1172 common/alloc/alloc.cpp \
1173 common/err/errmsg.cpp \
1174 common/err/RTErrConvertFromErrno.cpp \
1175 common/log/logformat.cpp \
1176 common/misc/RTAssertMsg1Weak.cpp \
1177 common/misc/RTAssertMsg2.cpp \
1178 common/misc/RTAssertMsg2Add.cpp \
1179 common/misc/RTAssertMsg2AddWeak.cpp \
1180 common/misc/RTAssertMsg2AddWeakV.cpp \
1181 common/misc/RTAssertMsg2Weak.cpp \
1182 common/misc/RTAssertMsg2WeakV.cpp \
1183 common/misc/assert.cpp \
1184 common/misc/buildconfig.cpp \
1185 common/misc/sanity-c.c \
1186 common/misc/sanity-cpp.cpp \
1187 common/misc/sg.cpp \
1188 common/path/rtPathVolumeSpecLen.cpp \
1189 common/path/RTPathAbsDup.cpp \
1190 common/path/RTPathAbsEx.cpp \
1191 common/path/RTPathAbsExDup.cpp \
1192 common/path/RTPathAppend.cpp \
1193 common/path/RTPathAppendEx.cpp \
1194 common/path/RTPathExt.cpp \
1195 common/path/RTPathFilename.cpp \
1196 common/path/RTPathHasExt.cpp \
1197 common/path/RTPathHasPath.cpp \
1198 common/path/RTPathJoin.cpp \
1199 common/path/RTPathJoinA.cpp \
1200 common/path/RTPathParseSimple.cpp \
1201 common/path/RTPathRealDup.cpp \
1202 common/path/RTPathStripExt.cpp \
1203 common/path/RTPathStripFilename.cpp \
1204 common/path/RTPathStripTrailingSlash.cpp \
1205 common/string/RTStrCat.cpp \
1206 common/string/RTStrCatEx.cpp \
1207 common/string/RTStrCatP.cpp \
1208 common/string/RTStrCatPEx.cpp \
1209 common/string/RTStrCmp.cpp \
1210 common/string/RTStrCopy.cpp \
1211 common/string/RTStrCopyEx.cpp \
1212 common/string/RTStrCopyP.cpp \
1213 common/string/RTStrCopyPEx.cpp \
1214 common/string/RTStrNCmp.cpp \
1215 common/string/RTStrNLen.cpp \
1216 common/string/RTStrNLenEx.cpp \
1217 common/string/RTStrStr.cpp \
1218 common/string/straprintf.cpp \
1219 common/string/strformat.cpp \
1220 common/string/strformatnum.cpp \
1221 common/string/strformatrt.cpp \
1222 common/string/strformattype.cpp \
1223 common/string/stringalloc.cpp \
1224 common/string/strprintf.cpp \
1225 common/string/strtonum.cpp \
1226 common/string/unidata.cpp \
1227 common/string/utf-8.cpp \
1228 common/string/utf-8-case.cpp \
1229 common/string/utf-16.cpp \
1230 common/table/avlpv.cpp \
1231 generic/critsect-generic.cpp \
1232 generic/pathhost-generic.cpp \
1233 generic/RTAssertShouldPanic-generic.cpp \
1234 generic/errvars-generic.cpp \
1235 r3/alloc.cpp \
1236 r3/alloc-ef.cpp \
1237 r3/fileio.cpp \
1238 r3/fs.cpp
1239RuntimeGuestR3Mini_SOURCES.freebsd = \
1240 r3/posix/RTMemProtect-posix.cpp \
1241 r3/posix/rtmempage-exec-mmap-posix.cpp \
1242 r3/posix/RTPathUserHome-posix.cpp \
1243 r3/posix/env-posix.cpp \
1244 r3/posix/fileio-posix.cpp \
1245 r3/posix/fileio2-posix.cpp \
1246 r3/posix/path-posix.cpp \
1247 r3/posix/path2-posix.cpp \
1248 r3/posix/utf8-posix.cpp \
1249 r3/posix/thread2-posix.cpp \
1250 common/err/errmsgxpcom.cpp
1251RuntimeGuestR3Mini_SOURCES.linux = \
1252 r3/posix/RTMemProtect-posix.cpp \
1253 r3/posix/rtmempage-exec-mmap-posix.cpp \
1254 r3/posix/RTPathUserHome-posix.cpp \
1255 r3/posix/env-posix.cpp \
1256 r3/posix/fileio-posix.cpp \
1257 r3/posix/fileio2-posix.cpp \
1258 r3/posix/path-posix.cpp \
1259 r3/posix/path2-posix.cpp \
1260 r3/posix/utf8-posix.cpp \
1261 r3/posix/thread2-posix.cpp \
1262 common/err/errmsgxpcom.cpp
1263RuntimeGuestR3Mini_SOURCES.solaris = \
1264 r3/posix/RTMemProtect-posix.cpp \
1265 r3/posix/rtmempage-exec-mmap-posix.cpp \
1266 r3/posix/RTPathUserHome-posix.cpp \
1267 r3/posix/env-posix.cpp \
1268 r3/posix/fileio-posix.cpp \
1269 r3/posix/fileio2-posix.cpp \
1270 r3/posix/path-posix.cpp \
1271 r3/posix/path2-posix.cpp \
1272 r3/posix/utf8-posix.cpp \
1273 r3/posix/thread2-posix.cpp \
1274 common/err/errmsgxpcom.cpp
1275RuntimeGuestR3Mini_SOURCES.win = \
1276 r3/win/alloc-win.cpp \
1277 r3/win/fileio-win.cpp \
1278 r3/win/path-win.cpp \
1279 r3/win/utf8-win.cpp \
1280 r3/win/thread2-win.cpp \
1281 win/errmsgwin.cpp \
1282 win/RTErrConvertFromWin32.cpp
1283
1284#
1285# RuntimeGuestR3Mini-x86 - Same as RuntimeGuestR3Mini, except that it's targeting x86.
1286#
1287RuntimeGuestR3Mini-x86_EXTENDS := RuntimeGuestR3Mini
1288RuntimeGuestR3Mini-x86_BLD_TRG_ARCH := x86
1289
1290
1291# VBox specific stuff.
1292RuntimeGuestR3Mini_SOURCES += \
1293 VBox/logbackdoor.cpp \
1294 VBox/logbackdoor-redirect.cpp
1295
1296
1297#
1298# VBoxRT - Shared Object / DLL version.
1299#
1300VBoxRT_TEMPLATE = VBoxR3DllNoPic
1301VBoxRT_SDKS = VBOX_LIBXML2
1302ifdef VBOX_WITH_LIBCURL
1303 VBoxRT_SDKS += VBOX_LIBCURL
1304endif
1305VBoxRT_SDKS += VBOX_OPENSSL
1306VBoxRT_SDKS.win = $(VBOX_WINPSDK) $(VBOX_WINDDK) VBOX_NTDLL
1307if1of ($(KBUILD_TARGET)$(VBOX_WITH_HARDENING), darwin win)
1308VBoxRT_INST = $(INST_DLL) $(INST_TESTCASE)
1309endif
1310VBoxRT_DEFS := $(filter-out RT_NO_GIP,$(RuntimeR3_DEFS)) IN_SUP_R3 IN_SUP_R3 IPRT_WITH_XAR
1311ifn1of ($(KBUILD_TARGET_ARCH), amd64 x86)
1312 VBoxRT_DEFS += RT_NO_GIP
1313endif
1314ifdef VBOX_WITH_LIBCURL
1315 VBoxRT_DEFS += IPRT_WITH_HTTP
1316endif
1317VBoxRT_DEFS.$(KBUILD_TYPE) := $(RuntimeR3_DEFS.$(KBUILD_TYPE))
1318VBoxRT_SOURCES := \
1319 VBox/VBoxRTDeps.cpp \
1320 $(filter-out common/checksum/crc32.cpp, $(RuntimeR3_SOURCES)) \
1321 common/checksum/crc32-zlib.cpp \
1322 common/misc/aiomgr.cpp
1323ifdef VBOX_WITH_LIBCURL
1324 VBoxRT_SOURCES += common/misc/s3.cpp
1325 VBoxRT_SOURCES += common/misc/http.cpp
1326endif
1327VBoxRT_SOURCES.$(KBUILD_TARGET) = $(RuntimeR3_SOURCES.$(KBUILD_TARGET))
1328VBoxRT_SOURCES.$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH) := $(RuntimeR3_SOURCES.$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH))
1329VBoxRT_SOURCES.$(KBUILD_TARGET).x86 := $(RuntimeR3_SOURCES.$(KBUILD_TARGET).x86)
1330VBoxRT_SOURCES.$(KBUILD_TARGET).amd64 := $(RuntimeR3_SOURCES.$(KBUILD_TARGET).amd64)
1331VBoxRT_SOURCES.$(KBUILD_TARGET_ARCH) := $(RuntimeR3_SOURCES.$(KBUILD_TARGET_ARCH))
1332VBoxRT_SOURCES.x86 := $(RuntimeR3_SOURCES.x86)
1333VBoxRT_SOURCES.amd64 := $(RuntimeR3_SOURCES.amd64)
1334VBoxRT_SOURCES.win += \
1335 r3/win/dllmain-win.cpp \
1336 r3/win/fileaio-win.cpp \
1337 $(VBoxRT_0_OUTDIR)/VBoxRT.def
1338VBoxRT_SOURCES.linux += \
1339 r3/linux/fileaio-linux.cpp
1340VBoxRT_SOURCES.solaris += \
1341 r3/solaris/fileaio-solaris.cpp
1342VBoxRT_SOURCES.darwin += \
1343 r3/posix/fileaio-posix.cpp
1344VBoxRT_SOURCES.freebsd += \
1345 r3/freebsd/fileaio-freebsd.cpp
1346VBoxRT_INCS := $(RuntimeR3_INCS)
1347VBoxRT_INCS.$(KBUILD_TARGET) := $(RuntimeR3_INCS.$(KBUILD_TARGET))
1348VBoxRT_INCS.$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH) := $(RuntimeR3_INCS.$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH))
1349VBoxRT_LIBS = \
1350 $(PATH_STAGE_LIB)/VBox-liblzf$(VBOX_SUFF_LIB)
1351if1of ($(KBUILD_TARGET_ARCH), amd64 x86)
1352VBoxRT_LIBS += \
1353 $(PATH_STAGE_LIB)/SUPR3$(VBOX_SUFF_LIB)
1354endif
1355ifdef IPRT_WITH_KSTUFF
1356 VBoxRT_LIBS += \
1357 $(PATH_STAGE_LIB)/VBox-kStuff$(VBOX_SUFF_LIB)
1358endif
1359ifndef SDK_VBOX_LIBXML2_LIBS
1360 VBoxRT_LIBS += \
1361 $(PATH_STAGE_LIB)/VBox-libxml2$(VBOX_SUFF_LIB)
1362endif
1363VBoxRT_LIBS += \
1364 $(SDK_VBOX_ZLIB_LIBS)
1365ifndef SDK_VBOX_OPENSSL_LIBS
1366 VBoxRT_LIBS += \
1367 $(PATH_STAGE_LIB)/VBox-libcrypto$(VBOX_SUFF_LIB) \
1368 $(PATH_STAGE_LIB)/VBox-libssl$(VBOX_SUFF_LIB)
1369endif
1370ifdef IPRT_WITH_LZO
1371 VBoxRT_LIBS += lzo2
1372endif
1373VBoxRT_LIBS.linux = \
1374 crypt
1375VBoxRT_LIBS.darwin = \
1376 iconv
1377VBoxRT_LIBS.freebsd = \
1378 iconv \
1379 rt
1380VBoxRT_LIBS.haiku = \
1381 iconv
1382VBoxRT_LIBS.solaris = \
1383 kstat \
1384 contract
1385ifn1of ($(KBUILD_TARGET_ARCH), sparc32 sparc64)
1386 # SMBIOS not available on Solaris SPARC.
1387 VBoxRT_LIBS.solaris += smbios
1388endif
1389VBoxRT_LIBS.win = \
1390 $(PATH_SDK_$(VBOX_WINDDK)_LIB)/vccomsup.lib \
1391 $(PATH_SDK_$(VBOX_WINDDK)_LIB)/wbemuuid.lib
1392VBoxRT_LDFLAGS.darwin = -framework IOKit -framework CoreFoundation -framework CoreServices -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/VBoxRT.dylib
1393VBoxRT_LDFLAGS.win = /MANIFEST
1394
1395if1of ($(DLLS), VBoxRT)
1396$$(VBoxRT_0_OUTDIR)/VBoxRT.def: \
1397 $(PATH_SUB_CURRENT)/r3/win/VBoxRT-$$(if-expr $$(KBUILD_TARGET_ARCH) == amd64,win64,win32).def \
1398 $(PATH_SUB_CURRENT)/r3/win/$(if $(VBOX_OSE),VBoxRT-openssl-ose.def,VBoxRT-openssl.def)
1399 $(RM) -f -- $@
1400 $(REDIRECT) -wto $@ -- $(CAT_EXT) $^
1401endif
1402
1403
1404#
1405# HACK ALERT! Make testcase run during build on SELinux boxes.
1406# Create a dummy DLL that ensure that VBoxRT is installed
1407# during the DLL pass and cleaned up later.
1408#
1409ifeq ($(KBUILD_TARGET),linux)
1410 if1of (VBoxRT, $(DLLS))
1411 ifneq ($(wildcard /usr/bin/chcon),)
1412VBoxRT_INSTTYPE = none
1413VBoxRT_DEBUG_INSTTYPE = both
1414
1415DLLS += VBoxRTDummy
1416VBoxRTDummy_TEMPLATE = VBoxR3Dll
1417VBoxRTDummy_INSTTYPE = none
1418VBoxRTDummy_LIBS = $(PATH_STAGE_BIN)/VBoxRT.so
1419VBoxRTDummy_CLEAN = $(PATH_STAGE_BIN)/VBoxRT.so
1420BLDDIRS += $(PATH_STAGE_BIN)
1421
1422$(PATH_STAGE_BIN)/VBoxRT.so: $$(VBoxRT_1_TARGET) | $$(dir $$@)
1423 $(INSTALL) $< $@
1424 chcon -t texrel_shlib_t $@ || true
1425
1426VBoxRT:: VBoxRTDummy
1427 endif # chcon present.
1428 endif # building VBoxRT
1429endif # linux
1430
1431
1432#
1433# VBoxRT-x86 - 32-bit version of VBoxRT
1434#
1435VBoxRT-x86_EXTENDS = VBoxRT
1436VBoxRT-x86_TEMPLATE = VBoxR3Dll-x86
1437VBoxRT-x86_INST.win = $(INST_DLL)x86/
1438VBoxRT-x86_SDKS = VBOX_LIBXML2
1439ifdef VBOX_WITH_LIBCURL
1440 VBoxRT-x86_SDKS += VBOX_LIBCURL-x86
1441endif
1442VBoxRT-x86_SDKS += VBOX_OPENSSL-x86
1443
1444VBoxRT-x86_LIBS = \
1445 $(PATH_STAGE_LIB)/VBox-liblzf-x86$(VBOX_SUFF_LIB)
1446if1of ($(KBUILD_TARGET_ARCH), amd64 x86)
1447VBoxRT-x86_LIBS += \
1448 $(PATH_STAGE_LIB)/SUPR3-x86$(VBOX_SUFF_LIB)
1449endif
1450ifdef IPRT_WITH_KSTUFF
1451 VBoxRT-x86_LIBS += \
1452 $(PATH_STAGE_LIB)/VBox-kStuff-x86$(VBOX_SUFF_LIB)
1453endif
1454ifndef SDK_VBOX_LIBXML2_LIBS
1455 VBoxRT-x86_LIBS += \
1456 $(PATH_STAGE_LIB)/VBox-libxml2-x86$(VBOX_SUFF_LIB)
1457endif
1458VBoxRT-x86_LIBS += \
1459 $(SDK_VBOX_ZLIB_LIBS-x86)
1460ifndef SDK_VBOX_OPENSSL_LIBS
1461 VBoxRT-x86_LIBS += \
1462 $(PATH_STAGE_LIB)/VBox-libcrypto-x86$(VBOX_SUFF_LIB) \
1463 $(PATH_STAGE_LIB)/VBox-libssl-x86$(VBOX_SUFF_LIB)
1464endif
1465ifdef IPRT_WITH_LZO
1466 VBoxRT-x86_LIBS += lzo2
1467endif
1468VBoxRT-x86_LIBS.linux = \
1469 crypt
1470VBoxRT-x86_LIBS.darwin = \
1471 iconv
1472VBoxRT-x86_LIBS.freebsd = \
1473 iconv \
1474 rt
1475VBoxRT-x86_LIBS.haiku = \
1476 iconv
1477VBoxRT-x86_LIBS.solaris = \
1478 kstat \
1479 contract
1480ifn1of ($(KBUILD_TARGET_ARCH), sparc32 sparc64)
1481 # SMBIOS not available on Solaris SPARC.
1482 VBoxRT-x86_LIBS.solaris += smbios
1483endif
1484VBoxRT-x86_LIBS.win = \
1485 $(PATH_SDK_$(VBOX_WINDDK)_LIB.x86)/vccomsup.lib \
1486 $(PATH_SDK_$(VBOX_WINDDK)_LIB.x86)/wbemuuid.lib
1487
1488VBoxRT-x86_SOURCES.win = $(filter-out %.def,$(VBoxRT_SOURCES.win)) \
1489 $(VBoxRT-x86_0_OUTDIR)/VBoxRT-x86.def
1490if1of ($(DLLS), VBoxRT-x86)
1491$$(VBoxRT-x86_0_OUTDIR)/VBoxRT-x86.def: \
1492 $(PATH_SUB_CURRENT)/r3/win/VBoxRT-win32.def \
1493 $(PATH_SUB_CURRENT)/r3/win/$(if $(VBOX_OSE),VBoxRT-openssl-ose.def,VBoxRT-openssl.def)
1494 $(RM) -f -- $@
1495 $(REDIRECT) -wto $@ -- $(CAT_EXT) $^
1496endif
1497
1498#
1499# VBoxRTImp - Import library/hack.
1500#
1501ifeq ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH),win.amd64)
1502$(call VBOX_GENERATE_IMPORT_TARGET_FN,VBoxRTImp,VBoxRT,VBox/VBoxRTImp.def r3/win/VBoxRT-openssl-ose.def r3/win/VBoxRT-win64.def)
1503else ifeq ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH),win.x86)
1504$(call VBOX_GENERATE_IMPORT_TARGET_FN,VBoxRTImp,VBoxRT,VBox/VBoxRTImp.def r3/win/VBoxRT-openssl-ose.def r3/win/VBoxRT-win32.def)
1505else
1506$(call VBOX_GENERATE_IMPORT_TARGET_FN,VBoxRTImp,VBoxRT,VBox/VBoxRTImp.def r3/win/VBoxRT-openssl-ose.def)
1507endif
1508
1509
1510#
1511# RuntimeR3NoCRTGCC - CRT replacement lib for VBoxREM.
1512# This is used together with VBoxRT.
1513#
1514## @todo the *_alias.c stuff is busted, remove and use RT_WITH_NOCRT_ALIASES instead.
1515RuntimeR3NoCRTGCC_TEMPLATE = VBoxNoCrtGccLib
1516RuntimeR3NoCRTGCC_LIBSUFF = $(VBOX_SUFF_LIB)
1517ifn1of ($(KBUILD_TARGET_ARCH), amd64 x86)
1518 RuntimeR3NoCRTGCC_DEFS += RT_NO_GIP
1519endif
1520RuntimeR3NoCRTGCC_INCS = include
1521RuntimeR3NoCRTGCC_SOURCES := \
1522 common/misc/sanity-cpp.cpp \
1523 common/misc/sanity-c.c \
1524 \
1525 $(RuntimeNoCrt_SOURCES)
1526
1527if1of ($(KBUILD_TARGET_ARCH), amd64 x86)
1528RuntimeR3NoCRTGCC_SOURCES += \
1529 common/math/ceill.asm \
1530 common/math/cosl.asm \
1531 common/math/fabs.asm \
1532 common/math/fabsf.asm \
1533 common/math/fabsl.asm \
1534 common/math/floor.asm \
1535 common/math/floorf.asm \
1536 common/math/floorl.asm \
1537 common/math/ldexpl.asm \
1538 common/math/llrint.asm \
1539 common/math/llrintf.asm \
1540 common/math/llrintl.asm \
1541 common/math/logl.asm \
1542 common/math/lrint.asm \
1543 common/math/lrintf.asm \
1544 common/math/lrintl.asm \
1545 common/math/remainder.asm \
1546 common/math/remainderf.asm \
1547 common/math/remainderl.asm \
1548 common/math/sinl.asm \
1549 common/math/tanl.asm \
1550 common/math/trunc.asm \
1551 common/math/truncf.asm \
1552 common/math/truncl.asm \
1553 \
1554 common/string/memchr_alias.c \
1555 common/string/memcmp_alias.c \
1556 common/string/memcpy_alias.c \
1557 common/string/memmove_alias.c \
1558 common/string/memset_alias.c \
1559 common/string/strchr_alias.c \
1560 common/string/strcmp_alias.c \
1561 common/string/strlen_alias.c
1562endif
1563
1564RuntimeR3NoCRTGCC_SOURCES.x86 = \
1565 common/math/x86/fenv-x86.c \
1566 common/math/gcc/adddi3.c \
1567 common/math/gcc/anddi3.c \
1568 common/math/gcc/ashldi3.c \
1569 common/math/gcc/ashrdi3.c \
1570 common/math/gcc/cmpdi2.c \
1571 common/math/gcc/divdi3.c \
1572 common/math/gcc/iordi3.c \
1573 common/math/gcc/lshldi3.c \
1574 common/math/gcc/lshrdi3.c \
1575 common/math/gcc/moddi3.c \
1576 common/math/gcc/muldi3.c \
1577 common/math/gcc/negdi2.c \
1578 common/math/gcc/notdi2.c \
1579 common/math/gcc/qdivrem.c \
1580 common/math/gcc/subdi3.c \
1581 common/math/gcc/ucmpdi2.c \
1582 common/math/gcc/udivdi3.c \
1583 common/math/gcc/umoddi3.c \
1584 common/math/gcc/xordi3.c
1585
1586
1587#
1588# RuntimeR0 - Ring-0 library for VMMR0.
1589#
1590RuntimeR0_TEMPLATE = VBoxR0
1591RuntimeR0_DEFS = IN_RT_R0 RT_WITH_VBOX
1592ifn1of ($(KBUILD_TARGET_ARCH), amd64 x86)
1593 RuntimeR0_DEFS += RT_NO_GIP
1594endif
1595RuntimeR0_INCS = include
1596RuntimeR0_SOURCES := \
1597 common/log/logellipsis.cpp \
1598 common/log/logrelellipsis.cpp \
1599 common/log/logcom.cpp \
1600 common/log/logformat.cpp \
1601 common/log/tracebuf.cpp \
1602 common/log/tracedefault.cpp \
1603 common/misc/RTAssertMsg1Weak.cpp \
1604 common/misc/RTAssertMsg2.cpp \
1605 common/misc/RTAssertMsg2Add.cpp \
1606 common/misc/RTAssertMsg2AddWeak.cpp \
1607 common/misc/RTAssertMsg2AddWeakV.cpp \
1608 common/misc/RTAssertMsg2Weak.cpp \
1609 common/misc/RTAssertMsg2WeakV.cpp \
1610 common/misc/buildconfig.cpp \
1611 common/misc/once.cpp \
1612 common/misc/sanity-c.c \
1613 common/misc/sanity-cpp.cpp \
1614 common/misc/term.cpp \
1615 common/path/RTPathFilename.cpp \
1616 common/string/strhash1.cpp \
1617 common/string/strncmp.cpp \
1618 common/string/strpbrk.cpp \
1619 common/string/RTStrCat.cpp \
1620 common/string/RTStrCatEx.cpp \
1621 common/string/RTStrCatP.cpp \
1622 common/string/RTStrCatPEx.cpp \
1623 common/string/RTStrCopy.cpp \
1624 common/string/RTStrCopyEx.cpp \
1625 common/string/RTStrCopyP.cpp \
1626 common/string/RTStrCopyPEx.cpp \
1627 common/string/RTStrNLen.cpp \
1628 common/string/RTStrNLenEx.cpp \
1629 common/table/avlgcptr.cpp \
1630 common/table/avlhcphys.cpp \
1631 common/table/avllu32.cpp \
1632 common/table/avlogcphys.cpp \
1633 common/table/avlogcptr.cpp \
1634 common/table/avlohcphys.cpp \
1635 common/table/avloioport.cpp \
1636 common/table/avlpv.cpp \
1637 common/table/avlrogcphys.cpp \
1638 common/table/avlrogcptr.cpp \
1639 common/table/avlroioport.cpp \
1640 common/table/avlroogcptr.cpp \
1641 common/table/avlu32.cpp \
1642 common/table/avlou32.cpp \
1643 common/time/timesup.cpp \
1644 generic/RTAssertShouldPanic-generic.cpp \
1645 \
1646 $(RuntimeNoCrt_SOURCES)
1647
1648if1of ($(KBUILD_TARGET), darwin solaris freebsd)
1649RuntimeR0_SOURCES += \
1650 common/math/gcc/adddi3.c \
1651 common/math/gcc/anddi3.c \
1652 common/math/gcc/ashldi3.c \
1653 common/math/gcc/ashrdi3.c \
1654 common/math/gcc/cmpdi2.c \
1655 common/math/gcc/divdi3.c \
1656 common/math/gcc/iordi3.c \
1657 common/math/gcc/lshldi3.c \
1658 common/math/gcc/lshrdi3.c \
1659 common/math/gcc/moddi3.c \
1660 common/math/gcc/muldi3.c \
1661 common/math/gcc/negdi2.c \
1662 common/math/gcc/notdi2.c \
1663 common/math/gcc/qdivrem.c \
1664 common/math/gcc/subdi3.c \
1665 common/math/gcc/ucmpdi2.c \
1666 common/math/gcc/udivdi3.c \
1667 common/math/gcc/umoddi3.c \
1668 common/math/gcc/xordi3.c
1669endif
1670
1671#if1of ($(KBUILD_TARGET_ARCH),amd64 x86)
1672# RuntimeR0_SOURCES += common/time/timesupA.asm
1673#else
1674 RuntimeR0_SOURCES += common/time/timesupref.cpp
1675#endif
1676
1677RuntimeR0_SOURCES.win.amd64 := $(RuntimeWin64ASM_SOURCES)
1678RuntimeR0_SOURCES.win.x86 := $(RuntimeWin32ASM_SOURCES)
1679RuntimeR0_SOURCES.win = \
1680 nt/NtProcessStartup-stub.cpp
1681
1682RuntimeR0_SOURCES.os2 = \
1683 os2/sys0.asm
1684
1685
1686#
1687# RuntimeR0Stub - Ring-0 context startup stub for Windows and Solaris.
1688#
1689RuntimeR0Stub_TEMPLATE = $(if-expr "$(KBUILD_TARGET)" == "solaris",VBoxR0DrvLib,VBoxR0)
1690RuntimeR0Stub_SOURCES.win = \
1691 nt/NtProcessStartup-stub.cpp
1692RuntimeR0Stub_SOURCES.solaris = \
1693 r0drv/solaris/modulestub-r0drv-solaris.c
1694
1695
1696#
1697# RuntimeR0Drv - Ring-0 library for host drivers.
1698#
1699RuntimeR0Drv_TEMPLATE = VBoxR0DrvLib
1700RuntimeR0Drv_SDKS.win = ReorderCompilerIncs $(VBOX_WINDDK) $(VBOX_WINPSDK)INCS
1701RuntimeR0Drv_DEFS = IN_RT_R0 RT_WITH_VBOX RT_WITHOUT_NOCRT_WRAPPERS RT_NO_EXPORT_SYMBOL
1702RuntimeR0Drv_DEFS.win = IN_SUP_R0
1703RuntimeR0Drv_DEFS.linux = MODULE KBUILD_MODNAME=KBUILD_STR\(vboxdrv\) KBUILD_BASENAME=KBUILD_STR\(vboxdrv\) IN_SUP_R0
1704
1705RuntimeR0Drv_INCS := $(PATH_SUB_CURRENT) include
1706RuntimeR0Drv_INCS.freebsd = \
1707 $(PATH_STAGE)/gen-sys-hdrs
1708RuntimeR0Drv_INCS.linux = \
1709 r0drv/linux
1710RuntimeR0Drv_INCS.solaris = \
1711 r0drv/solaris/vbi/i86pc \
1712 r0drv/solaris/vbi/i86pc/sys
1713
1714RuntimeR0Drv_SOURCES = \
1715 common/alloc/alloc.cpp \
1716 common/alloc/heapsimple.cpp \
1717 common/alloc/heapoffset.cpp \
1718 common/checksum/crc32.cpp \
1719 common/checksum/crc64.cpp \
1720 common/checksum/md5.cpp \
1721 common/checksum/ipv4.cpp \
1722 common/checksum/ipv6.cpp \
1723 common/err/RTErrConvertToErrno.cpp \
1724 common/err/RTErrConvertFromErrno.cpp \
1725 common/log/log.cpp \
1726 common/log/logellipsis.cpp \
1727 common/log/logrel.cpp \
1728 common/log/logrelellipsis.cpp \
1729 common/log/logcom.cpp \
1730 common/log/logformat.cpp \
1731 common/log/tracebuf.cpp \
1732 common/log/tracedefault.cpp \
1733 common/misc/RTAssertMsg1Weak.cpp \
1734 common/misc/RTAssertMsg2.cpp \
1735 common/misc/RTAssertMsg2Add.cpp \
1736 common/misc/RTAssertMsg2AddWeak.cpp \
1737 common/misc/RTAssertMsg2AddWeakV.cpp \
1738 common/misc/RTAssertMsg2Weak.cpp \
1739 common/misc/RTAssertMsg2WeakV.cpp \
1740 common/misc/assert.cpp \
1741 common/misc/buildconfig.cpp \
1742 common/misc/handletable.cpp \
1743 common/misc/handletablectx.cpp \
1744 common/misc/handletablesimple.cpp \
1745 common/misc/once.cpp \
1746 common/misc/sanity-c.c \
1747 common/misc/sanity-cpp.cpp \
1748 common/misc/term.cpp \
1749 common/path/rtPathVolumeSpecLen.cpp \
1750 common/path/RTPathAbsDup.cpp \
1751 common/path/RTPathAbsEx.cpp \
1752 common/path/RTPathAbsExDup.cpp \
1753 common/path/RTPathAppend.cpp \
1754 common/path/RTPathAppendEx.cpp \
1755 common/path/RTPathExt.cpp \
1756 common/path/RTPathFilename.cpp \
1757 common/path/RTPathHasExt.cpp \
1758 common/path/RTPathHasPath.cpp \
1759 common/path/RTPathParseSimple.cpp \
1760 common/path/RTPathRealDup.cpp \
1761 common/path/RTPathStripExt.cpp \
1762 common/path/RTPathStripFilename.cpp \
1763 common/path/RTPathStripTrailingSlash.cpp \
1764 common/rand/rand.cpp \
1765 common/rand/randadv.cpp \
1766 common/rand/randparkmiller.cpp \
1767 common/string/RTStrCat.cpp \
1768 common/string/RTStrCatEx.cpp \
1769 common/string/RTStrCatP.cpp \
1770 common/string/RTStrCatPEx.cpp \
1771 common/string/RTStrCmp.cpp \
1772 common/string/RTStrCopy.cpp \
1773 common/string/RTStrCopyEx.cpp \
1774 common/string/RTStrCopyP.cpp \
1775 common/string/RTStrCopyPEx.cpp \
1776 common/string/RTStrNCmp.cpp \
1777 common/string/RTStrNLen.cpp \
1778 common/string/RTStrNLenEx.cpp \
1779 common/string/straprintf.cpp \
1780 common/string/strformat.cpp \
1781 common/string/strformatnum.cpp \
1782 common/string/strformatrt.cpp \
1783 common/string/strformattype.cpp \
1784 common/string/strhash1.cpp \
1785 common/string/strprintf.cpp \
1786 common/string/strtonum.cpp \
1787 common/string/stringalloc.cpp \
1788 common/string/utf-16.cpp \
1789 common/string/utf-8.cpp \
1790 common/table/avlpv.cpp \
1791 common/time/time.cpp \
1792 generic/RTLogWriteStdErr-stub-generic.cpp \
1793 generic/RTLogWriteUser-generic.cpp \
1794 generic/RTMpGetArraySize-generic.cpp \
1795 generic/RTRandAdvCreateSystemFaster-generic.cpp \
1796 generic/RTSemEventWait-2-ex-generic.cpp \
1797 generic/RTSemEventWaitNoResume-2-ex-generic.cpp \
1798 generic/RTSemEventMultiWait-2-ex-generic.cpp \
1799 generic/RTSemEventMultiWaitNoResume-2-ex-generic.cpp \
1800 generic/errvars-generic.cpp \
1801 generic/uuid-generic.cpp \
1802 r0drv/alloc-r0drv.cpp \
1803 r0drv/initterm-r0drv.cpp \
1804 r0drv/generic/semspinmutex-r0drv-generic.c \
1805 VBox/log-vbox.cpp \
1806
1807RuntimeR0Drv_SOURCES.linux = \
1808 common/misc/thread.cpp \
1809 common/string/strpbrk.cpp \
1810 generic/RTAssertShouldPanic-generic.cpp \
1811 generic/RTLogWriteStdOut-stub-generic.cpp \
1812 generic/RTMpGetCoreCount-generic.cpp \
1813 generic/mppresent-generic.cpp \
1814 r0drv/linux/alloc-r0drv-linux.c \
1815 r0drv/linux/assert-r0drv-linux.c \
1816 r0drv/linux/initterm-r0drv-linux.c \
1817 r0drv/linux/memobj-r0drv-linux.c \
1818 r0drv/linux/memuserkernel-r0drv-linux.c \
1819 r0drv/linux/mp-r0drv-linux.c \
1820 r0drv/linux/mpnotification-r0drv-linux.c \
1821 r0drv/linux/process-r0drv-linux.c \
1822 r0drv/linux/RTLogWriteDebugger-r0drv-linux.c \
1823 r0drv/linux/semevent-r0drv-linux.c \
1824 r0drv/linux/semeventmulti-r0drv-linux.c \
1825 r0drv/linux/semfastmutex-r0drv-linux.c \
1826 r0drv/linux/semmutex-r0drv-linux.c \
1827 r0drv/linux/spinlock-r0drv-linux.c \
1828 r0drv/linux/thread-r0drv-linux.c \
1829 r0drv/linux/thread2-r0drv-linux.c \
1830 r0drv/linux/threadctxhooks-r0drv-linux.c \
1831 r0drv/linux/time-r0drv-linux.c \
1832 r0drv/linux/timer-r0drv-linux.c \
1833 r0drv/memobj-r0drv.cpp \
1834 r0drv/mpnotification-r0drv.c \
1835 r0drv/powernotification-r0drv.c
1836
1837RuntimeR0Drv_SOURCES.win = \
1838 common/misc/thread.cpp \
1839 common/string/memcmp.asm \
1840 common/string/memchr.asm \
1841 common/string/memcpy.asm \
1842 common/string/memset.asm \
1843 common/string/memmove.asm \
1844 common/string/strlen.asm \
1845 common/string/strncmp.cpp \
1846 common/string/strpbrk.cpp \
1847 generic/RTAssertShouldPanic-generic.cpp \
1848 generic/RTLogWriteStdOut-stub-generic.cpp \
1849 generic/RTTimerCreate-generic.cpp \
1850 generic/mppresent-generic.cpp \
1851 generic/RTMpGetCoreCount-generic.cpp \
1852 nt/RTErrConvertFromNtStatus.cpp \
1853 r0drv/generic/threadctxhooks-r0drv-generic.cpp \
1854 r0drv/memobj-r0drv.cpp \
1855 r0drv/mpnotification-r0drv.c \
1856 r0drv/powernotification-r0drv.c \
1857 r0drv/nt/alloc-r0drv-nt.cpp \
1858 r0drv/nt/assert-r0drv-nt.cpp \
1859 r0drv/nt/initterm-r0drv-nt.cpp \
1860 r0drv/nt/memobj-r0drv-nt.cpp \
1861 r0drv/nt/memuserkernel-r0drv-nt.cpp \
1862 r0drv/nt/mp-r0drv-nt.cpp \
1863 r0drv/nt/mpnotification-r0drv-nt.cpp \
1864 r0drv/nt/process-r0drv-nt.cpp \
1865 r0drv/nt/RTLogWriteDebugger-r0drv-nt.cpp \
1866 r0drv/nt/semevent-r0drv-nt.cpp \
1867 r0drv/nt/semeventmulti-r0drv-nt.cpp \
1868 r0drv/nt/semfastmutex-r0drv-nt.cpp \
1869 r0drv/nt/semmutex-r0drv-nt.cpp \
1870 r0drv/nt/spinlock-r0drv-nt.cpp \
1871 r0drv/nt/thread-r0drv-nt.cpp \
1872 r0drv/nt/thread2-r0drv-nt.cpp \
1873 r0drv/nt/time-r0drv-nt.cpp \
1874 r0drv/nt/timer-r0drv-nt.cpp \
1875 r0drv/nt/RTTimerGetSystemGranularity-r0drv-nt.cpp
1876
1877RuntimeR0Drv_SOURCES.win.amd64 := $(RuntimeWin64ASM_SOURCES)
1878RuntimeR0Drv_SOURCES.win.x86 := $(RuntimeWin32ASM_SOURCES)
1879
1880RuntimeR0Drv_SOURCES.darwin = \
1881 common/misc/thread.cpp \
1882 common/string/memchr.asm \
1883 common/string/strpbrk.cpp \
1884 darwin/RTErrConvertFromDarwin.cpp \
1885 darwin/RTErrConvertFromDarwinIO.cpp \
1886 darwin/RTErrConvertFromDarwinKern.cpp \
1887 generic/RTAssertShouldPanic-generic.cpp \
1888 generic/RTTimerCreate-generic.cpp \
1889 generic/RTMpGetCoreCount-generic.cpp \
1890 generic/mppresent-generic.cpp \
1891 generic/timer-generic.cpp \
1892 r0drv/generic/mpnotification-r0drv-generic.cpp \
1893 r0drv/generic/threadctxhooks-r0drv-generic.cpp \
1894 r0drv/darwin/alloc-r0drv-darwin.cpp \
1895 r0drv/darwin/assert-r0drv-darwin.cpp \
1896 r0drv/darwin/initterm-r0drv-darwin.cpp \
1897 r0drv/darwin/dbgkrnlinfo-r0drv-darwin.cpp \
1898 r0drv/darwin/memobj-r0drv-darwin.cpp \
1899 r0drv/darwin/mp-r0drv-darwin.cpp \
1900 r0drv/darwin/memuserkernel-r0drv-darwin.cpp \
1901 r0drv/darwin/process-r0drv-darwin.cpp \
1902 r0drv/darwin/RTLogWriteDebugger-r0drv-darwin.cpp \
1903 r0drv/darwin/RTLogWriteStdOut-r0drv-darwin.cpp \
1904 r0drv/darwin/semevent-r0drv-darwin.cpp \
1905 r0drv/darwin/semeventmulti-r0drv-darwin.cpp \
1906 r0drv/darwin/semfastmutex-r0drv-darwin.cpp \
1907 r0drv/darwin/semmutex-r0drv-darwin.cpp \
1908 r0drv/darwin/spinlock-r0drv-darwin.cpp \
1909 r0drv/darwin/thread-r0drv-darwin.cpp \
1910 r0drv/darwin/thread2-r0drv-darwin.cpp \
1911 r0drv/darwin/threadpreempt-r0drv-darwin.cpp \
1912 r0drv/darwin/time-r0drv-darwin.cpp \
1913 r0drv/memobj-r0drv.cpp \
1914 r0drv/powernotification-r0drv.c
1915
1916RuntimeR0Drv_SOURCES.os2 = \
1917 common/string/memchr.asm \
1918 common/string/memcmp.asm \
1919 common/string/memcpy.asm \
1920 common/string/mempcpy.asm \
1921 common/string/memmove.asm \
1922 common/string/memset.asm \
1923 common/string/strchr.asm \
1924 common/string/strcmp.asm \
1925 common/string/strcpy.asm \
1926 common/string/strlen.asm \
1927 \
1928 common/string/strncmp.cpp \
1929 common/string/strpbrk.cpp \
1930 \
1931 common/misc/thread.cpp \
1932 generic/RTAssertShouldPanic-generic.cpp \
1933 generic/RTLogWriteDebugger-generic.cpp \
1934 generic/RTLogWriteStdOut-stub-generic.cpp \
1935 generic/RTMpCpuId-generic.cpp \
1936 generic/RTMpCpuIdFromSetIndex-generic.cpp \
1937 generic/RTMpCpuIdToSetIndex-generic.cpp \
1938 generic/RTMpIsCpuPossible-generic.cpp \
1939 generic/RTMpGetCount-generic.cpp \
1940 generic/RTMpGetMaxCpuId-generic.cpp \
1941 generic/RTMpGetOnlineCount-generic.cpp \
1942 generic/RTMpGetOnlineSet-generic.cpp \
1943 generic/RTMpGetSet-generic.cpp \
1944 generic/RTMpIsCpuOnline-generic.cpp \
1945 generic/RTTimerCreate-generic.cpp \
1946 generic/mppresent-generic.cpp \
1947 os2/RTErrConvertFromOS2.cpp \
1948 os2/rtSemWaitOs2ConvertTimeout.cpp \
1949 os2/sys0.asm \
1950 r0drv/generic/RTMpIsCpuWorkPending-r0drv-generic.cpp \
1951 r0drv/generic/RTMpOn-r0drv-generic.cpp \
1952 r0drv/generic/mpnotification-r0drv-generic.cpp \
1953 r0drv/generic/threadctxhooks-r0drv-generic.cpp \
1954 r0drv/memobj-r0drv.cpp \
1955 r0drv/powernotification-r0drv.c \
1956 r0drv/os2/alloc-r0drv-os2.cpp \
1957 r0drv/os2/assert-r0drv-os2.cpp \
1958 r0drv/os2/assertA-r0drv-os2.asm \
1959 r0drv/os2/initterm-r0drv-os2.cpp \
1960 r0drv/os2/memobj-r0drv-os2.cpp \
1961 r0drv/os2/memuserkernel-r0drv-os2.cpp \
1962 r0drv/os2/os2imports.imp \
1963 r0drv/os2/process-r0drv-os2.cpp \
1964 r0drv/os2/RTR0AssertPanicSystem-r0drv-os2.asm \
1965 r0drv/os2/RTR0Os2DHQueryDOSVar.asm \
1966 r0drv/os2/RTR0Os2DHVMGlobalToProcess.asm \
1967 r0drv/os2/semevent-r0drv-os2.cpp \
1968 r0drv/os2/semeventmulti-r0drv-os2.cpp \
1969 r0drv/os2/semfastmutex-r0drv-os2.cpp \
1970 r0drv/os2/spinlock-r0drv-os2.cpp \
1971 r0drv/os2/thread-r0drv-os2.cpp \
1972 r0drv/os2/thread2-r0drv-os2.cpp \
1973 r0drv/os2/time-r0drv-os2.cpp \
1974 r0drv/os2/timer-r0drv-os2.cpp \
1975 r0drv/os2/timerA-r0drv-os2.asm
1976
1977RuntimeR0Drv_SOURCES.freebsd = \
1978 common/misc/thread.cpp \
1979 common/string/memchr.asm \
1980 common/string/memmove.asm \
1981 common/string/strpbrk.cpp \
1982 common/string/memcmp.asm \
1983 common/string/strchr.asm \
1984 generic/RTAssertShouldPanic-generic.cpp \
1985 generic/RTLogWriteDebugger-generic.cpp \
1986 generic/RTLogWriteStdOut-stub-generic.cpp \
1987 generic/RTTimerCreate-generic.cpp \
1988 generic/mppresent-generic.cpp \
1989 r0drv/generic/RTMpIsCpuWorkPending-r0drv-generic.cpp \
1990 r0drv/generic/mpnotification-r0drv-generic.cpp \
1991 r0drv/generic/threadctxhooks-r0drv-generic.cpp \
1992 r0drv/freebsd/alloc-r0drv-freebsd.c \
1993 r0drv/freebsd/assert-r0drv-freebsd.c \
1994 r0drv/freebsd/initterm-r0drv-freebsd.c \
1995 r0drv/freebsd/memobj-r0drv-freebsd.c \
1996 r0drv/freebsd/memuserkernel-r0drv-freebsd.c \
1997 r0drv/freebsd/process-r0drv-freebsd.c \
1998 r0drv/freebsd/semevent-r0drv-freebsd.c \
1999 r0drv/freebsd/semeventmulti-r0drv-freebsd.c \
2000 r0drv/freebsd/semfastmutex-r0drv-freebsd.c \
2001 r0drv/freebsd/semmutex-r0drv-freebsd.c \
2002 r0drv/freebsd/spinlock-r0drv-freebsd.c \
2003 r0drv/freebsd/thread-r0drv-freebsd.c \
2004 r0drv/freebsd/thread2-r0drv-freebsd.c \
2005 r0drv/freebsd/time-r0drv-freebsd.c \
2006 r0drv/freebsd/mp-r0drv-freebsd.c \
2007 generic/timer-generic.cpp \
2008 r0drv/memobj-r0drv.cpp \
2009 r0drv/powernotification-r0drv.c
2010
2011RuntimeR0Drv_SOURCES.solaris = \
2012 common/misc/thread.cpp \
2013 common/string/memchr.asm \
2014 generic/RTAssertShouldPanic-generic.cpp \
2015 generic/RTLogWriteStdOut-stub-generic.cpp \
2016 generic/RTMpGetCoreCount-generic.cpp \
2017 generic/RTTimerCreate-generic.cpp \
2018 generic/mppresent-generic.cpp \
2019 r0drv/memobj-r0drv.cpp \
2020 r0drv/mpnotification-r0drv.c \
2021 r0drv/powernotification-r0drv.c \
2022 r0drv/solaris/RTLogWriteDebugger-r0drv-solaris.c \
2023 r0drv/solaris/RTMpPokeCpu-r0drv-solaris.c \
2024 r0drv/solaris/alloc-r0drv-solaris.c \
2025 r0drv/solaris/assert-r0drv-solaris.c \
2026 r0drv/solaris/dbgkrnlinfo-r0drv-solaris.c \
2027 r0drv/solaris/initterm-r0drv-solaris.c \
2028 r0drv/solaris/memuserkernel-r0drv-solaris.c \
2029 r0drv/solaris/mpnotification-r0drv-solaris.c \
2030 r0drv/solaris/memobj-r0drv-solaris.c \
2031 r0drv/solaris/mp-r0drv-solaris.c \
2032 r0drv/solaris/process-r0drv-solaris.c \
2033 r0drv/solaris/semevent-r0drv-solaris.c \
2034 r0drv/solaris/semeventmulti-r0drv-solaris.c \
2035 r0drv/solaris/semfastmutex-r0drv-solaris.c \
2036 r0drv/solaris/semmutex-r0drv-solaris.c \
2037 r0drv/solaris/spinlock-r0drv-solaris.c \
2038 r0drv/solaris/thread-r0drv-solaris.c \
2039 r0drv/solaris/thread2-r0drv-solaris.c \
2040 r0drv/solaris/threadctxhooks-r0drv-solaris.c \
2041 r0drv/solaris/time-r0drv-solaris.c \
2042 r0drv/solaris/timer-r0drv-solaris.c
2043
2044RuntimeR0Drv_SOURCES.haiku = \
2045 common/misc/thread.cpp \
2046 common/string/memchr.asm \
2047 common/string/memmove.asm \
2048 common/string/strpbrk.cpp \
2049 common/string/memcmp.asm \
2050 common/string/strchr.asm \
2051 generic/RTAssertShouldPanic-generic.cpp \
2052 generic/RTTimerCreate-generic.cpp \
2053 generic/mppresent-generic.cpp \
2054 r0drv/generic/RTMpIsCpuWorkPending-r0drv-generic.cpp \
2055 r0drv/generic/mpnotification-r0drv-generic.cpp \
2056 r0drv/generic/threadctxhooks-r0drv-generic.cpp \
2057 r0drv/haiku/alloc-r0drv-haiku.c \
2058 r0drv/haiku/assert-r0drv-haiku.c \
2059 r0drv/haiku/initterm-r0drv-haiku.c \
2060 r0drv/haiku/memobj-r0drv-haiku.c \
2061 r0drv/haiku/mp-r0drv-haiku.c \
2062 r0drv/haiku/process-r0drv-haiku.c \
2063 r0drv/haiku/RTLogWriteDebugger-r0drv-haiku.c \
2064 r0drv/haiku/RTLogWriteStdOut-r0drv-haiku.c \
2065 r0drv/haiku/semevent-r0drv-haiku.c \
2066 r0drv/haiku/semeventmulti-r0drv-haiku.c \
2067 r0drv/haiku/semfastmutex-r0drv-haiku.c \
2068 r0drv/haiku/semmutex-r0drv-haiku.c \
2069 r0drv/haiku/spinlock-r0drv-haiku.c \
2070 r0drv/haiku/thread-r0drv-haiku.c \
2071 r0drv/haiku/thread2-r0drv-haiku.c \
2072 r0drv/haiku/time-r0drv-haiku.c \
2073 generic/timer-generic.cpp \
2074 r0drv/memobj-r0drv.cpp \
2075 r0drv/powernotification-r0drv.c
2076
2077## PORTME: Porters create and add their selection of platform specific Ring-0 Driver files here.
2078
2079RuntimeR0Drv_ORDERDEPS.freebsd = \
2080 $(PATH_STAGE)/gen-sys-hdrs/bus_if.h \
2081 $(PATH_STAGE)/gen-sys-hdrs/device_if.h
2082
2083
2084#
2085# RuntimeGuestR0 - Guest driver runtime.
2086# This is almost the same as the RuntimeR0Drv, the main difference
2087# is in the backdoor logging and the lack of sup.h (which should be
2088# made irrelevant even for RuntimeR0Drv).
2089#
2090RuntimeGuestR0_TEMPLATE := VBOXGUESTR0LIB
2091RuntimeGuestR0_EXTENDS = RuntimeR0Drv
2092RuntimeGuestR0_SOURCES := $(filter-out generic/RTLogWriteUser-generic.cpp, $(RuntimeR0Drv_SOURCES))
2093RuntimeGuestR0_SOURCES += \
2094 VBox/logbackdoor.cpp
2095
2096
2097#
2098# RuntimeGuestR0NT4 - Win32 NT4 guest driver runtime.
2099#
2100RuntimeGuestR0NT4_EXTENDS = RuntimeGuestR0
2101RuntimeGuestR0NT4_EXTENDS_BY = appending
2102RuntimeGuestR0NT4_DEFS = IPRT_TARGET_NT4
2103
2104
2105ifdef VBOX_WITH_RAW_MODE
2106 #
2107 # RuntimeRC - Raw-mode context library.
2108 #
2109 RuntimeRC_TEMPLATE = VBoxRc
2110 RuntimeRC_DEFS = IN_RT_RC RT_WITH_VBOX
2111 RuntimeRC_INCS = include
2112 RuntimeRC_SOURCES := \
2113 common/checksum/crc32.cpp \
2114 common/checksum/crc64.cpp \
2115 common/checksum/md5.cpp \
2116 common/log/log.cpp \
2117 common/log/logellipsis.cpp \
2118 common/log/logrel.cpp \
2119 common/log/logrelellipsis.cpp \
2120 common/log/logcom.cpp \
2121 common/log/logformat.cpp \
2122 common/log/tracebuf.cpp \
2123 common/log/tracedefault.cpp \
2124 common/misc/RTAssertMsg1Weak.cpp \
2125 common/misc/RTAssertMsg2.cpp \
2126 common/misc/RTAssertMsg2Add.cpp \
2127 common/misc/RTAssertMsg2AddWeak.cpp \
2128 common/misc/RTAssertMsg2AddWeakV.cpp \
2129 common/misc/RTAssertMsg2Weak.cpp \
2130 common/misc/RTAssertMsg2WeakV.cpp \
2131 common/misc/assert.cpp \
2132 common/misc/buildconfig.cpp \
2133 common/misc/sanity-c.c \
2134 common/misc/sanity-cpp.cpp \
2135 common/path/RTPathFilename.cpp \
2136 common/string/strformat.cpp \
2137 common/string/strformatnum.cpp \
2138 common/string/strformatrt.cpp \
2139 common/string/strformattype.cpp \
2140 common/string/strncmp.cpp \
2141 common/string/strpbrk.cpp \
2142 common/string/strprintf.cpp \
2143 common/string/RTStrCopy.cpp \
2144 common/string/RTStrCopyEx.cpp \
2145 common/table/avllu32.cpp \
2146 common/table/avlou32.cpp \
2147 common/table/avlogcphys.cpp \
2148 common/table/avlogcptr.cpp \
2149 common/table/avlohcphys.cpp \
2150 common/table/avloioport.cpp \
2151 common/table/avlrogcphys.cpp \
2152 common/table/avlrogcptr.cpp \
2153 common/table/avlroioport.cpp \
2154 common/table/avlroogcptr.cpp \
2155 common/table/avlu32.cpp \
2156 common/time/timeprog.cpp \
2157 common/time/timesup.cpp \
2158 gc/initterm-gc.cpp \
2159 generic/RTAssertShouldPanic-generic.cpp \
2160 generic/errvars-generic.cpp \
2161 \
2162 $(RuntimeNoCrt_SOURCES)
2163
2164 #if1of ($(KBUILD_TARGET_ARCH),amd64 x86)
2165 # RuntimeRC_SOURCES += common/time/timesupA.asm
2166 #else
2167 RuntimeRC_SOURCES += common/time/timesupref.cpp
2168 #endif
2169
2170 RuntimeRC_SOURCES.win.x86 = $(RuntimeWin32ASM_SOURCES)
2171
2172 ifeq ($(VBOX_LDR_FMT32),lx)
2173 RuntimeRC_SOURCES += os2/sys0.asm
2174 endif
2175
2176 if1of ($(KBUILD_TARGET), darwin solaris freebsd)
2177 RuntimeRC_SOURCES += \
2178 common/math/gcc/adddi3.c \
2179 common/math/gcc/anddi3.c \
2180 common/math/gcc/ashldi3.c \
2181 common/math/gcc/ashrdi3.c \
2182 common/math/gcc/cmpdi2.c \
2183 common/math/gcc/divdi3.c \
2184 common/math/gcc/iordi3.c \
2185 common/math/gcc/lshldi3.c \
2186 common/math/gcc/lshrdi3.c \
2187 common/math/gcc/moddi3.c \
2188 common/math/gcc/muldi3.c \
2189 common/math/gcc/negdi2.c \
2190 common/math/gcc/notdi2.c \
2191 common/math/gcc/qdivrem.c \
2192 common/math/gcc/subdi3.c \
2193 common/math/gcc/ucmpdi2.c \
2194 common/math/gcc/udivdi3.c \
2195 common/math/gcc/umoddi3.c \
2196 common/math/gcc/xordi3.c
2197 endif
2198
2199
2200 #
2201 # RuntimeRCStub - Raw-mode context startup stub for Windows.
2202 #
2203 RuntimeRCStub_TEMPLATE = VBoxRc
2204 RuntimeRCStub_SOURCES.win = \
2205 nt/NtProcessStartup-stub.cpp
2206
2207
2208endif # VBOX_WITH_RAW_MODE
2209
2210
2211#
2212# Static library for new & delete for the electric fence.
2213#
2214RuntimeEFCPP_TEMPLATE := $(VBoxRT_TEMPLATE)
2215RuntimeEFCPP_SDKS := $(RuntimeR3_SDKS)
2216RuntimeEFCPP_SDKS.$(KBUILD_TARGET) := $(RuntimeR3_SDKS.$(KBUILD_TARGET))
2217RuntimeEFCPP_DEFS := $(RuntimeR3_DEFS)
2218RuntimeEFCPP_DEFS.$(KBUILD_TARGET) := $(RuntimeR3_DEFS.$(KBUILD_TARGET))
2219RuntimeEFCPP_INCS := $(RuntimeR3_INCS)
2220RuntimeEFCPP_INCS.$(KBUILD_TARGET) := $(RuntimeR3_INCS.$(KBUILD_TARGET))
2221RuntimeEFCPP_SOURCES := r3/alloc-ef-cpp.cpp
2222
2223
2224
2225#
2226# The NTDLL mini import library.
2227#
2228# Note! The reason for doing this is to avoid importing CRT symbols from the
2229# NTDLL. We do not wish to do this because:
2230# - Our compiler is usually a different one and we should use the
2231# matching CRT,
2232# - Older versions of NTDLL may not sport all the exports our w2k3 or
2233# later WINDDK ntdll.lib have and thus we may easily end up with
2234# images that does not load on older windows versions.
2235#
2236RuntimeR3NtDll-amd64_TEMPLATE = VBoxR3Dll
2237RuntimeR3NtDll-amd64_BLD_TRG_ARCH = amd64
2238RuntimeR3NtDll-amd64_ARFLAGS = /NODEFAULTLIB /MACHINE:amd64
2239RuntimeR3NtDll-amd64_SOURCES = \
2240 r3/win/ntdll-mini-implib.c \
2241 r3/win/ntdll-mini-implib.def
2242
2243RuntimeR3NtDll-x86_EXTENDS = RuntimeR3NtDll-amd64
2244RuntimeR3NtDll-x86_BLD_TRG_ARCH = x86
2245RuntimeR3NtDll-x86_ARFLAGS = /NODEFAULTLIB /MACHINE:x86
2246
2247
2248#
2249# Bag of tricks required for making VCC100 output binaries work on NT4, W2K
2250# early XP and early W2K3.
2251#
2252RuntimeR3VccTricks_TEMPLATE = VBoxR3Dll
2253RuntimeR3VccTricks_SOURCES = \
2254 r3/win/vcc100-kernel32-fakes.cpp \
2255 r3/win/vcc100-kernel32-fakesA.asm
2256
2257
2258#
2259# errmsg.cpp depends on a generated header.
2260#
2261common/err/errmsg.cpp_DEPS = $(IPRT_OUT_DIR)/errmsgdata.h
2262common/err/errmsg.cpp_INCS = $(IPRT_OUT_DIR)
2263
2264win/errmsgwin.cpp_DEPS = $(IPRT_OUT_DIR)/errmsgcomdata.h
2265win/errmsgwin.cpp_INCS = $(IPRT_OUT_DIR)
2266
2267# Our COM errors only for R3 libraries on the host
2268define def_errmsgwin_deps
2269 $(lib)_win/errmsgwin.cpp_DEPS = $(IPRT_OUT_DIR)/errmsgvboxcomdata.h
2270 $(lib)_common/err/errmsgxpcom.cpp_INCS = $(IPRT_OUT_DIR)
2271 $(lib)_common/err/errmsgxpcom.cpp_DEPS = $(IPRT_OUT_DIR)/errmsgvboxcomdata.h
2272endef
2273$(foreach lib,RuntimeR3 RuntimeBldProg VBoxRT VBoxRT-x86,$(eval $(def_errmsgwin_deps)))
2274
2275
2276#
2277# Generate the status code data.
2278#
2279$(IPRT_OUT_DIR)/errmsgdata.h: \
2280 $(VBOX_PATH_RUNTIME_SRC)/common/err/errmsg.sed \
2281 $(PATH_ROOT)/include/iprt/err.h \
2282 $(PATH_ROOT)/include/VBox/err.h \
2283 | $$(dir $$@)
2284 $(call MSG_GENERATE,,$@,$(filter %.h,$^))
2285 $(QUIET)$(REDIRECT) -wo $@ -- $(SED) -f $< $(filter %.h,$^)
2286
2287## @todo r=bird: rename this to indicate that it's not only COM errors, but all win32/64 errors.
2288$(IPRT_OUT_DIR)/errmsgcomdata.h: \
2289 $(VBOX_PATH_RUNTIME_SRC)/common/err/errmsgcom.sed \
2290 $$(PATH_SDK_$(VBOX_WINPSDK)_INC)/WinError.h \
2291 | $$(dir $$@)
2292 $(call MSG_GENERATE,,$@,$(filter %.h,$^))
2293 $(QUIET)$(REDIRECT) -wo $@ -- $(SED) -f $< $(filter %.h,$^)
2294
2295$(IPRT_OUT_DIR)/errmsgvboxcomdata.h.ts +| $(IPRT_OUT_DIR)/errmsgvboxcomdata.h: \
2296 $(VBOX_PATH_RUNTIME_SRC)/VBox/errmsgvboxcom.xsl \
2297 $(VBOX_XIDL_FILE_SRC) \
2298 | $$(dir $$@)
2299 $(call MSG_GENERATE,,$@,$(filter %.xidl,$^))
2300 $(QUIET)$(VBOX_XSLTPROC) -o $(IPRT_OUT_DIR)/errmsgvboxcomdata.h.ts $< $(filter %.xidl,$^)
2301 $(QUIET)$(CP) --changed -fv $(IPRT_OUT_DIR)/errmsgvboxcomdata.h.ts $(IPRT_OUT_DIR)/errmsgvboxcomdata.h
2302
2303
2304if "$(KBUILD_TARGET)" == "freebsd"
2305#
2306# FreeBSDGeneratedKernelHeaders - Generate some kernel interface headers.
2307#
2308# These are used by:
2309# - The RTMp* API in IPRT.
2310# - VBoxGuest
2311#
2312# Note! We cannot give a output path to the awk program, it will always
2313# generate the header next to the source. So, we'll have to temporarily copy
2314# the source file to the destination directory to work.
2315#
2316VBOX_AWK := /usr/bin/awk
2317INSTALLS += FreeBSDGeneratedKernelHeaders
2318FreeBSDGeneratedKernelHeaders_INST = gen-sys-hdrs/
2319FreeBSDGeneratedKernelHeaders_SOURCES = \
2320 $(FreeBSDGeneratedKernelHeaders_0_OUTDIR)/bus_if.h \
2321 $(FreeBSDGeneratedKernelHeaders_0_OUTDIR)/device_if.h \
2322 $(FreeBSDGeneratedKernelHeaders_0_OUTDIR)/pci_if.h
2323FreeBSDGeneratedKernelHeaders_CLEAN = $(FreeBSDGeneratedKernelHeaders_SOURCES)
2324
2325$$(FreeBSDGeneratedKernelHeaders_0_OUTDIR)/bus_if.h: $(VBOX_FREEBSD_SRC)/kern/bus_if.m | $$(dir $$@)
2326 $(call MSG_TOOL,awk,FreeBSDGeneratedKernelHeaders,$<,$@)
2327 $(QUIET)$(CP) -f $< $(@D)/bus_if.m
2328 $(QUIET)$(VBOX_AWK) -f $(VBOX_FREEBSD_SRC)/tools/makeobjops.awk $(@D)/bus_if.m -h -p
2329 $(QUIET)$(RM) $(@D)/bus_if.m
2330
2331$$(FreeBSDGeneratedKernelHeaders_0_OUTDIR)/device_if.h: $(VBOX_FREEBSD_SRC)/kern/device_if.m | $$(dir $$@)
2332 $(call MSG_TOOL,awk,FreeBSDGeneratedKernelHeaders,$<,$@)
2333 $(QUIET)$(CP) -f $< $(@D)/device_if.m
2334 $(QUIET)$(VBOX_AWK) -f $(VBOX_FREEBSD_SRC)/tools/makeobjops.awk $(@D)/device_if.m -h -p
2335 $(QUIET)$(RM) $(@D)/device_if.m
2336
2337$$(FreeBSDGeneratedKernelHeaders_0_OUTDIR)/pci_if.h: $(VBOX_FREEBSD_SRC)/dev/pci/pci_if.m | $$(dir $$@)
2338 $(call MSG_TOOL,awk,FreeBSDGeneratedKernelHeaders,$<,$@)
2339 $(QUIET)$(CP) -f $< $(@D)/pci_if.m
2340 $(QUIET)$(VBOX_AWK) -f $(VBOX_FREEBSD_SRC)/tools/makeobjops.awk $(@D)/pci_if.m -h -p
2341 $(QUIET)$(RM) $(@D)/pci_if.m
2342endif # FreeBSD
2343
2344
2345#
2346# Aliases for .cpp.h files so we can more easily do syntax checking from the editor.
2347#
2348ldrELFRelocatable.cpp.o: ldrELF.o
2349ldrELFRelocatable.cpp.obj: ldrELF.obj
2350
2351
2352#
2353# Doxygen documentation.
2354#
2355IPRT_DOXYFILE_INPUT_DIRS = \
2356 $(PATH_ROOT)/include/iprt \
2357 $(PATH_ROOT)/include/iprt/cpp \
2358 $(PATH_ROOT)/include/iprt/linux \
2359 $(PATH_ROOT)/include/iprt/nocrt \
2360 $(PATH_ROOT)/include/iprt/nocrt/x86 \
2361 $(PATH_ROOT)/include/iprt/nocrt/amd64 \
2362 $(PATH_ROOT)/include/iprt/nocrt/compiler \
2363 $(VBOX_PATH_RUNTIME_SRC)/include/internal \
2364 $(VBOX_PATH_RUNTIME_SRC)/common/alloc \
2365 $(VBOX_PATH_RUNTIME_SRC)/common/asm \
2366 $(VBOX_PATH_RUNTIME_SRC)/common/checksum \
2367 $(VBOX_PATH_RUNTIME_SRC)/common/dbg \
2368 $(VBOX_PATH_RUNTIME_SRC)/common/err \
2369 $(VBOX_PATH_RUNTIME_SRC)/common/ldr \
2370 $(VBOX_PATH_RUNTIME_SRC)/common/log \
2371 $(VBOX_PATH_RUNTIME_SRC)/common/math \
2372 $(VBOX_PATH_RUNTIME_SRC)/common/math/amd64 \
2373 $(VBOX_PATH_RUNTIME_SRC)/common/math/gcc \
2374 $(VBOX_PATH_RUNTIME_SRC)/common/math/x86 \
2375 $(VBOX_PATH_RUNTIME_SRC)/common/misc \
2376 $(VBOX_PATH_RUNTIME_SRC)/common/path \
2377 $(VBOX_PATH_RUNTIME_SRC)/common/rand \
2378 $(VBOX_PATH_RUNTIME_SRC)/common/string \
2379 $(VBOX_PATH_RUNTIME_SRC)/common/table \
2380 $(VBOX_PATH_RUNTIME_SRC)/common/time \
2381 $(VBOX_PATH_RUNTIME_SRC)/VBox \
2382 $(foreach dir, $(VBOX_PATH_RUNTIME_SRC) $(VBOX_PATH_RUNTIME_SRC)/r3 $(VBOX_PATH_RUNTIME_SRC)/r0drv,\
2383 $(dir) \
2384 $(dir)/darwin \
2385 $(dir)/haiku \
2386 $(dir)/linux \
2387 $(dir)/nt \
2388 $(dir)/os2 \
2389 $(dir)/solaris \
2390 $(dir)/win \
2391 $(dir)/win32 \
2392 $(dir)/win64 \
2393 $(dir)/generic \
2394 )
2395
2396# These must come first in order to make things look nice.
2397IPRT_DOXYFILE_INPUT_FIRST =\
2398 $(PATH_ROOT)/include/iprt/cdefs.h \
2399 $(PATH_ROOT)/include/iprt/types.h \
2400 $(PATH_ROOT)/include/iprt/runtime.h \
2401 $(PATH_ROOT)/include/iprt/param.h \
2402 $(PATH_ROOT)/include/iprt/assert.h \
2403 $(PATH_ROOT)/include/iprt/asm.h \
2404
2405IPRT_DOXYFILE_INPUT := \
2406 $(filter-out %.cpp.h, $(sort $(wildcard $(addsuffix /*.h, $(IPRT_DOXYFILE_INPUT_DIRS)))) ) \
2407 $(foreach dir, $(IPRT_DOXYFILE_INPUT_DIRS), $(wildcard $(dir)/*.cpp $(dir)/.c $(dir)/.asm))
2408IPRT_DOXYFILE_INPUT := \
2409 $(IPRT_DOXYFILE_INPUT_FIRST) \
2410 $(filter-out $(IPRT_DOXYFILE_INPUT_FIRST), $(IPRT_DOXYFILE_INPUT))
2411
2412
2413IPRT_DOXYFILE_OUTPUT = $(PATH_OUT)/docs/iprt
2414BLDDIRS += $(IPRT_DOXYFILE_OUTPUT)
2415
2416includedep $(IPRT_OUT_DIR)/Doxyfile.iprt.dep
2417
2418# Generate the Doxyfile
2419$(IPRT_OUT_DIR)/Doxyfile.iprt: \
2420 $(VBOX_PATH_RUNTIME_SRC)/Doxyfile \
2421 $(VBOX_PATH_RUNTIME_SRC)/Makefile.kmk \
2422 $(comp-vars IPRT_DOXYFILE_INPUT,DOXYGEN_INPUT_PREV,FORCE) \
2423 $(comp-vars IPRT_DOXYFILE_OUTPUT,DOXYGEN_OUTPUT_PREV,FORCE) \
2424 | $$(dir $$@)
2425 $(RM) -f $@ [email protected] [email protected]
2426 $(CP) -f $(VBOX_PATH_RUNTIME_SRC)/Doxyfile [email protected]
2427 $(APPEND) [email protected]
2428 $(APPEND) [email protected] "OUTPUT_DIRECTORY = $(IPRT_DOXYFILE_OUTPUT)"
2429 $(APPEND) [email protected] "WARN_LOGFILE = $(IPRT_DOXYFILE_OUTPUT)/errors"
2430 $(APPEND) [email protected] "INCLUDE_PATH = $(PATH_ROOT)/include include . common/table"
2431 $(APPEND) [email protected] "INCLUDE_FILE_PATTERNS = *.cpp.h"
2432 $(APPEND) [email protected] "PREDEFINED += $(ARCH_BITS_DEFS)"
2433 $(APPEND) [email protected]
2434 $(APPEND) [email protected] "INPUT = $(IPRT_DOXYFILE_INPUT)"
2435 $(APPEND) [email protected]
2436 $(MV) -f [email protected] $@
2437 @$(APPEND) [email protected] "DOXYGEN_OUTPUT_PREV = $(IPRT_DOXYFILE_OUTPUT)"
2438 @$(APPEND) [email protected] "DOXYGEN_INPUT_PREV = $(IPRT_DOXYFILE_INPUT)"
2439
2440# Do the actual job.
2441$(IPRT_OUT_DIR)/docs.iprt: $(IPRT_OUT_DIR)/Doxyfile.iprt $$(IPRT_DOXYFILE_INPUT) | $(IPRT_DOXYFILE_OUTPUT)/
2442 $(RM) -f $(wildcard $(IPRT_DOXYFILE_OUTPUT)/html/*) $(IPRT_OUT_DIR)/docs.iprt
2443 doxygen $(IPRT_OUT_DIR)/Doxyfile.iprt
2444 $(APPEND) $(IPRT_OUT_DIR)/docs.iprt
2445
2446# aliases
2447docs.iprt: $(IPRT_OUT_DIR)/docs.iprt
2448if !defined(VBOX_ONLY_DOCS) && defined(VBOX_WITH_ALL_DOXYGEN_TARGETS)
2449docs: $(IPRT_OUT_DIR)/docs.iprt
2450endif
2451
2452test-doxygen::
2453 @echo test-$(comp-vars IPRT_DOXYFILE_OUTPUT,DOXYGEN_OUTPUT_PREV,FORCE)
2454 @echo $(IPRT_DOXYFILE_OUTPUT)
2455 @echo $(DOXYGEN_OUTPUT_PREV)
2456 @echo $(IPRT_DOXYFILE_INPUT)
2457
2458
2459#
2460# Test mangling.
2461#
2462if1of ($(LIBRARIES),RuntimeR3 RuntimeR0 RuntimeR0Drv RuntimeRC)
2463 test-mangling:: $(IPRT_OUT_DIR)/mangling.run
2464 OTHERS += $(IPRT_OUT_DIR)/mangling.run
2465 CLEANS += $(IPRT_OUT_DIR)/mangling.run
2466 $(IPRT_OUT_DIR)/mangling.run: \
2467 $$(RuntimeR3_1_TARGET) \
2468 $$(RuntimeR0_1_TARGET) \
2469 $$(RuntimeR0Drv_1_TARGET) \
2470 $$(RuntimeRC_1_TARGET)
2471 if1of ($(KBUILD_TARGET), win os2)
2472 $(call MSG_L1,IPRT: skipped mangling test.)
2473 else
2474# Generate a SED script from mangling.h that checks for known symbols.
2475 @$(SED) \
2476 -e '/# *define.*RT_MANGLER/!d' \
2477 -e 's/^.*RT_MANGLER(\([^)][^)]*\)).*$(DOLLAR)/\/^\1$(DOLLAR)\/b ok/' \
2478 $(PATH_ROOT)/include/iprt/mangling.h \
2479 --output "$@"
2480 @$(APPEND) -n '$@' \
2481 ':bad' \
2482 's/^\(.*\)$(DOLLAR)/error: Missing # define \1 RT_MANGLER(\1)/' \
2483 'p' \
2484 'q 1' \
2485 '' \
2486 ':ok' \
2487 'd'
2488# Find the best way to generate a symbol list and subject it to mangling.h.
2489 if $(intersects $(KBUILD_TARGET), linux) && "$(VBOX_GCC_fvisibility-hidden)"
2490 $(call MSG_L1,IPRT: Testing mangling and visiblity...)
2491 @readelf -Ws $^ \
2492 | $(SED) \
2493 -e '/^ *[[:digit:]]\+:/!d' \
2494 -e 's/^ \+[[:digit:]]\+: \+[[:xdigit:]]\+ \+[[:digit:]]\+ \+//' \
2495 -e '/^SECTION/d' \
2496 -e '/^FILE/d' \
2497 -e 's/^[[:alpha:]]\+ \+//' \
2498 -e '/LOCAL/d' \
2499 -e 's/^[[:alpha:]]\+ \+//' \
2500 -e '/^HIDDEN/d' \
2501 -e 's/^[[:alpha:]]\+ \+//' \
2502 -e '/^UND/d' \
2503 -e 's/^[[:digit:]]\+ \+//' \
2504 \
2505 -e '/^nocrt_/d' \
2506 -e '/^memchr/d' \
2507 -e '/^memcmp/d' \
2508 -e '/^memcpy/d' \
2509 -e '/^mempcpy/d' \
2510 -e '/^memmove/d' \
2511 -e '/^memset/d' \
2512 -e '/^strchr/d' \
2513 -e '/^strpbrk/d' \
2514 -e '/^_Z7strpbrk/d' \
2515 -e '/^strcmp/d' \
2516 -e '/^strcpy/d' \
2517 -e '/^strncpy/d' \
2518 -e '/^strlen/d' \
2519 -e '/^_Z[[:alpha:]]*[[:digit:]]\+RTC/d' \
2520 -e '/^_Z[[:alpha:]]*[[:digit:]]\+RTC/d' \
2521 \
2522 -e '/^_ZnwjPv/d' \
2523 -e '/^_ZnwmPv/d' \
2524 -e '/^_ZNSt9bad_allocC1Ev/d' \
2525 -e '/^_ZNSt9exceptionC2Ev/d' \
2526 -e '/^_ZNSt9exceptionC[12]ERKS_/d' \
2527 \
2528 -e '/^_ZN[a-zA-Z]*St[[:digit:]]*_*[lL]ist/d' \
2529 -e '/^_ZN[a-zA-Z]*[[:digit:]]*__gnu_cxx/d' \
2530 -e '/^_ZNSa.*ElementNode.*/d' \
2531 -e '/^_ZSt.*ElementNode.*/d' \
2532 \
2533 -e '/^_Z[[:digit:]]\+dbus/d' \
2534 -e '/^_Z13RTDBusLoadLibv/d' \
2535 \
2536 -e '/^VBoxHost_/d'\
2537 -e '/^VBoxGuest_/d'\
2538 | $(SED) -nf "$@"
2539 else
2540 $(call MSG_L1,IPRT: Testing mangling...)
2541 nm $^ | $(SED) -n \
2542 -e 's/^[0-9a-f][0-9a-f]* //' \
2543 -e '/^[TUDB] /!d' \
2544 -e 's/^. //' \
2545 \
2546 -e '/^g_cchrt/d'\
2547 -e '/^g_frt/d'\
2548 -e '/^g_offrt/d'\
2549 -e '/^g_pfnrt/d'\
2550 -e '/^g_rt/d'\
2551 -e '/^g_szrt/d'\
2552 -e '/^g_ProcessSelf/d'\
2553 -e '/^g_u64ProgramStart/d'\
2554 -e '/^g_enmProcessPriority/d'\
2555 -e '/^g_hDbgModStrCache/d'\
2556 \
2557 -e '/^RTDBusLoadLib/d' \
2558 \
2559 -e '/^RT/p' \
2560 -e '/^g_/p' \
2561 | $(SED) -nf "$@"
2562 endif
2563 endif
2564endif
2565 $(QUIET)$(APPEND) -t $@
2566
2567if !defined(VBOX_ONLY_ADDITIONS) && !defined(VBOX_ONLY_TESTSUITE) && !defined(VBOX_ONLY_DOCS)
2568#
2569# Windows build tool.
2570#
2571BLDPROGS.win += ntBldSymDb
2572ntBldSymDb_TEMPLATE = VBoxAdvBldProg
2573ntBldSymDb_INCS = .
2574ntBldSymDb_SOURCES = r0drv/nt/ntBldSymDb.cpp
2575endif
2576
2577#
2578# Generate the rules (we're the to sub-makefile).
2579#
2580include $(FILE_KBUILD_SUB_FOOTER)
2581
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