VirtualBox

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

Last change on this file since 9705 was 9670, checked in by vboxsync, 17 years ago

L4 doesn't currently build anyway

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 43.9 KB
Line 
1# $Id: Makefile.kmk 9670 2008-06-13 06:38:09Z 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
31
32DEPTH ?= ../../..
33SUB_DEPTH = .
34include $(KBUILD_PATH)/subheader.kmk
35
36ifdef VBOX_ONLY_ADDITIONS
37 #
38 # Only build the additions, sort out the legacy names first.
39 #
40 LIBRARIES = RuntimeGuestR0 RuntimeGuestR3 RuntimeGuestR3Mini
41 #LIBRARIES.os2 = RuntimeGuestR0OS2Warp3
42 LIBRARIES.win.x86 = RuntimeGuestR0NT4
43 ifndef VBOX_WITH_ADDITION_DRIVERS
44 if1of ($(KBUILD_TARGET), linux l4) # All drivers are optional, can skip RuntimeGuestR0.
45 LIBRARIES := $(filter-out RuntimeGuestR0, $(LIBRARIES))
46 endif
47 endif
48
49else
50
51 #
52 # Normal build.
53 #
54 include testcase/Makefile.kmk
55
56 BLDPROGS = uniread
57 LIBRARIES = RuntimeR3 RuntimeR0 RuntimeGC RuntimeEFCPP RuntimeR3NoCRTGCC
58 ifdef VBOX_WITH_VBOXDRV
59 LIBRARIES += RuntimeR0Drv
60 endif
61 ifdef VBOX_WITH_ADDITIONS
62 LIBRARIES += RuntimeGuestR0 RuntimeGuestR3 RuntimeGuestR3Mini
63 #LIBRARIES.os2 = RuntimeGuestR0OS2Warp3
64 LIBRARIES.win.x86 = RuntimeGuestR0NT4
65 ifndef VBOX_WITH_ADDITION_DRIVERS
66 if1of ($(KBUILD_TARGET), linux l4) # All drivers are optional, can skip RuntimeGuestR0.
67 LIBRARIES := $(filter-out RuntimeGuestR0, $(LIBRARIES))
68 endif
69 endif
70 endif # VBOX_WITH_ADDITIONS
71 LIBRARIES.l4 = RuntimeR3L4 RuntimeLnxHostR3
72 DLLS = VBoxRT
73 OTHER_CLEAN = \
74 $(PATH_TARGET)/errmsgdata.h \
75 $(PATH_TARGET)/errmsgcomdata.h \
76 $(PATH_TARGET)/Doxyfile \
77 $(PATH_TARGET)/Doxyfile.dep \
78 $(PATH_TARGET)/docs.iprt
79
80endif
81
82
83#
84# Unicode Specification reader used to regenerate unidata.cpp.
85#
86uniread_TEMPLATE = VBOXBLDPROG
87uniread_SOURCES = common/string/uniread.cpp
88uniread_INCS = include
89
90#
91# Win64 assembly sources.
92#
93RuntimeWin64ASM_SOURCES = \
94 win/amd64/ASMAtomicBitClear.asm \
95 win/amd64/ASMAtomicBitTestAndToggle.asm \
96 win/amd64/ASMAtomicBitToggle.asm \
97 win/amd64/ASMAtomicReadU64.asm \
98 win/amd64/ASMAtomicXchgU16.asm \
99 win/amd64/ASMAtomicXchgU8.asm \
100 win/amd64/ASMBitFirstClear.asm \
101 win/amd64/ASMBitFirstSet.asm \
102 win/amd64/ASMGetCS.asm \
103 win/amd64/ASMGetDS.asm \
104 win/amd64/ASMGetES.asm \
105 win/amd64/ASMGetFlags.asm \
106 win/amd64/ASMGetFS.asm \
107 win/amd64/ASMGetGS.asm \
108 win/amd64/ASMGetIDTR.asm \
109 win/amd64/ASMGetGDTR.asm \
110 win/amd64/ASMGetTR.asm \
111 win/amd64/ASMGetSS.asm \
112 win/amd64/ASMProbeReadByte.asm \
113 win/amd64/ASMSetFlags.asm \
114 win/amd64/ASMGetDR0.asm \
115 win/amd64/ASMGetDR1.asm \
116 win/amd64/ASMGetDR2.asm \
117 win/amd64/ASMGetDR3.asm \
118 win/amd64/ASMGetDR6.asm \
119 win/amd64/ASMGetDR7.asm \
120 common/asm/ASMMultU64ByU32DivByU32.asm
121
122#
123# Win32 assembly sources.
124#
125RuntimeWin32ASM_SOURCES = \
126 common/asm/ASMMultU64ByU32DivByU32.asm
127
128#
129# RuntimeR3 - Static Runtime for Ring-3 executables.
130#
131RuntimeR3_TEMPLATE = VBOXR3EXE
132RuntimeR3_SDKS.win = WINPSDK W2K3DDK
133RuntimeR3_DEFS = IN_RT_R3 IN_SUP_R3 LDR_WITH_NATIVE LDR_WITH_ELF32 LDR_WITH_PE RT_WITH_VBOX
134ifdef IPRT_WITH_KSTUFF
135 RuntimeR3_DEFS += LDR_WITH_KLDR
136endif
137ifdef VBOX_MAIN_RELEASE_LOG ## @todo (dmik): temporary, until RTThreadSelf/RTThreadAdopt are properly updated
138 RuntimeR3_DEFS += RTCRITSECT_STRICT
139endif
140RuntimeR3_INCS = \
141 include \
142 $(PATH_ROOT)/src/libs/liblzf-1.51
143ifdef IPRT_WITH_KSTUFF
144 RuntimeR3_INCS += \
145 $(PATH_ROOT)/src/libs/kStuff/kStuff/include
146endif
147RuntimeR3_INCS.l4 = \
148 $(L4_INCDIR)
149# for iconv.h
150RuntimeR3_INCS.freebsd = \
151 /usr/local/include
152
153
154# RuntimeR3_INCS.solaris = \
155# /usr/include
156
157RuntimeR3_SOURCES = \
158 common/alloc/alloc.cpp \
159 common/alloc/heapsimple.cpp \
160 common/checksum/crc32.cpp \
161 common/checksum/crc64.cpp \
162 common/checksum/md5.cpp \
163 common/err/errmsg.cpp \
164 common/err/RTErrConvertFromErrno.cpp \
165 common/ldr/ldr.cpp \
166 common/ldr/ldrELF.cpp \
167 common/ldr/ldrEx.cpp \
168 common/ldr/ldrFile.cpp \
169 common/ldr/ldrNative.cpp \
170 common/ldr/ldrPE.cpp \
171 common/log/log.cpp \
172 common/log/logcom.cpp \
173 common/log/logformat.cpp \
174 common/misc/assert.cpp \
175 common/misc/cidr.cpp \
176 common/misc/getopt.cpp \
177 common/misc/rand.cpp \
178 common/misc/req.cpp \
179 common/misc/sanity-c.c \
180 common/misc/sanity-cpp.cpp \
181 common/misc/semspingpong.cpp \
182 common/misc/thread.cpp \
183 common/misc/zip.cpp \
184 common/string/straprintf.cpp \
185 common/string/strformat.cpp \
186 common/string/strformatrt.cpp \
187 common/string/strformattype.cpp \
188 common/string/string.cpp \
189 common/string/strprintf.cpp \
190 common/string/strspace.cpp \
191 common/string/strstrip.cpp \
192 common/string/strtonum.cpp \
193 common/string/uni.cpp \
194 common/string/unidata.cpp \
195 common/string/utf-16.cpp \
196 common/string/utf-8.cpp \
197 common/table/avlgcptr.cpp \
198 common/table/avlhcphys.cpp \
199 common/table/avllu32.cpp \
200 common/table/avlou32.cpp \
201 common/table/avlogcphys.cpp \
202 common/table/avlogcptr.cpp \
203 common/table/avlohcphys.cpp \
204 common/table/avloioport.cpp \
205 common/table/avlpv.cpp \
206 common/table/avlrgcptr.cpp \
207 common/table/avlrogcphys.cpp \
208 common/table/avlrogcptr.cpp \
209 common/table/avlroioport.cpp \
210 common/table/avlroogcptr.cpp \
211 common/table/avlu32.cpp \
212 common/table/avlul.cpp \
213 common/table/table.cpp \
214 common/time/time.cpp \
215 common/time/timeprog.cpp \
216 common/time/timesup.cpp \
217 generic/critsect-generic.cpp \
218 generic/env-generic.cpp \
219 generic/RTFileCopy-generic.cpp \
220 generic/RTFileReadAll-generic.cpp \
221 generic/RTFileReadAllEx-generic.cpp \
222 generic/RTFileReadAllByHandle-generic.cpp \
223 generic/RTFileReadAllByHandleEx-generic.cpp \
224 generic/RTFileReadAllFree-generic.cpp \
225 generic/RTLogWriteStdErr-generic.cpp \
226 generic/RTLogWriteStdOut-generic.cpp \
227 generic/RTLogWriteUser-generic.cpp \
228 generic/semfastmutex-generic.cpp \
229 generic/spinlock-generic.cpp \
230 r3/alloc-ef.cpp \
231 r3/alloc.cpp \
232 r3/dir.cpp \
233 r3/fileio.cpp \
234 r3/fs.cpp \
235 r3/init.cpp \
236 r3/path.cpp \
237 r3/process.cpp \
238 r3/stream.cpp \
239 r3/tcp.cpp
240
241#if1of ($(KBUILD_TARGET_ARCH),amd64 x86)
242# RuntimeR3_SOURCES += common/time/timesupA.asm
243#else
244 RuntimeR3_SOURCES += common/time/timesupref.cpp
245#endif
246
247ifdef IPRT_WITH_KSTUFF
248 RuntimeR3_SOURCES += \
249 common/ldr/ldrkStuff.cpp
250endif
251
252# VBox specific stuff.
253RuntimeR3_SOURCES += \
254 VBox/strformat-vbox.cpp \
255 VBox/RTAssertDoBreakpoint-vbox.cpp \
256 VBox/log-vbox.cpp
257ifneq ($(KBUILD_TARGET),win)
258RuntimeR3_SOURCES += \
259 common/err/errmsgxpcom.cpp
260endif
261
262RuntimeR3_SOURCES.win = \
263 generic/rand-stubs-generic.cpp \
264 generic/RTDirQueryInfo-generic.cpp \
265 generic/RTDirSetTimes-generic.cpp \
266 generic/semnoint-generic.cpp \
267 generic/semsrw-generic.cpp \
268 nt/RTErrConvertFromNtStatus.cpp \
269 r3/posix/env-posix.cpp \
270 r3/win/alloc-win.cpp \
271 r3/win/dir-win.cpp \
272 r3/win/fileio-win.cpp \
273 r3/win/fs-win.cpp \
274 r3/win/ldrNative-win.cpp \
275 r3/win/mp-win.cpp \
276 r3/win/path-win.cpp \
277 r3/win/process-win.cpp \
278 r3/win/RTLogWriteDebugger-win.cpp \
279 r3/win/sched-win.cpp \
280 r3/win/sems-win.cpp \
281 r3/win/system-win.cpp \
282 r3/win/thread-win.cpp \
283 r3/win/time-win.cpp \
284 r3/win/timer-win.cpp \
285 r3/win/tls-win.cpp \
286 r3/win/utf16locale-win.cpp \
287 r3/win/utf8-win.cpp \
288 r3/win/uuid-win.cpp \
289 win/errmsgwin.cpp \
290 win/RTErrConvertFromWin32.cpp
291
292RuntimeR3_SOURCES.win.amd64 = $(RuntimeWin64ASM_SOURCES)
293RuntimeR3_SOURCES.win.x86 = $(RuntimeWin32ASM_SOURCES)
294
295RuntimeR3_SOURCES.linux = \
296 generic/pathhost-generic.cpp \
297 generic/RTDirQueryInfo-generic.cpp \
298 generic/RTDirSetTimes-generic.cpp \
299 generic/RTFileMove-generic.cpp \
300 generic/RTLogWriteDebugger-generic.cpp \
301 generic/RTTimeLocalNow-generic.cpp \
302 generic/RTTimerCreate-generic.cpp \
303 generic/utf16locale-generic.cpp \
304 generic/uuid-generic.cpp \
305 r3/linux/sched-linux.cpp \
306 r3/linux/time-linux.cpp \
307 r3/posix/alloc-posix.cpp \
308 r3/posix/dir-posix.cpp \
309 r3/posix/env-posix.cpp \
310 r3/posix/fileio-posix.cpp \
311 r3/posix/filelock-posix.cpp \
312 r3/posix/fs-posix.cpp \
313 r3/posix/ldrNative-posix.cpp \
314 r3/posix/path-posix.cpp \
315 r3/posix/process-posix.cpp \
316 r3/posix/rand-posix.cpp \
317 r3/posix/RTMpGetCount-posix.cpp \
318 r3/posix/RTTimeNow-posix.cpp \
319 r3/posix/semrw-posix.cpp \
320 r3/posix/system-posix.cpp \
321 r3/posix/thread-posix.cpp \
322 r3/posix/timelocal-posix.cpp \
323 r3/posix/timer-posix.cpp \
324 r3/posix/tls-posix.cpp \
325 r3/posix/utf8-posix.cpp
326RuntimeR3_SOURCES.linux.x86 += \
327 r3/posix/semevent-posix.cpp \
328 r3/posix/semeventmulti-posix.cpp \
329 r3/posix/semmutex-posix.cpp
330RuntimeR3_SOURCES.linux.amd64 += \
331 r3/linux/semevent-linux.cpp \
332 r3/linux/semeventmulti-linux.cpp
333ifdef RT_NEW_LINUX_MUTEX_CODE
334 RuntimeR3_SOURCES.linux.amd64 += \
335 r3/linux/semmutex-linux.cpp
336else
337 RuntimeR3_SOURCES.linux.amd64 += \
338 r3/posix/semmutex-posix.cpp
339endif
340
341RuntimeR3_SOURCES.os2 = \
342 generic/pathhost-generic.cpp \
343 generic/rand-stubs-generic.cpp \
344 generic/RTDirQueryInfo-generic.cpp \
345 generic/RTDirSetTimes-generic.cpp \
346 generic/RTFileMove-generic.cpp \
347 generic/RTLogWriteDebugger-generic.cpp \
348 generic/RTTimeLocalNow-generic.cpp \
349 generic/RTTimerCreate-generic.cpp \
350 generic/semnoint-generic.cpp \
351 generic/semsrw-generic.cpp \
352 generic/timer-generic.cpp \
353 generic/utf16locale-generic.cpp \
354 generic/uuid-generic.cpp \
355 os2/RTErrConvertFromOS2.cpp \
356 r3/os2/filelock-os2.cpp \
357 r3/os2/mp-os2.cpp \
358 r3/os2/sched-os2.cpp \
359 r3/os2/sems-os2.cpp \
360 r3/os2/system-os2.cpp \
361 r3/os2/thread-os2.cpp \
362 r3/os2/time-os2.cpp \
363 r3/posix/alloc-posix.cpp \
364 r3/posix/dir-posix.cpp \
365 r3/posix/env-posix.cpp \
366 r3/posix/fileio-posix.cpp \
367 r3/posix/fs-posix.cpp \
368 r3/posix/ldrNative-posix.cpp \
369 r3/posix/path-posix.cpp \
370 r3/posix/process-posix.cpp \
371 r3/posix/RTTimeNow-posix.cpp \
372 r3/posix/timelocal-posix.cpp \
373 r3/posix/utf8-posix.cpp
374
375RuntimeR3_SOURCES.darwin = \
376 darwin/RTErrConvertFromDarwin.cpp \
377 darwin/RTErrConvertFromDarwinCOM.cpp \
378 darwin/RTErrConvertFromDarwinIO.cpp \
379 darwin/RTErrConvertFromDarwinKern.cpp \
380 generic/pathhost-generic.cpp \
381 generic/RTDirQueryInfo-generic.cpp \
382 generic/RTDirSetTimes-generic.cpp \
383 generic/RTFileMove-generic.cpp \
384 generic/RTLogWriteDebugger-generic.cpp \
385 generic/RTTimeLocalNow-generic.cpp \
386 generic/RTTimerCreate-generic.cpp \
387 generic/sched-generic.cpp \
388 generic/timer-generic.cpp \
389 generic/utf16locale-generic.cpp \
390 generic/uuid-generic.cpp\
391 r3/darwin/alloc-darwin.cpp \
392 r3/darwin/filelock-darwin.cpp \
393 r3/darwin/time-darwin.cpp \
394 r3/posix/dir-posix.cpp \
395 r3/posix/env-posix.cpp \
396 r3/posix/fileio-posix.cpp \
397 r3/posix/fs-posix.cpp \
398 r3/posix/ldrNative-posix.cpp \
399 r3/posix/path-posix.cpp \
400 r3/posix/process-posix.cpp \
401 r3/posix/RTMpGetCount-posix.cpp \
402 r3/posix/rand-posix.cpp \
403 r3/posix/semevent-posix.cpp \
404 r3/posix/semeventmulti-posix.cpp \
405 r3/posix/semmutex-posix.cpp \
406 r3/posix/semrw-posix.cpp \
407 r3/posix/system-posix.cpp \
408 r3/posix/thread-posix.cpp \
409 r3/posix/timelocal-posix.cpp \
410 r3/posix/tls-posix.cpp \
411 r3/posix/utf8-posix.cpp
412
413## @todo Make BSD sched.
414RuntimeR3_SOURCES.freebsd = \
415 generic/pathhost-generic.cpp \
416 generic/RTDirQueryInfo-generic.cpp \
417 generic/RTDirSetTimes-generic.cpp \
418 generic/RTFileMove-generic.cpp \
419 generic/RTLogWriteDebugger-generic.cpp \
420 generic/RTTimeLocalNow-generic.cpp \
421 generic/RTTimerCreate-generic.cpp \
422 generic/sched-generic.cpp \
423 generic/utf16locale-generic.cpp \
424 generic/uuid-generic.cpp \
425 r3/freebsd/alloc-freebsd.cpp \
426 r3/posix/dir-posix.cpp \
427 r3/posix/env-posix.cpp \
428 r3/posix/fileio-posix.cpp \
429 r3/posix/filelock-posix.cpp \
430 r3/posix/fs-posix.cpp \
431 r3/posix/ldrNative-posix.cpp \
432 r3/posix/path-posix.cpp \
433 r3/posix/process-posix.cpp \
434 r3/posix/rand-posix.cpp \
435 r3/posix/RTMpGetCount-posix.cpp \
436 r3/posix/RTTimeNow-posix.cpp \
437 r3/posix/semevent-posix.cpp \
438 r3/posix/semeventmulti-posix.cpp \
439 r3/posix/semmutex-posix.cpp \
440 r3/posix/semrw-posix.cpp \
441 r3/posix/system-posix.cpp \
442 r3/posix/thread-posix.cpp \
443 r3/posix/time-posix.cpp \
444 r3/posix/timelocal-posix.cpp \
445 r3/posix/timer-posix.cpp \
446 r3/posix/tls-posix.cpp \
447 r3/posix/utf8-posix.cpp
448
449RuntimeR3_SOURCES.solaris = \
450 generic/pathhost-generic.cpp \
451 generic/RTDirQueryInfo-generic.cpp \
452 generic/RTDirSetTimes-generic.cpp \
453 generic/RTFileMove-generic.cpp \
454 generic/RTLogWriteDebugger-generic.cpp \
455 generic/RTTimeLocalNow-generic.cpp \
456 generic/RTTimerCreate-generic.cpp \
457 generic/sched-generic.cpp \
458 generic/utf16locale-generic.cpp \
459 generic/uuid-generic.cpp \
460 r3/posix/dir-posix.cpp \
461 r3/posix/env-posix.cpp \
462 r3/posix/fileio-posix.cpp \
463 r3/posix/filelock-posix.cpp \
464 r3/posix/fs-posix.cpp \
465 r3/posix/ldrNative-posix.cpp \
466 r3/posix/path-posix.cpp \
467 r3/posix/process-posix.cpp \
468 r3/posix/rand-posix.cpp \
469 r3/posix/RTMpGetCount-posix.cpp \
470 r3/posix/RTTimeNow-posix.cpp \
471 r3/posix/semevent-posix.cpp \
472 r3/posix/semeventmulti-posix.cpp \
473 r3/posix/semmutex-posix.cpp \
474 r3/posix/semrw-posix.cpp \
475 r3/posix/system-posix.cpp \
476 r3/posix/thread-posix.cpp \
477 r3/posix/time-posix.cpp \
478 r3/posix/timelocal-posix.cpp \
479 r3/posix/timer-posix.cpp \
480 r3/posix/tls-posix.cpp \
481 r3/posix/utf8-posix.cpp \
482 r3/solaris/alloc-solaris.cpp
483
484## PORTME: Porters add their selection of platform specific files for Ring-3 here.
485
486
487#
488# L4 RuntimeR3 subtarget since L4 headers won't work with VBOXR3.
489#
490RuntimeR3L4_TEMPLATE = VBOXR3NP
491RuntimeR3L4_DEFS = IN_RT_R3 IN_SUP_R3 LDR_WITH_NATIVE LDR_WITH_ELF LDR_WITH_PE
492ifneq ($(KBUILD_TARGET_ARCH),amd64)
493RuntimeR3L4_DEFS += __PIC__
494endif
495RuntimeR3L4_INCS = \
496 include \
497 $(L4_INCDIR)
498
499RuntimeR3L4_SOURCES = \
500 generic/fs-stubs-generic.cpp \
501 generic/pathhost-generic.cpp \
502 generic/RTDirQueryInfo-generic.cpp \
503 generic/RTDirSetTimes-generic.cpp \
504 generic/RTFileMove-generic.cpp \
505 generic/RTLogWriteDebugger-generic.cpp \
506 generic/RTTimeLocalNow-generic.cpp \
507 generic/sched-generic.cpp \
508 generic/semnoint-generic.cpp \
509 generic/semsrw-generic.cpp \
510 generic/utf16locale-generic.cpp \
511 generic/uuid-generic.cpp \
512 l4/l4-errno.cpp \
513 l4/process-l4env.cpp \
514 l4/sems-l4env.cpp \
515 l4/system-l4env.cpp \
516 l4/thread-l4env.cpp \
517 l4/timer-l4env.cpp \
518 l4/utf8-l4env.cpp \
519 r3/posix/alloc-posix.cpp \
520 r3/posix/dir-posix.cpp \
521 r3/posix/env-posix.cpp \
522 r3/posix/fileio-posix.cpp \
523 r3/posix/filelock-posix.cpp \
524 r3/posix/ldrNative-posix.cpp \
525 r3/posix/path-posix.cpp \
526 r3/posix/rand-posix.cpp \
527 r3/posix/RTTimeNow-posix.cpp \
528 r3/posix/time-posix.cpp \
529 r3/posix/timelocal-posix.cpp
530
531
532#
533# RuntimeGuestR3 - Guest Additions Runtime (static).
534# (The KBUILD_HOST inheritance here is for l4 cross building the linux
535# additions, while .x86 is for cross building x86 while targeting amd64.)
536#
537RuntimeGuestR3_TEMPLATE := VBOXGUESTR3LIB
538## @todo change this to EXTEND the RuntimeR3 target.
539RuntimeGuestR3_SDKS.win := $(RuntimeR3_SDKS.win)
540RuntimeGuestR3_DEFS := $(filter-out RTCRITSECT_STRICT, $(RuntimeR3_DEFS))
541RuntimeGuestR3_DEFS.$(KBUILD_TARGET) := $(RuntimeR3_DEFS.$(KBUILD_TARGET))
542RuntimeGuestR3_DEFS.$(KBUILD_HOST) := $(RuntimeR3_DEFS.$(KBUILD_HOST))
543RuntimeGuestR3_INCS := $(RuntimeR3_INCS)
544RuntimeGuestR3_INCS.$(KBUILD_TARGET) := $(RuntimeR3_INCS.$(KBUILD_TARGET))
545RuntimeGuestR3_INCS.$(KBUILD_HOST) := $(RuntimeR3_INCS.$(KBUILD_HOST))
546RuntimeGuestR3_SOURCES := $(filter-out \
547 common/time/timesupref.cpp \
548 common/time/timesupA.asm \
549 common/time/timesup.cpp \
550 generic/RTLogWriteUser-generic.cpp \
551 , $(RuntimeR3_SOURCES))
552RuntimeGuestR3_SOURCES += \
553 common/time/timesysalias.cpp \
554 VBox/logbackdoor.cpp
555RuntimeGuestR3_SOURCES.$(KBUILD_TARGET) := $(RuntimeR3_SOURCES.$(KBUILD_TARGET))
556RuntimeGuestR3_SOURCES.$(KBUILD_HOST) := $(RuntimeR3_SOURCES.$(KBUILD_HOST))
557RuntimeGuestR3_SOURCES.$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH) := $(RuntimeR3_SOURCES.$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH))
558RuntimeGuestR3_SOURCES.$(KBUILD_HOST).$(KBUILD_TARGET_ARCH) := $(RuntimeR3_SOURCES.$(KBUILD_HOST).$(KBUILD_TARGET_ARCH))
559
560
561#
562# RuntimeGuestR3Mini - Minimal Guest Additions Runtime which does not require
563# initialization and can be linked into an .so. Intended
564# for X11 drivers, GRADD and similar.
565#
566RuntimeGuestR3Mini_TEMPLATE := VBOXGUESTR3DLL
567## @todo change this to EXTEND the RuntimeGuestR3 target.
568RuntimeGuestR3Mini_INST := $(INST_ADDITIONS_LIB)
569RuntimeGuestR3Mini_SDKS.win := $(RuntimeR3_SDKS.win)
570RuntimeGuestR3Mini_DEFS := $(filter-out RTCRITSECT_STRICT, $(RuntimeR3_DEFS)) RT_MINI
571RuntimeGuestR3Mini_DEFS.$(KBUILD_TARGET) := $(RuntimeR3_DEFS.$(KBUILD_TARGET))
572RuntimeGuestR3Mini_DEFS.$(KBUILD_HOST) := $(RuntimeR3_DEFS.$(KBUILD_HOST))
573RuntimeGuestR3Mini_INCS := $(RuntimeR3_INCS)
574RuntimeGuestR3Mini_INCS.$(KBUILD_TARGET) := $(RuntimeR3_INCS.$(KBUILD_TARGET))
575RuntimeGuestR3Mini_INCS.$(KBUILD_HOST) := $(RuntimeR3_INCS.$(KBUILD_HOST))
576RuntimeGuestR3Mini_SOURCES = \
577 common/err/errmsg.cpp \
578 common/err/RTErrConvertFromErrno.cpp \
579 common/log/logformat.cpp \
580 common/misc/assert.cpp \
581 common/misc/sanity-c.c \
582 common/misc/sanity-cpp.cpp \
583 common/string/strformat.cpp \
584 common/string/strformatrt.cpp \
585 common/string/strformattype.cpp \
586 common/string/string.cpp \
587 common/string/strprintf.cpp \
588 common/string/unidata.cpp \
589 common/string/utf-8.cpp \
590 common/string/utf-16.cpp \
591 generic/pathhost-generic.cpp \
592 generic/RTAssertDoBreakpoint-generic.cpp \
593 r3/alloc.cpp \
594 r3/fileio.cpp \
595 r3/fs.cpp \
596 r3/path.cpp
597RuntimeGuestR3Mini_SOURCES.linux = \
598 r3/posix/fileio-posix.cpp \
599 r3/posix/path-posix.cpp \
600 r3/posix/utf8-posix.cpp
601RuntimeGuestR3Mini_SOURCES.solaris = \
602 r3/posix/fileio-posix.cpp \
603 r3/posix/path-posix.cpp \
604 r3/posix/utf8-posix.cpp
605RuntimeGuestR3Mini_SOURCES.freebsd = \
606 r3/posix/fileio-posix.cpp \
607 r3/posix/path-posix.cpp \
608 r3/posix/utf8-posix.cpp
609# VBox specific stuff.
610RuntimeGuestR3Mini_SOURCES += \
611 VBox/logbackdoor.cpp \
612 VBox/logbackdoor-redirect.cpp \
613 VBox/strformat-vbox.cpp
614
615
616#
617# RuntimeLnxHostR3 Linux host program runtime
618# (Only used when building L4.)
619#
620RuntimeLnxHostR3_TEMPLATE = VBOXLNXHOSTR3LIB
621RuntimeLnxHostR3_DEFS = IN_RT_R3 IN_SUP_R3 RT_WITH_VBOX RT_NO_GIP
622RuntimeLnxHostR3_SOURCES = \
623 $(RuntimeR3_SOURCES.linux.$(KBUILD_TARGET_ARCH)) \
624 $(RuntimeR3_SOURCES.linux) \
625 $(RuntimeR3_SOURCES)
626RuntimeLnxHostR3_INCS = \
627 $(RuntimeR3_INCS.linux.$(KBUILD_TARGET_ARCH)) \
628 $(RuntimeR3_INCS.linux) \
629 $(RuntimeR3_INCS)
630
631
632#
633# VBoxRT - Shared Object / DLL version.
634#
635VBoxRT_TEMPLATE = VBOXR3
636VBoxRT_SDKS.win = WINPSDK W2K3DDK VBOX_NTDLL
637ifeq ($(KBUILD_TARGET),darwin)
638VBoxRT_INST = $(INST_DLL) $(INST_TESTCASE)
639endif
640VBoxRT_DEFS = $(RuntimeR3_DEFS) IN_SUP_R3 IN_SUP_R3
641VBoxRT_DEFS.$(KBUILD_TYPE) = $(RuntimeR3_DEFS.$(KBUILD_TYPE))
642VBoxRT_SOURCES = \
643 VBox/VBoxRTDeps.cpp \
644 $(RuntimeR3_SOURCES)
645VBoxRT_SOURCES.$(KBUILD_TARGET) = $(RuntimeR3_SOURCES.$(KBUILD_TARGET))
646VBoxRT_SOURCES.$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH) = $(RuntimeR3_SOURCES.$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH))
647VBoxRT_SOURCES.win += r3/win/dllmain-win.cpp
648VBoxRT_SOURCES.win.x86 += r3/win/VBoxRT-win32.def
649VBoxRT_SOURCES.win.amd64 += r3/win/VBoxRT-win64.def
650VBoxRT_INCS = $(RuntimeR3_INCS)
651VBoxRT_INCS.$(KBUILD_TARGET) = $(RuntimeR3_INCS.$(KBUILD_TARGET))
652VBoxRT_INCS.$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH) = $(RuntimeR3_INCS.$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH))
653VBoxRT_LIBS = \
654 $(PATH_LIB)/SUPR3$(VBOX_SUFF_LIB) \
655 $(PATH_LIB)/VBox-liblzf$(VBOX_SUFF_LIB)
656ifdef IPRT_WITH_KSTUFF
657 VBoxRT_LIBS += \
658 $(PATH_LIB)/VBox-kStuff$(VBOX_SUFF_LIB)
659endif
660VBoxRT_LIBS.darwin = \
661 iconv
662VBoxRT_LIBS.freebsd = \
663 iconv
664VBoxRT_LIBPATH.freebsd = \
665 /usr/local/lib
666VBoxRT_LDFLAGS.darwin = -framework IOKit -install_name @executable_path/VBoxRT.dylib
667ifdef VBOX_USE_VCC80
668VBoxRT_LDFLAGS.win = /MANIFEST
669endif
670VBoxRT_LDFLAGS.l4 = \
671 -Wl,-whole-archive \
672 $(PATH_LIB)/RuntimeR3L4$(VBOX_SUFF_LIB) \
673 -Wl,-no-whole-archive
674ifeq ($(KBUILD_TARGET),l4)
675VBoxRT_LIBS += \
676 $(L4_LIBDIR)/libl4sys.a \
677 $(L4_LIBDIR)/libl4sys.p.a
678endif
679VBoxRT_LIBS.l4 = \
680 $(PATH_LIB)/RuntimeR3L4$(VBOX_SUFF_LIB)
681
682
683#
684# RuntimeR3NoCRTGCC - CRT replacement lib for VBoxREM.
685# This is used together with VBoxRT.
686#
687RuntimeR3NoCRTGCC_TEMPLATE = VBOXNOCRTGCC
688RuntimeR3NoCRTGCC_LIBSUFF = $(VBOX_SUFF_LIB)
689RuntimeR3NoCRTGCC_INCS = include
690RuntimeR3NoCRTGCC_SOURCES = \
691 common/misc/sanity-cpp.cpp \
692 common/misc/sanity-c.c \
693 \
694 common/math/ceill.asm \
695 common/math/cosl.asm \
696 common/math/fabs.asm \
697 common/math/fabsf.asm \
698 common/math/fabsl.asm \
699 common/math/floor.asm \
700 common/math/floorf.asm \
701 common/math/floorl.asm \
702 common/math/ldexpl.asm \
703 common/math/llrint.asm \
704 common/math/llrintf.asm \
705 common/math/llrintl.asm \
706 common/math/logl.asm \
707 common/math/lrint.asm \
708 common/math/lrintf.asm \
709 common/math/lrintl.asm \
710 common/math/remainder.asm \
711 common/math/remainderf.asm \
712 common/math/remainderl.asm \
713 common/math/sinl.asm \
714 common/math/tanl.asm \
715 common/math/trunc.asm \
716 common/math/truncf.asm \
717 common/math/truncl.asm \
718 \
719 common/misc/setjmp.asm \
720 \
721 common/string/memchr.asm \
722 common/string/memchr_alias.c \
723 common/string/memcmp.asm \
724 common/string/memcmp_alias.c \
725 common/string/memcpy.asm \
726 common/string/memcpy_alias.c \
727 common/string/mempcpy.asm \
728 common/string/memmove.asm \
729 common/string/memmove_alias.c \
730 common/string/memset.asm \
731 common/string/memset_alias.c \
732 common/string/strchr.asm \
733 common/string/strchr_alias.c \
734 common/string/strcmp.asm \
735 common/string/strcmp_alias.c \
736 common/string/strlen.asm \
737 common/string/strlen_alias.c
738
739RuntimeR3NoCRTGCC_SOURCES.x86 = \
740 common/math/x86/fenv-x86.c \
741 common/math/gcc/adddi3.c \
742 common/math/gcc/anddi3.c \
743 common/math/gcc/ashldi3.c \
744 common/math/gcc/ashrdi3.c \
745 common/math/gcc/cmpdi2.c \
746 common/math/gcc/divdi3.c \
747 common/math/gcc/iordi3.c \
748 common/math/gcc/lshldi3.c \
749 common/math/gcc/lshrdi3.c \
750 common/math/gcc/moddi3.c \
751 common/math/gcc/muldi3.c \
752 common/math/gcc/negdi2.c \
753 common/math/gcc/notdi2.c \
754 common/math/gcc/qdivrem.c \
755 common/math/gcc/subdi3.c \
756 common/math/gcc/ucmpdi2.c \
757 common/math/gcc/udivdi3.c \
758 common/math/gcc/umoddi3.c \
759 common/math/gcc/xordi3.c
760
761
762## @todo stop using the old memcpy.c and memset.c code.
763
764#
765# RuntimeR0 - Ring0 library for VMMR0.
766#
767RuntimeR0_TEMPLATE = VBOXR0
768RuntimeR0_DEFS = IN_RT_R0 RT_WITH_VBOX RT_WITHOUT_NOCRT_WRAPPERS
769RuntimeR0_INCS = include
770RuntimeR0_SOURCES = \
771 common/log/logcom.cpp \
772 common/log/logformat.cpp \
773 common/misc/assert.cpp \
774 common/misc/sanity-c.c \
775 common/misc/sanity-cpp.cpp \
776 common/string/memchr.cpp \
777 common/string/memcmp.cpp \
778 common/string/memcpy.cpp \
779 common/string/memmove.asm \
780 common/string/memset.cpp \
781 common/string/strcmp.asm \
782 common/string/strcpy.cpp \
783 common/string/strformat.cpp \
784 common/string/strformatrt.cpp \
785 common/string/strformattype.cpp \
786 common/string/strlen.asm \
787 common/string/strncmp.cpp \
788 common/string/strpbrk.cpp \
789 common/string/strprintf.cpp \
790 common/table/avlgcptr.cpp \
791 common/table/avlhcphys.cpp \
792 common/table/avllu32.cpp \
793 common/table/avlogcphys.cpp \
794 common/table/avlogcptr.cpp \
795 common/table/avlohcphys.cpp \
796 common/table/avloioport.cpp \
797 common/table/avlpv.cpp \
798 common/table/avlrogcphys.cpp \
799 common/table/avlrogcptr.cpp \
800 common/table/avlroioport.cpp \
801 common/table/avlroogcptr.cpp \
802 common/table/avlu32.cpp \
803 common/time/timesup.cpp \
804 generic/RTAssertDoBreakpoint-generic.cpp \
805 VBox/strformat-vbox.cpp
806
807#if1of ($(KBUILD_TARGET_ARCH),amd64 x86)
808# RuntimeR0_SOURCES += common/time/timesupA.asm
809#else
810 RuntimeR0_SOURCES += common/time/timesupref.cpp
811#endif
812
813RuntimeR0_SOURCES.win.amd64 = $(RuntimeWin64ASM_SOURCES)
814RuntimeR0_SOURCES.win.x86 = $(RuntimeWin32ASM_SOURCES)
815
816RuntimeR0_SOURCES.os2 = \
817 os2/RTErrConvertFromOS2.cpp \
818 os2/sys0.asm
819
820ifeq ($(filter-out darwin solaris freebsd,$(KBUILD_TARGET)),)
821RuntimeR0_SOURCES += \
822 common/math/gcc/adddi3.c \
823 common/math/gcc/anddi3.c \
824 common/math/gcc/ashldi3.c \
825 common/math/gcc/ashrdi3.c \
826 common/math/gcc/cmpdi2.c \
827 common/math/gcc/divdi3.c \
828 common/math/gcc/iordi3.c \
829 common/math/gcc/lshldi3.c \
830 common/math/gcc/lshrdi3.c \
831 common/math/gcc/moddi3.c \
832 common/math/gcc/muldi3.c \
833 common/math/gcc/negdi2.c \
834 common/math/gcc/notdi2.c \
835 common/math/gcc/qdivrem.c \
836 common/math/gcc/subdi3.c \
837 common/math/gcc/ucmpdi2.c \
838 common/math/gcc/udivdi3.c \
839 common/math/gcc/umoddi3.c \
840 common/math/gcc/xordi3.c
841endif
842
843
844common/string/memchr.cpp_CXXFLAGS.win = -Oi-
845common/string/memcmp.cpp_CXXFLAGS.win = -Oi-
846common/string/memcpy.cpp_CXXFLAGS.win = -Oi-
847common/string/memset.cpp_CXXFLAGS.win = -Oi-
848common/string/strcpy.cpp_CXXFLAGS.win = -Oi-
849common/string/strlen.cpp_CXXFLAGS.win = -Oi-
850
851#
852# RuntimeR0Drv - Ring0 library for host drivers.
853#
854RuntimeR0Drv_TEMPLATE = VBOXR0DRV
855RuntimeR0Drv_SDKS.win = W2K3DDK WINPSDKINCS
856RuntimeR0Drv_INCS := $(PATH_SUB_CURRENT) include
857RuntimeR0Drv_DEFS = IN_RT_R0 RT_WITH_VBOX RT_WITHOUT_NOCRT_WRAPPERS
858RuntimeR0Drv_DEFS.win = IN_SUP_R0
859RuntimeR0Drv_DEFS.linux = MODULE KBUILD_MODNAME=KBUILD_STR\(vboxdrv\) KBUILD_BASENAME=KBUILD_STR\(vboxdrv\) IN_SUP_R0 # why is IN_SUP_R0 here? because!
860
861RuntimeR0Drv_INCS.linux = \
862 r0drv/linux
863ifdef VBOX_WITH_SOLARIS_VBI
864 RuntimeR0Drv_INCS.solaris = \
865 r0drv/solaris/vbi/i86pc
866endif
867
868RuntimeR0Drv_SOURCES = \
869 common/checksum/crc32.cpp \
870 common/checksum/crc64.cpp \
871 common/log/log.cpp \
872 common/log/logcom.cpp \
873 common/log/logformat.cpp \
874 common/misc/assert.cpp \
875 common/misc/sanity-c.c \
876 common/misc/sanity-cpp.cpp \
877 common/string/strformat.cpp \
878 common/string/strformatrt.cpp \
879 common/string/strformattype.cpp \
880 common/string/strprintf.cpp \
881 common/string/strtonum.cpp \
882 common/table/avlpv.cpp \
883 generic/RTLogWriteStdErr-stub-generic.cpp \
884 generic/RTLogWriteStdOut-stub-generic.cpp \
885 generic/RTLogWriteUser-generic.cpp \
886 r0drv/alloc-r0drv.cpp \
887 r0drv/initterm-r0drv.cpp \
888 VBox/log-vbox.cpp \
889 VBox/strformat-vbox.cpp
890
891RuntimeR0Drv_SOURCES.linux = \
892 common/alloc/heapsimple.cpp \
893 common/string/strpbrk.cpp \
894 common/err/RTErrConvertToErrno.cpp \
895 generic/RTAssertDoBreakpoint-generic.cpp \
896 r0drv/linux/alloc-r0drv-linux.c \
897 r0drv/linux/initterm-r0drv-linux.c \
898 r0drv/linux/memobj-r0drv-linux.c \
899 r0drv/linux/mp-r0drv-linux.c \
900 r0drv/linux/mpnotification-r0drv-linux.c \
901 r0drv/linux/process-r0drv-linux.c \
902 r0drv/linux/RTLogWriteDebugger-r0drv-linux.c \
903 r0drv/linux/semevent-r0drv-linux.c \
904 r0drv/linux/semeventmulti-r0drv-linux.c \
905 r0drv/linux/semfastmutex-r0drv-linux.c \
906 r0drv/linux/spinlock-r0drv-linux.c \
907 r0drv/linux/thread-r0drv-linux.c \
908 r0drv/linux/time-r0drv-linux.c \
909 r0drv/linux/timer-r0drv-linux.c \
910 r0drv/memobj-r0drv.cpp \
911 r0drv/mpnotification-r0drv.c
912## @todo thread2-r0drv-linux.c and assert-r0drv-linux.c
913
914RuntimeR0Drv_SOURCES.win = \
915 common/misc/thread.cpp \
916 common/string/memcmp.asm \
917 common/string/memchr.asm \
918 common/string/memcpy.asm \
919 common/string/memset.asm \
920 common/string/memmove.asm \
921 common/string/strlen.asm \
922 common/string/strncmp.cpp \
923 common/string/strpbrk.cpp \
924 generic/RTAssertDoBreakpoint-generic.cpp \
925 nt/RTErrConvertFromNtStatus.cpp \
926 r0drv/memobj-r0drv.cpp \
927 r0drv/mpnotification-r0drv.c \
928 r0drv/nt/alloc-r0drv-nt.cpp \
929 r0drv/nt/initterm-r0drv-nt.cpp \
930 r0drv/nt/memobj-r0drv-nt.cpp \
931 r0drv/nt/mp-r0drv-nt.cpp \
932 r0drv/nt/mpnotification-r0drv-nt.cpp \
933 r0drv/nt/process-r0drv-nt.cpp \
934 r0drv/nt/RTLogWriteDebugger-r0drv-nt.cpp \
935 r0drv/nt/semevent-r0drv-nt.cpp \
936 r0drv/nt/semeventmulti-r0drv-nt.cpp \
937 r0drv/nt/semfastmutex-r0drv-nt.cpp \
938 r0drv/nt/semmutex-r0drv-nt.cpp \
939 r0drv/nt/spinlock-r0drv-nt.cpp \
940 r0drv/nt/thread-r0drv-nt.cpp \
941 r0drv/nt/thread2-r0drv-nt.cpp \
942 r0drv/nt/time-r0drv-nt.cpp \
943 r0drv/nt/timer-r0drv-nt.cpp
944## @todo assert-r0drv-nt.cpp
945
946RuntimeR0Drv_SOURCES.win.amd64 = $(RuntimeWin64ASM_SOURCES)
947RuntimeR0Drv_SOURCES.win.x86 = $(RuntimeWin32ASM_SOURCES)
948
949RuntimeR0Drv_SOURCES.darwin = \
950 common/err/RTErrConvertFromErrno.cpp \
951 common/misc/thread.cpp \
952 common/string/memchr.asm \
953 common/string/strpbrk.cpp \
954 darwin/RTErrConvertFromDarwin.cpp \
955 darwin/RTErrConvertFromDarwinIO.cpp \
956 darwin/RTErrConvertFromDarwinKern.cpp \
957 generic/RTAssertDoBreakpoint-generic.cpp \
958 generic/RTMpCpuId-generic.cpp \
959 generic/RTMpCpuIdFromSetIndex-generic.cpp \
960 generic/RTMpCpuIdToSetIndex-generic.cpp \
961 generic/RTMpIsCpuPossible-generic.cpp \
962 generic/RTMpGetCount-generic.cpp \
963 generic/RTMpGetMaxCpuId-generic.cpp \
964 generic/RTMpGetOnlineCount-generic.cpp \
965 generic/RTMpGetOnlineSet-generic.cpp \
966 generic/RTMpGetSet-generic.cpp \
967 generic/RTMpIsCpuOnline-generic.cpp \
968 generic/RTTimerCreate-generic.cpp \
969 generic/timer-generic.cpp \
970 r0drv/generic/RTMpOn-r0drv-generic.cpp \
971 r0drv/generic/mpnotification-r0drv-generic.cpp \
972 r0drv/darwin/alloc-r0drv-darwin.cpp \
973 r0drv/darwin/assert-r0drv-darwin.cpp \
974 r0drv/darwin/initterm-r0drv-darwin.cpp \
975 r0drv/darwin/memobj-r0drv-darwin.cpp \
976 r0drv/darwin/process-r0drv-darwin.cpp \
977 r0drv/darwin/RTLogWriteDebugger-r0drv-darwin.cpp \
978 r0drv/darwin/semaphore-r0drv-darwin.cpp \
979 r0drv/darwin/spinlock-r0drv-darwin.cpp \
980 r0drv/darwin/thread-r0drv-darwin.cpp \
981 r0drv/darwin/thread2-r0drv-darwin.cpp \
982 r0drv/darwin/time-r0drv-darwin.cpp \
983 r0drv/memobj-r0drv.cpp
984
985RuntimeR0Drv_SOURCES.os2 = \
986 common/string/memchr.asm \
987 common/string/memcmp.asm \
988 common/string/memcpy.asm \
989 common/string/mempcpy.asm \
990 common/string/memmove.asm \
991 common/string/memset.asm \
992 common/string/strchr.asm \
993 common/string/strcmp.asm \
994 common/string/strlen.asm \
995 \
996 common/string/strcpy.cpp \
997 common/string/strncmp.cpp \
998 common/string/strpbrk.cpp \
999 \
1000 common/misc/thread.cpp \
1001 generic/RTLogWriteDebugger-generic.cpp \
1002 generic/RTMpCpuId-generic.cpp \
1003 generic/RTMpCpuIdFromSetIndex-generic.cpp \
1004 generic/RTMpCpuIdToSetIndex-generic.cpp \
1005 generic/RTMpIsCpuPossible-generic.cpp \
1006 generic/RTMpGetCount-generic.cpp \
1007 generic/RTMpGetMaxCpuId-generic.cpp \
1008 generic/RTMpGetOnlineCount-generic.cpp \
1009 generic/RTMpGetOnlineSet-generic.cpp \
1010 generic/RTMpGetSet-generic.cpp \
1011 generic/RTMpIsCpuOnline-generic.cpp \
1012 generic/RTTimerCreate-generic.cpp \
1013 os2/RTErrConvertFromOS2.cpp \
1014 os2/sys0.asm \
1015 r0drv/memobj-r0drv.cpp \
1016 r0drv/generic/RTMpOn-r0drv-generic.cpp \
1017 r0drv/generic/mpnotification-r0drv-generic.cpp \
1018 r0drv/os2/alloc-r0drv-os2.cpp \
1019 r0drv/os2/assert-r0drv-os2.cpp \
1020 r0drv/os2/assertA-r0drv-os2.asm \
1021 r0drv/os2/initterm-r0drv-os2.cpp \
1022 r0drv/os2/memobj-r0drv-os2.cpp \
1023 r0drv/os2/os2imports.imp \
1024 r0drv/os2/process-r0drv-os2.cpp \
1025 r0drv/os2/RTAssertDoBreakpoint-r0drv-os2.asm \
1026 r0drv/os2/RTR0Os2DHQueryDOSVar.asm \
1027 r0drv/os2/RTR0Os2DHVMGlobalToProcess.asm \
1028 r0drv/os2/semevent-r0drv-os2.cpp \
1029 r0drv/os2/semeventmulti-r0drv-os2.cpp \
1030 r0drv/os2/semfastmutex-r0drv-os2.cpp \
1031 r0drv/os2/spinlock-r0drv-os2.cpp \
1032 r0drv/os2/thread-r0drv-os2.cpp \
1033 r0drv/os2/thread2-r0drv-os2.cpp \
1034 r0drv/os2/time-r0drv-os2.cpp \
1035 r0drv/os2/timer-r0drv-os2.cpp \
1036 r0drv/os2/timerA-r0drv-os2.asm
1037
1038RuntimeR0Drv_SOURCES.freebsd = \
1039 common/err/RTErrConvertFromErrno.cpp \
1040 common/err/RTErrConvertToErrno.cpp \
1041 common/misc/thread.cpp \
1042 common/string/memchr.asm \
1043 common/string/memmove.asm \
1044 common/string/strpbrk.cpp \
1045 common/string/memcmp.asm \
1046 common/string/strchr.asm \
1047 generic/RTAssertDoBreakpoint-generic.cpp \
1048 generic/RTLogWriteDebugger-generic.cpp \
1049 generic/RTMpCpuId-generic.cpp \
1050 generic/RTMpCpuIdFromSetIndex-generic.cpp \
1051 generic/RTMpCpuIdToSetIndex-generic.cpp \
1052 generic/RTMpIsCpuPossible-generic.cpp \
1053 generic/RTMpGetCount-generic.cpp \
1054 generic/RTMpGetMaxCpuId-generic.cpp \
1055 generic/RTMpGetOnlineCount-generic.cpp \
1056 generic/RTMpGetOnlineSet-generic.cpp \
1057 generic/RTMpGetSet-generic.cpp \
1058 generic/RTMpIsCpuOnline-generic.cpp \
1059 generic/RTTimerCreate-generic.cpp \
1060 r0drv/generic/RTMpOn-r0drv-generic.cpp \
1061 r0drv/generic/mpnotification-r0drv-generic.cpp \
1062 r0drv/freebsd/alloc-r0drv-freebsd.c \
1063 r0drv/freebsd/assert-r0drv-freebsd.c \
1064 r0drv/freebsd/initterm-r0drv-freebsd.c \
1065 r0drv/freebsd/memobj-r0drv-freebsd.c \
1066 r0drv/freebsd/process-r0drv-freebsd.c \
1067 r0drv/freebsd/semevent-r0drv-freebsd.c \
1068 r0drv/freebsd/semeventmulti-r0drv-freebsd.c \
1069 r0drv/freebsd/semfastmutex-r0drv-freebsd.c \
1070 r0drv/freebsd/spinlock-r0drv-freebsd.c \
1071 r0drv/freebsd/thread-r0drv-freebsd.c \
1072 r0drv/freebsd/thread2-r0drv-freebsd.c \
1073 r0drv/freebsd/time-r0drv-freebsd.c \
1074 r0drv/freebsd/timer-r0drv-freebsd.c \
1075 r0drv/memobj-r0drv.cpp
1076
1077RuntimeR0Drv_SOURCES.solaris = \
1078 common/err/RTErrConvertFromErrno.cpp \
1079 common/misc/thread.cpp \
1080 common/string/memchr.asm \
1081 generic/RTAssertDoBreakpoint-generic.cpp \
1082 generic/RTTimerCreate-generic.cpp \
1083 r0drv/memobj-r0drv.cpp \
1084 r0drv/mpnotification-r0drv.c \
1085 r0drv/solaris/mpnotification-r0drv-solaris.c
1086
1087ifdef VBOX_WITH_SOLARIS_VBI
1088 RuntimeR0Drv_SOURCES.solaris += \
1089 r0drv/solaris/vbi/alloc-r0drv-solaris.c \
1090 r0drv/solaris/vbi/assert-r0drv-solaris.c \
1091 r0drv/solaris/vbi/initterm-r0drv-solaris.c \
1092 r0drv/solaris/vbi/memobj-r0drv-solaris.c \
1093 r0drv/solaris/vbi/mp-r0drv-solaris.c \
1094 r0drv/solaris/vbi/process-r0drv-solaris.c \
1095 r0drv/solaris/vbi/RTLogWriteDebugger-r0drv-solaris.c \
1096 r0drv/solaris/vbi/semevent-r0drv-solaris.c \
1097 r0drv/solaris/vbi/semeventmulti-r0drv-solaris.c \
1098 r0drv/solaris/vbi/semfastmutex-r0drv-solaris.c \
1099 r0drv/solaris/vbi/spinlock-r0drv-solaris.c \
1100 r0drv/solaris/vbi/thread-r0drv-solaris.c \
1101 r0drv/solaris/vbi/thread2-r0drv-solaris.c \
1102 r0drv/solaris/vbi/time-r0drv-solaris.c \
1103 r0drv/solaris/vbi/timer-r0drv-solaris.c
1104else # !VBOX_WITH_SOLARIS_VBI
1105 RuntimeR0Drv_SOURCES.solaris += \
1106 r0drv/solaris/alloc-r0drv-solaris.c \
1107 r0drv/solaris/assert-r0drv-solaris.c \
1108 r0drv/solaris/initterm-r0drv-solaris.c \
1109 r0drv/solaris/memobj-r0drv-solaris.c \
1110 r0drv/solaris/process-r0drv-solaris.c \
1111 r0drv/solaris/RTLogWriteDebugger-r0drv-solaris.c \
1112 r0drv/solaris/semevent-r0drv-solaris.c \
1113 r0drv/solaris/semeventmulti-r0drv-solaris.c \
1114 r0drv/solaris/semfastmutex-r0drv-solaris.c \
1115 r0drv/solaris/spinlock-r0drv-solaris.c \
1116 r0drv/solaris/thread-r0drv-solaris.c \
1117 r0drv/solaris/thread2-r0drv-solaris.c \
1118 r0drv/solaris/time-r0drv-solaris.c \
1119 r0drv/solaris/timer-r0drv-solaris.c
1120 # Don't use mp-r0drv-solaris.c because it will cause crashes due to incorrect memobj-r0drv-solaris.c code.
1121 ifeq (0,0)
1122 # Stub it. ## @todo limit the stubbing to RTMpOn*.
1123 RuntimeR0Drv_SOURCES.solaris += \
1124 generic/RTMpCpuId-generic.cpp \
1125 generic/RTMpCpuIdFromSetIndex-generic.cpp \
1126 generic/RTMpCpuIdToSetIndex-generic.cpp \
1127 generic/RTMpIsCpuPossible-generic.cpp \
1128 generic/RTMpGetCount-generic.cpp \
1129 generic/RTMpGetMaxCpuId-generic.cpp \
1130 generic/RTMpGetOnlineCount-generic.cpp \
1131 generic/RTMpGetOnlineSet-generic.cpp \
1132 generic/RTMpGetSet-generic.cpp \
1133 generic/RTMpIsCpuOnline-generic.cpp \
1134 r0drv/generic/RTMpOn-r0drv-generic.cpp
1135 else
1136 # Use mp-r0drv-solaris.c.
1137 RuntimeR0Drv_SOURCES.solaris += \
1138 r0drv/solaris/mp-r0drv-solaris.c
1139# r0drv/solaris/mpnotification-r0drv-solaris.c
1140 endif
1141
1142endif # !VBOX_WITH_SOLARIS_VBI
1143
1144## PORTME: Porters create and add their selection of platform specific Ring-0 Driver files here.
1145
1146
1147#
1148# RuntimeGuestR0 - Guest driver runtime.
1149# This is almost the same as the RuntimeR0Drv, the main difference
1150# is in the backdoor logging and the lack of sup.h (which should be
1151# made irrelevant even for RuntimeR0Drv).
1152#
1153RuntimeGuestR0_TEMPLATE := VBOXGUESTR0LIB
1154RuntimeGuestR0_SOURCES := $(filter-out generic/RTLogWriteUser-generic.cpp, $(RuntimeR0Drv_SOURCES))
1155RuntimeGuestR0_SOURCES += VBox/logbackdoor.cpp
1156RuntimeGuestR0_EXTENDS = RuntimeR0Drv
1157
1158# HACK: no vbi for the solaris guest additions - yet.
1159RuntimeGuestR0_SOURCES.solaris = \
1160 common/err/RTErrConvertFromErrno.cpp \
1161 common/misc/thread.cpp \
1162 common/string/memchr.asm \
1163 generic/RTAssertDoBreakpoint-generic.cpp \
1164 generic/RTTimerCreate-generic.cpp \
1165 r0drv/memobj-r0drv.cpp \
1166 generic/RTMpCpuId-generic.cpp \
1167 generic/RTMpCpuIdFromSetIndex-generic.cpp \
1168 generic/RTMpCpuIdToSetIndex-generic.cpp \
1169 generic/RTMpIsCpuPossible-generic.cpp \
1170 generic/RTMpGetCount-generic.cpp \
1171 generic/RTMpGetMaxCpuId-generic.cpp \
1172 generic/RTMpGetOnlineCount-generic.cpp \
1173 generic/RTMpGetOnlineSet-generic.cpp \
1174 generic/RTMpGetSet-generic.cpp \
1175 generic/RTMpIsCpuOnline-generic.cpp \
1176 r0drv/generic/RTMpOn-r0drv-generic.cpp \
1177 r0drv/generic/mpnotification-r0drv-generic.cpp \
1178 r0drv/solaris/alloc-r0drv-solaris.c \
1179 r0drv/solaris/assert-r0drv-solaris.c \
1180 r0drv/solaris/initterm-r0drv-solaris.c \
1181 r0drv/solaris/memobj-r0drv-solaris.c \
1182 r0drv/solaris/process-r0drv-solaris.c \
1183 r0drv/solaris/RTLogWriteDebugger-r0drv-solaris.c \
1184 r0drv/solaris/semevent-r0drv-solaris.c \
1185 r0drv/solaris/semeventmulti-r0drv-solaris.c \
1186 r0drv/solaris/semfastmutex-r0drv-solaris.c \
1187 r0drv/solaris/spinlock-r0drv-solaris.c \
1188 r0drv/solaris/thread-r0drv-solaris.c \
1189 r0drv/solaris/thread2-r0drv-solaris.c \
1190 r0drv/solaris/time-r0drv-solaris.c \
1191 r0drv/solaris/timer-r0drv-solaris.c
1192
1193#
1194# RuntimeGuestR0NT4 - Win32 NT4 guest driver runtime.
1195#
1196RuntimeGuestR0NT4_EXTENDS = RuntimeGuestR0
1197RuntimeGuestR0NT4_EXTENDS_BY = appending
1198RuntimeGuestR0NT4_DEFS = IPRT_TARGET_NT4
1199
1200
1201#
1202# RuntimeGC - Guest context library.
1203#
1204RuntimeGC_TEMPLATE = VBOXGC
1205RuntimeGC_DEFS = IN_RT_GC RT_WITH_VBOX RT_WITHOUT_NOCRT_WRAPPERS
1206RuntimeGC_INCS = include
1207RuntimeGC_SOURCES = \
1208 common/log/log.cpp \
1209 common/log/logcom.cpp \
1210 common/log/logformat.cpp \
1211 common/misc/assert.cpp \
1212 common/misc/sanity-c.c \
1213 common/misc/sanity-cpp.cpp \
1214 common/string/memchr.cpp \
1215 common/string/memcmp.cpp \
1216 common/string/memcpy.cpp \
1217 common/string/memset.cpp \
1218 common/string/memmove.asm \
1219 common/string/strcpy.cpp \
1220 common/string/strformat.cpp \
1221 common/string/strformatrt.cpp \
1222 common/string/strformattype.cpp \
1223 common/string/strlen.asm \
1224 common/string/strncmp.cpp \
1225 common/string/strpbrk.cpp \
1226 common/string/strprintf.cpp \
1227 common/table/avllu32.cpp \
1228 common/table/avlou32.cpp \
1229 common/table/avlogcphys.cpp \
1230 common/table/avlogcptr.cpp \
1231 common/table/avlohcphys.cpp \
1232 common/table/avloioport.cpp \
1233 common/table/avlrogcphys.cpp \
1234 common/table/avlrogcptr.cpp \
1235 common/table/avlroioport.cpp \
1236 common/table/avlroogcptr.cpp \
1237 common/table/avlu32.cpp \
1238 common/time/timeprog.cpp \
1239 common/time/timesup.cpp \
1240 gc/initterm-gc.cpp \
1241 generic/RTAssertDoBreakpoint-generic.cpp \
1242 VBox/strformat-vbox.cpp \
1243
1244#if1of ($(KBUILD_TARGET_ARCH),amd64 x86)
1245# RuntimeGC_SOURCES += common/time/timesupA.asm
1246#else
1247 RuntimeGC_SOURCES += common/time/timesupref.cpp
1248#endif
1249
1250RuntimeGC_SOURCES.win.x86 = $(RuntimeWin32ASM_SOURCES)
1251
1252ifeq ($(VBOX_LDR_FMT32),lx)
1253 RuntimeGC_SOURCES += os2/sys0.asm
1254endif
1255
1256if1of ($(KBUILD_TARGET), darwin solaris freebsd)
1257RuntimeGC_SOURCES += \
1258 common/math/gcc/adddi3.c \
1259 common/math/gcc/anddi3.c \
1260 common/math/gcc/ashldi3.c \
1261 common/math/gcc/ashrdi3.c \
1262 common/math/gcc/cmpdi2.c \
1263 common/math/gcc/divdi3.c \
1264 common/math/gcc/iordi3.c \
1265 common/math/gcc/lshldi3.c \
1266 common/math/gcc/lshrdi3.c \
1267 common/math/gcc/moddi3.c \
1268 common/math/gcc/muldi3.c \
1269 common/math/gcc/negdi2.c \
1270 common/math/gcc/notdi2.c \
1271 common/math/gcc/qdivrem.c \
1272 common/math/gcc/subdi3.c \
1273 common/math/gcc/ucmpdi2.c \
1274 common/math/gcc/udivdi3.c \
1275 common/math/gcc/umoddi3.c \
1276 common/math/gcc/xordi3.c
1277endif
1278
1279
1280#
1281# Static library for new & delete for the electric fence.
1282#
1283RuntimeEFCPP_TEMPLATE = $(RuntimeR3_TEMPLATE)
1284RuntimeEFCPP_SDKS = $(RuntimeR3_SDKS)
1285RuntimeEFCPP_SDKS.$(KBUILD_TARGET) = $(RuntimeR3_SDKS.$(KBUILD_TARGET))
1286RuntimeEFCPP_DEFS = $(RuntimeR3_DEFS)
1287RuntimeEFCPP_DEFS.$(KBUILD_TARGET) = $(RuntimeR3_DEFS.$(KBUILD_TARGET))
1288RuntimeEFCPP_INCS = $(RuntimeR3_INCS)
1289RuntimeEFCPP_INCS.$(KBUILD_TARGET) = $(RuntimeR3_INCS.$(KBUILD_TARGET))
1290RuntimeEFCPP_SOURCES = r3/alloc-ef-cpp.cpp
1291
1292
1293
1294#
1295# errmsg.cpp depends on a generated header.
1296#
1297common/err/errmsg.cpp_DEPS = $(PATH_TARGET)/errmsgdata.h
1298common/err/errmsg.cpp_INCS = $(PATH_TARGET)
1299
1300win/errmsgwin.cpp_DEPS = $(PATH_TARGET)/errmsgcomdata.h
1301win/errmsgwin.cpp_INCS = $(PATH_TARGET)
1302
1303
1304#
1305# Generate the rules (we're the to sub-makefile).
1306#
1307include $(KBUILD_PATH)/subfooter.kmk
1308
1309
1310ifneq ($(wildcard /usr/bin/chcon),)
1311# this is needed for testcases executed at build time
1312## @todo Make a special installer tool that does this.
1313$(PATH_BIN)/VBoxRT.so:
1314 $(INSTALL) $(TARGET_VBoxRT) $@
1315 chcon -t texrel_shlib_t $@ || true
1316endif
1317
1318
1319#
1320# Generate the status code data.
1321#
1322$(PATH_TARGET)/errmsgdata.h: common/err/errmsg.sed $(DEPTH)/include/iprt/err.h $(DEPTH)/include/VBox/err.h
1323 $(call MSG_GENERATE,,$@,$(filter %.h,$^))
1324 $(QUIET)$(MKDIR) -p $(PATH_TARGET)
1325 $(QUIET)$(REDIRECT) -wo $@ -- $(SED) -f $< $(filter %.h,$^)
1326
1327## @todo r=bird: rename this to indicate that it's not only COM errors, but all win32/64 errors.
1328$(PATH_TARGET)/errmsgcomdata.h: common/err/errmsgcom.sed $(PATH_SDK_WINPSDK_INC)/WinError.h
1329 $(call MSG_GENERATE,,$@,$(filter %.h,$^))
1330 $(QUIET)$(MKDIR) -p $(PATH_TARGET)
1331 $(QUIET)$(REDIRECT) -wo $@ -- $(SED) -f $< $(filter %.h,$^)
1332
1333
1334#
1335# Aliases for .cpp.h files so we can more easily do syntax checking from the editor.
1336#
1337ldrELFRelocatable.cpp.o: ldrELF.o
1338ldrELFRelocatable.cpp.obj: ldrELF.obj
1339
1340
1341#
1342# Doxygen documentation.
1343#
1344DOXYGEN_INPUT_DIRS = \
1345 $(PATH_ROOT)/include/iprt \
1346 $(PATH_ROOT)/include/iprt/nocrt \
1347 $(PATH_ROOT)/include/iprt/nocrt/x86 \
1348 $(PATH_ROOT)/include/iprt/nocrt/amd64 \
1349 include/internal \
1350 common/alloc \
1351 common/checksum \
1352 common/err \
1353 common/ldr \
1354 common/log \
1355 common/misc \
1356 common/string \
1357 common/table \
1358 common/time \
1359 VBox/ \
1360 $(foreach dir, . r3 r0drv,\
1361 $(dir) \
1362 $(dir)/darwin \
1363 $(dir)/l4 \
1364 $(dir)/linux \
1365 $(dir)/nt \
1366 $(dir)/os2 \
1367 $(dir)/win \
1368 $(dir)/win32 \
1369 $(dir)/win64 \
1370 $(dir)/generic \
1371 )
1372
1373# These must come first in order to make things look nice.
1374DOXYGEN_INPUT_FIRST =\
1375 $(PATH_ROOT)/include/iprt/cdefs.h \
1376 $(PATH_ROOT)/include/iprt/types.h \
1377 $(PATH_ROOT)/include/iprt/runtime.h \
1378 $(PATH_ROOT)/include/iprt/param.h \
1379 $(PATH_ROOT)/include/iprt/assert.h \
1380 $(PATH_ROOT)/include/iprt/asm.h \
1381
1382DOXYGEN_INPUT := \
1383 $(filter-out %.cpp.h, $(sort $(wildcard $(addsuffix /*.h, $(DOXYGEN_INPUT_DIRS)))) ) \
1384 $(foreach dir, $(DOXYGEN_INPUT_DIRS), $(wildcard $(dir)/*.cpp $(dir)/.c $(dir)/.asm))
1385DOXYGEN_INPUT := \
1386 $(DOXYGEN_INPUT_FIRST) \
1387 $(filter-out $(DOXYGEN_INPUT_FIRST), $(DOXYGEN_INPUT))
1388
1389
1390DOXYGEN_OUTPUT = $(PATH_OUT)/docs/iprt
1391
1392-include $(PATH_TARGET)/Doxyfile.dep
1393
1394# Generate the Doxyfile
1395$(PATH_TARGET)/Doxyfile: Doxyfile Makefile.kmk \
1396 $(comp-vars DOXYGEN_INPUT,DOXYGEN_INPUT_PREV,FORCE) \
1397 $(comp-vars DOXYGEN_OUTPUT,DOXYGEN_OUTPUT_PREV,FORCE) \
1398 | $(call DIRDEP, $(PATH_TARGET))
1399 $(RM) -f $@ [email protected] $(PATH_TARGET)/Doxyfile.dep
1400 $(CP) -f Doxyfile [email protected]
1401 $(APPEND) [email protected]
1402 $(APPEND) [email protected] "OUTPUT_DIRECTORY = $(DOXYGEN_OUTPUT)"
1403 $(APPEND) [email protected] "WARN_LOGFILE = $(DOXYGEN_OUTPUT)/errors"
1404 $(APPEND) [email protected] "INCLUDE_PATH = $(PATH_ROOT)/include include . common/table"
1405 $(APPEND) [email protected] "INCLUDE_FILE_PATTERNS = *.cpp.h"
1406 $(APPEND) [email protected] "PREDEFINED += $(ARCH_BITS_DEFS)"
1407 $(APPEND) [email protected]
1408 $(APPEND) [email protected] "INPUT = $(DOXYGEN_INPUT)"
1409 $(APPEND) [email protected]
1410 $(MV) -f [email protected] $@
1411 @$(APPEND) $(PATH_TARGET)/Doxyfile.dep "DOXYGEN_OUTPUT_PREV = $(DOXYGEN_OUTPUT)"
1412 @$(APPEND) $(PATH_TARGET)/Doxyfile.dep "DOXYGEN_INPUT_PREV = $(DOXYGEN_INPUT)"
1413
1414# Create the output directory.
1415$(call DIRDEP, $(DOXYGEN_OUTPUT)):
1416 $(MKDIR) -p $@
1417
1418# Do the actual job.
1419$(PATH_TARGET)/docs.iprt: $(PATH_TARGET)/Doxyfile $(DOXYGEN_INPUT) | $(call DIRDEP, $(DOXYGEN_OUTPUT))
1420 $(RM) -f $(wildcard $(DOXYGEN_OUTPUT)/html/*) $(PATH_TARGET)/docs.iprt
1421 doxygen $(PATH_TARGET)/Doxyfile
1422 $(APPEND) $(PATH_TARGET)/docs.iprt
1423
1424# alias
1425docs: $(PATH_TARGET)/docs.iprt
1426
1427test:
1428 @echo test-$(comp-vars DOXYGEN_OUTPUT,DOXYGEN_OUTPUT_PREV,FORCE)
1429 @echo $(DOXYGEN_OUTPUT)
1430 @echo $(DOXYGEN_OUTPUT_PREV)
1431 @echo $(DOXYGEN_INPUT)
1432
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