VirtualBox

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

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

RTDirExists: Added a generic implementation for use on Window because GetFileAttributesEx doesn't do what we like it to do.

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