VirtualBox

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

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

Runtime/Solaris: RTMpGetCoreCount, RTMpGetOnlineCoreCount implementations.

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