VirtualBox

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

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

forward port from 1.5: build vditool for Linux if BUILD_TYPE=l4

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