VirtualBox

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

Last change on this file since 22672 was 22573, checked in by vboxsync, 16 years ago

Generated FreeBSD kernel headers, take 5. *click*

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