VirtualBox

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

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

Created generic templates for compiling guest additions (for new ports): VBOXGUESTR3EXE, VBOXGUESTR3LIB, VBOXGUESTR0LIB and VBOXGUESTR0.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 38.1 KB
Line 
1# $Id: Makefile.kmk 6013 2007-12-08 00:39:13Z 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
37# else ifeq ($(BUILD_TARGET),os2)
38# LIBRARIES = RuntimeOS2GuestR0 RuntimeOS2GuestR3 #RuntimeOS2Warp3GuestR0
39# else ifeq ($(BUILD_TARGET),win)
40# LIBRARIES = RuntimeW32GuestR0 RuntimeW32GuestR3 RuntimeW32NT4GuestR0
41# else
42 LIBRARIES = RuntimeGuestR0 RuntimeGuestR3
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
50else ifdef VBOX_ADDITIONS_WIN32_ONLY
51 LIBRARIES = RuntimeW32GuestR0 RuntimeW32GuestR3 RuntimeW32NT4GuestR0
52else ifdef VBOX_ADDITIONS_OS2_ONLY
53 LIBRARIES += RuntimeOS2GuestR0 RuntimeOS2GuestR3 #RuntimeOS2Warp3GuestR0
54else
55
56 #
57 # Normal build.
58 #
59 BLDPROGS = uniread
60 LIBRARIES = RuntimeR3 RuntimeR0 RuntimeGC RuntimeEFCPP RuntimeR3NoCRTGCC
61 ifdef VBOX_WITH_VBOXDRV
62 LIBRARIES += RuntimeR0Drv
63 endif
64 ifndef VBOX_WITHOUT_ADDITIONS
65 ifdef VBOX_WITH_WIN32_ADDITIONS
66 LIBRARIES += RuntimeW32GuestR0 RuntimeW32GuestR3 RuntimeW32NT4GuestR0
67 endif
68 ifdef VBOX_WITH_LINUX_ADDITIONS
69 LIBRARIES += RuntimeLnx32GuestR3
70 ifdef VBOX_WITH_LINUX_ADDITIONS_32BIT_R0
71 LIBRARIES += RuntimeLnx32GuestR0
72 endif
73 endif
74 ifdef VBOX_WITH_OS2_ADDITIONS
75 LIBRARIES += RuntimeOS2GuestR0 RuntimeOS2GuestR3 #RuntimeOS2Warp3GuestR0
76 endif
77 endif # !VBOX_WITHOUT_ADDITIONS
78 LIBRARIES.l4 = RuntimeR3L4
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 , $(RuntimeR3_SOURCES))
510RuntimeGuestR3_SOURCES += \
511 common/time/timesysalias.cpp
512RuntimeGuestR3_SOURCES.$(BUILD_TARGET) := $(RuntimeR3_SOURCES.$(BUILD_TARGET))
513RuntimeGuestR3_SOURCES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH) := $(RuntimeR3_SOURCES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH))
514
515
516#
517# RuntimeW32GuestR3 - Win32 guest program runtime.
518#
519RuntimeW32GuestR3_TEMPLATE = VBOXW32GUESTR3LIB
520RuntimeW32GuestR3_SDKS = WINPSDK W2K3DDK
521RuntimeW32GuestR3_DEFS = IN_RT_R3 IN_SUP_R3 LDR_WITH_NATIVE LDR_WITH_ELF32 LDR_WITH_PE RT_WITH_VBOX
522ifdef IPRT_WITH_KSTUFF
523 RuntimeW32GuestR3_DEFS += LDR_WITH_KLDR
524endif
525RuntimeW32GuestR3_SOURCES = $(RuntimeR3_SOURCES.win) $(RuntimeR3_SOURCES)
526RuntimeW32GuestR3_INCS = $(RuntimeR3_INCS.win) $(RuntimeR3_INCS)
527
528
529#
530# RuntimeLnx32GuestR3 - 32-bit Linux guest program runtime.
531#
532RuntimeLnx32GuestR3_TEMPLATE = VBOXLNX32GUESTR3LIB
533RuntimeLnx32GuestR3_DEFS = IN_RT_R3 IN_SUP_R3 LDR_WITH_NATIVE LDR_WITH_ELF32 LDR_WITH_PE RT_WITH_VBOX
534ifdef IPRT_WITH_KSTUFF
535 RuntimeLnx32GuestR3_DEFS += LDR_WITH_KLDR
536endif
537RuntimeLnx32GuestR3_SOURCES = $(RuntimeR3_SOURCES.linux) $(RuntimeR3_SOURCES)
538RuntimeLnx32GuestR3_INCS = $(RuntimeR3_INCS.linux) $(RuntimeR3_INCS)
539
540
541#
542# RuntimeOS2GuestR3 - OS/2 guest program runtime.
543#
544RuntimeOS2GuestR3_TEMPLATE = VBOXOS2GUESTR3LIB
545RuntimeOS2GuestR3_DEFS = IN_RT_R3 IN_SUP_R3 LDR_WITH_NATIVE LDR_WITH_ELF32 LDR_WITH_PE RT_WITH_VBOX
546ifdef IPRT_WITH_KSTUFF
547 RuntimeOS2GuestR3_DEFS += LDR_WITH_KLDR
548endif
549RuntimeOS2GuestR3_SOURCES = $(RuntimeR3_SOURCES.os2) $(RuntimeR3_SOURCES)
550RuntimeOS2GuestR3_INCS = $(RuntimeR3_INCS.os2) $(RuntimeR3_INCS)
551
552
553#
554# VBoxRT - Shared Object / DLL version.
555#
556VBoxRT_TEMPLATE = VBOXR3
557VBoxRT_SDKS.win = WINPSDK W2K3DDK VBOX_NTDLL
558ifeq ($(BUILD_TARGET),darwin)
559VBoxRT_INST = $(INST_DLL) $(INST_TESTCASE)
560endif
561VBoxRT_DEFS = $(RuntimeR3_DEFS) IN_SUP_R3 IN_SUP_R3
562VBoxRT_DEFS.$(BUILD_TYPE) = $(RuntimeR3_DEFS.$(BUILD_TYPE))
563VBoxRT_SOURCES = \
564 VBox/VBoxRTDeps.cpp \
565 $(RuntimeR3_SOURCES)
566VBoxRT_SOURCES.$(BUILD_TARGET) = $(RuntimeR3_SOURCES.$(BUILD_TARGET))
567VBoxRT_SOURCES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH) = $(RuntimeR3_SOURCES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH))
568VBoxRT_SOURCES.win += r3/win/dllmain-win.cpp
569VBoxRT_SOURCES.win.x86 += r3/win/VBoxRT-win32.def
570VBoxRT_SOURCES.win.amd64 += r3/win/VBoxRT-win64.def
571VBoxRT_INCS = $(RuntimeR3_INCS)
572VBoxRT_INCS.$(BUILD_TARGET) = $(RuntimeR3_INCS.$(BUILD_TARGET))
573VBoxRT_INCS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH) = $(RuntimeR3_INCS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH))
574VBoxRT_LIBS = \
575 $(PATH_LIB)/SUPR3$(VBOX_SUFF_LIB) \
576 $(PATH_LIB)/VBox-liblzf$(VBOX_SUFF_LIB)
577ifdef IPRT_WITH_KSTUFF
578 VBoxRT_LIBS += \
579 $(PATH_LIB)/VBox-kStuff$(VBOX_SUFF_LIB)
580endif
581VBoxRT_LIBS.darwin = \
582 iconv
583VBoxRT_LIBS.freebsd = \
584 iconv
585VBoxRT_LIBPATH.freebsd = \
586 /usr/local/lib
587VBoxRT_LDFLAGS.darwin = -framework IOKit -install_name @executable_path/VBoxRT.dylib
588ifdef VBOX_USE_VCC80
589VBoxRT_LDFLAGS.win = /MANIFEST
590endif
591VBoxRT_LDFLAGS.l4 = \
592 -Wl,-whole-archive \
593 $(PATH_LIB)/RuntimeR3L4$(VBOX_SUFF_LIB) \
594 -Wl,-no-whole-archive
595ifeq ($(BUILD_TARGET),l4)
596VBoxRT_LIBS += \
597 $(L4_LIBDIR)/libl4sys.a \
598 $(L4_LIBDIR)/libl4sys.p.a
599endif
600VBoxRT_LIBS.l4 = \
601 $(PATH_LIB)/RuntimeR3L4$(VBOX_SUFF_LIB)
602
603
604#
605# RuntimeR3NoCRTGCC - CRT replacement lib for VBoxREM.
606# This is used together with VBoxRT.
607#
608RuntimeR3NoCRTGCC_TEMPLATE = VBOXNOCRTGCC
609RuntimeR3NoCRTGCC_LIBSUFF = $(VBOX_SUFF_LIB)
610RuntimeR3NoCRTGCC_SOURCES = \
611 common/misc/sanity-cpp.cpp \
612 common/misc/sanity-c.c \
613 \
614 common/math/ceill.asm \
615 common/math/cosl.asm \
616 common/math/fabs.asm \
617 common/math/fabsf.asm \
618 common/math/fabsl.asm \
619 common/math/floor.asm \
620 common/math/floorf.asm \
621 common/math/floorl.asm \
622 common/math/ldexpl.asm \
623 common/math/llrint.asm \
624 common/math/llrintf.asm \
625 common/math/llrintl.asm \
626 common/math/logl.asm \
627 common/math/lrint.asm \
628 common/math/lrintf.asm \
629 common/math/lrintl.asm \
630 common/math/remainder.asm \
631 common/math/remainderf.asm \
632 common/math/remainderl.asm \
633 common/math/sinl.asm \
634 common/math/tanl.asm \
635 common/math/trunc.asm \
636 common/math/truncf.asm \
637 common/math/truncl.asm \
638 \
639 common/misc/setjmp.asm \
640 \
641 common/string/memchr.asm \
642 common/string/memchr_alias.c \
643 common/string/memcmp.asm \
644 common/string/memcmp_alias.c \
645 common/string/memcpy.asm \
646 common/string/memcpy_alias.c \
647 common/string/mempcpy.asm \
648 common/string/memset.asm \
649 common/string/memset_alias.c \
650 common/string/strchr.asm \
651 common/string/strchr_alias.c \
652 common/string/strcmp.asm \
653 common/string/strcmp_alias.c
654
655RuntimeR3NoCRTGCC_SOURCES.x86 = \
656 common/math/x86/fenv-x86.c \
657 common/math/gcc/adddi3.c \
658 common/math/gcc/anddi3.c \
659 common/math/gcc/ashldi3.c \
660 common/math/gcc/ashrdi3.c \
661 common/math/gcc/cmpdi2.c \
662 common/math/gcc/divdi3.c \
663 common/math/gcc/iordi3.c \
664 common/math/gcc/lshldi3.c \
665 common/math/gcc/lshrdi3.c \
666 common/math/gcc/moddi3.c \
667 common/math/gcc/muldi3.c \
668 common/math/gcc/negdi2.c \
669 common/math/gcc/notdi2.c \
670 common/math/gcc/qdivrem.c \
671 common/math/gcc/subdi3.c \
672 common/math/gcc/ucmpdi2.c \
673 common/math/gcc/udivdi3.c \
674 common/math/gcc/umoddi3.c \
675 common/math/gcc/xordi3.c
676
677
678## @todo stop using the old memcpy.c and memset.c code.
679
680#
681# RuntimeR0 - Ring0 library for VMMR0.
682#
683RuntimeR0_TEMPLATE = VBOXR0
684RuntimeR0_DEFS = IN_RT_R0 RT_WITH_VBOX RT_WITHOUT_NOCRT_WRAPPERS
685RuntimeR0_SOURCES = \
686 common/log/logcom.cpp \
687 common/log/logformat.cpp \
688 common/misc/assert.cpp \
689 common/misc/sanity-c.c \
690 common/misc/sanity-cpp.cpp \
691 common/string/memchr.cpp \
692 common/string/memcmp.cpp \
693 common/string/memcpy.cpp \
694 common/string/memset.cpp \
695 common/string/strcmp.asm \
696 common/string/strcpy.cpp \
697 common/string/strformat.cpp \
698 common/string/strformatrt.cpp \
699 common/string/strlen.cpp \
700 common/string/strncmp.cpp \
701 common/string/strpbrk.cpp \
702 common/string/strprintf.cpp \
703 common/table/avlgcptr.cpp \
704 common/table/avlhcphys.cpp \
705 common/table/avllu32.cpp \
706 common/table/avlogcphys.cpp \
707 common/table/avlogcptr.cpp \
708 common/table/avlohcphys.cpp \
709 common/table/avloioport.cpp \
710 common/table/avlpv.cpp \
711 common/table/avlrogcphys.cpp \
712 common/table/avlrogcptr.cpp \
713 common/table/avlroioport.cpp \
714 common/table/avlroogcptr.cpp \
715 common/table/avlu32.cpp \
716 common/time/timesup.cpp \
717 generic/RTAssertDoBreakpoint-generic.cpp \
718 VBox/strformat-vbox.cpp
719
720#if1of ($(BUILD_TARGET_ARCH),amd64 x86)
721# RuntimeR0_SOURCES += common/time/timesupA.asm
722#else
723 RuntimeR0_SOURCES += common/time/timesupref.cpp
724#endif
725
726RuntimeR0_SOURCES.win.amd64 = $(RuntimeWin64ASM_SOURCES)
727RuntimeR0_SOURCES.win.x86 = $(RuntimeWin32ASM_SOURCES)
728
729RuntimeR0_SOURCES.os2 = \
730 os2/RTErrConvertFromOS2.cpp \
731 os2/sys0.asm
732
733ifeq ($(filter-out darwin solaris freebsd,$(BUILD_TARGET)),)
734RuntimeR0_SOURCES += \
735 common/math/gcc/adddi3.c \
736 common/math/gcc/anddi3.c \
737 common/math/gcc/ashldi3.c \
738 common/math/gcc/ashrdi3.c \
739 common/math/gcc/cmpdi2.c \
740 common/math/gcc/divdi3.c \
741 common/math/gcc/iordi3.c \
742 common/math/gcc/lshldi3.c \
743 common/math/gcc/lshrdi3.c \
744 common/math/gcc/moddi3.c \
745 common/math/gcc/muldi3.c \
746 common/math/gcc/negdi2.c \
747 common/math/gcc/notdi2.c \
748 common/math/gcc/qdivrem.c \
749 common/math/gcc/subdi3.c \
750 common/math/gcc/ucmpdi2.c \
751 common/math/gcc/udivdi3.c \
752 common/math/gcc/umoddi3.c \
753 common/math/gcc/xordi3.c
754endif
755
756
757common/string/memchr.cpp_CXXFLAGS.win = -Oi-
758common/string/memcmp.cpp_CXXFLAGS.win = -Oi-
759common/string/memcpy.cpp_CXXFLAGS.win = -Oi-
760common/string/memset.cpp_CXXFLAGS.win = -Oi-
761common/string/strcpy.cpp_CXXFLAGS.win = -Oi-
762common/string/strlen.cpp_CXXFLAGS.win = -Oi-
763
764ifeq ($(BUILD_TARGET),l4)
765RuntimeR0Drv_BLD_TRG = linux
766RuntimeR0Drv_BLD_TRG_ARCH = x86
767RuntimeR0Drv_BLD_TRG_CPU = i386
768endif
769
770#
771# RuntimeR0Drv - Ring0 library for host drivers.
772#
773RuntimeR0Drv_TEMPLATE = VBOXR0DRV
774RuntimeR0Drv_SDKS.win = W2K3DDK WINPSDKINCS
775RuntimeR0Drv_INCS := $(PATH_SUB_CURRENT)
776RuntimeR0Drv_DEFS = IN_RT_R0 RT_WITH_VBOX RT_WITHOUT_NOCRT_WRAPPERS
777RuntimeR0Drv_DEFS.win = IN_SUP_R0
778RuntimeR0Drv_DEFS.linux = MODULE KBUILD_MODNAME=KBUILD_STR\(vboxdrv\) KBUILD_BASENAME=KBUILD_STR\(vboxdrv\) IN_SUP_R0 # why is IN_SUP_R0 here? because!
779
780RuntimeR0Drv_INCS.linux = \
781 r0drv/linux
782
783RuntimeR0Drv_SOURCES = \
784 common/checksum/crc32.cpp \
785 common/checksum/crc64.cpp \
786 common/log/log.cpp \
787 common/log/logcom.cpp \
788 common/log/logformat.cpp \
789 common/misc/assert.cpp \
790 common/misc/sanity-c.c \
791 common/misc/sanity-cpp.cpp \
792 common/string/strformat.cpp \
793 common/string/strformatrt.cpp \
794 common/string/strpbrk.cpp \
795 common/string/strprintf.cpp \
796 common/string/strtonum.cpp \
797 common/table/avlpv.cpp \
798 generic/RTLogWriteStdErr-stub-generic.cpp \
799 generic/RTLogWriteStdOut-stub-generic.cpp \
800 generic/RTLogWriteUser-generic.cpp \
801 r0drv/alloc-r0drv.cpp \
802 r0drv/initterm-r0drv.cpp \
803 VBox/log-vbox.cpp \
804 VBox/strformat-vbox.cpp
805
806RuntimeR0Drv_SOURCES.linux = \
807 common/alloc/heapsimple.cpp \
808 common/err/RTErrConvertToErrno.cpp \
809 generic/RTAssertDoBreakpoint-generic.cpp \
810 r0drv/linux/alloc-r0drv-linux.c \
811 r0drv/linux/initterm-r0drv-linux.c \
812 r0drv/linux/memobj-r0drv-linux.c \
813 r0drv/linux/process-r0drv-linux.c \
814 r0drv/linux/RTLogWriteDebugger-r0drv-linux.c \
815 r0drv/linux/semevent-r0drv-linux.c \
816 r0drv/linux/semeventmulti-r0drv-linux.c \
817 r0drv/linux/semfastmutex-r0drv-linux.c \
818 r0drv/linux/spinlock-r0drv-linux.c \
819 r0drv/linux/thread-r0drv-linux.c \
820 r0drv/memobj-r0drv.cpp
821## @todo thread2-r0drv-linux.c, timer-r0drv-linux.c and assert-r0drv-linux.c
822
823RuntimeR0Drv_SOURCES.win = \
824 common/misc/thread.cpp \
825 common/string/strncmp.cpp \
826 generic/RTAssertDoBreakpoint-generic.cpp \
827 nt/RTErrConvertFromNtStatus.cpp \
828 r0drv/memobj-r0drv.cpp \
829 r0drv/nt/alloc-r0drv-nt.cpp \
830 r0drv/nt/initterm-r0drv-nt.cpp \
831 r0drv/nt/memobj-r0drv-nt.cpp \
832 r0drv/nt/process-r0drv-nt.cpp \
833 r0drv/nt/RTLogWriteDebugger-r0drv-nt.cpp \
834 r0drv/nt/semevent-r0drv-nt.cpp \
835 r0drv/nt/semeventmulti-r0drv-nt.cpp \
836 r0drv/nt/semfastmutex-r0drv-nt.cpp \
837 r0drv/nt/semmutex-r0drv-nt.cpp \
838 r0drv/nt/spinlock-r0drv-nt.cpp \
839 r0drv/nt/thread-r0drv-nt.cpp \
840 r0drv/nt/thread2-r0drv-nt.cpp \
841 r0drv/nt/time-r0drv-nt.cpp
842## @todo timer-r0drv-nt.cpp and assert-r0drv-nt.cpp
843
844RuntimeR0Drv_SOURCES.win.amd64 = $(RuntimeWin64ASM_SOURCES)
845RuntimeR0Drv_SOURCES.win.x86 = $(RuntimeWin32ASM_SOURCES)
846
847RuntimeR0Drv_SOURCES.darwin = \
848 common/err/RTErrConvertFromErrno.cpp \
849 common/misc/thread.cpp \
850 common/string/memchr.asm \
851 darwin/RTErrConvertFromDarwinIO.cpp \
852 darwin/RTErrConvertFromDarwinKern.cpp \
853 generic/RTAssertDoBreakpoint-generic.cpp \
854 generic/RTTimerCreate-generic.cpp \
855 generic/timer-generic.cpp \
856 r0drv/darwin/alloc-r0drv-darwin.cpp \
857 r0drv/darwin/assert-r0drv-darwin.cpp \
858 r0drv/darwin/initterm-r0drv-darwin.cpp \
859 r0drv/darwin/memobj-r0drv-darwin.cpp \
860 r0drv/darwin/process-r0drv-darwin.cpp \
861 r0drv/darwin/RTLogWriteDebugger-r0drv-darwin.cpp \
862 r0drv/darwin/semaphore-r0drv-darwin.cpp \
863 r0drv/darwin/spinlock-r0drv-darwin.cpp \
864 r0drv/darwin/thread-r0drv-darwin.cpp \
865 r0drv/darwin/thread2-r0drv-darwin.cpp \
866 r0drv/darwin/time-r0drv-darwin.cpp \
867 r0drv/memobj-r0drv.cpp
868
869RuntimeR0Drv_DEFS.os2 += RT_WITHOUT_NOCRT_WRAPPERS
870RuntimeR0Drv_SOURCES.os2 = \
871 common/string/memchr.asm \
872 common/string/memcmp.asm \
873 common/string/memcpy.asm \
874 common/string/mempcpy.asm \
875 common/string/memset.asm \
876 common/string/strchr.asm \
877 common/string/strcmp.asm \
878 \
879 common/string/strcpy.cpp \
880 common/string/strlen.cpp \
881 common/string/strncmp.cpp \
882 \
883 common/misc/thread.cpp \
884 generic/RTLogWriteDebugger-generic.cpp \
885 os2/RTErrConvertFromOS2.cpp \
886 os2/sys0.asm \
887 r0drv/memobj-r0drv.cpp \
888 r0drv/os2/alloc-r0drv-os2.cpp \
889 r0drv/os2/assert-r0drv-os2.cpp \
890 r0drv/os2/assertA-r0drv-os2.asm \
891 r0drv/os2/initterm-r0drv-os2.cpp \
892 r0drv/os2/memobj-r0drv-os2.cpp \
893 r0drv/os2/os2imports.imp \
894 r0drv/os2/process-r0drv-os2.cpp \
895 r0drv/os2/RTAssertDoBreakpoint-r0drv-os2.asm \
896 r0drv/os2/RTR0Os2DHQueryDOSVar.asm \
897 r0drv/os2/RTR0Os2DHVMGlobalToProcess.asm \
898 r0drv/os2/semevent-r0drv-os2.cpp \
899 r0drv/os2/semeventmulti-r0drv-os2.cpp \
900 r0drv/os2/semfastmutex-r0drv-os2.cpp \
901 r0drv/os2/spinlock-r0drv-os2.cpp \
902 r0drv/os2/thread-r0drv-os2.cpp \
903 r0drv/os2/thread2-r0drv-os2.cpp \
904 r0drv/os2/time-r0drv-os2.cpp \
905 r0drv/os2/timer-r0drv-os2.cpp \
906 r0drv/os2/timerA-r0drv-os2.asm
907
908RuntimeR0Drv_SOURCES.freebsd = \
909 common/err/RTErrConvertFromErrno.cpp \
910 common/err/RTErrConvertToErrno.cpp \
911 common/misc/thread.cpp \
912 common/string/memchr.asm \
913 generic/RTAssertDoBreakpoint-generic.cpp \
914 generic/RTLogWriteDebugger-generic.cpp \
915 generic/RTTimerCreate-generic.cpp \
916 r0drv/freebsd/alloc-r0drv-freebsd.c \
917 r0drv/freebsd/assert-r0drv-freebsd.c \
918 r0drv/freebsd/initterm-r0drv-freebsd.c \
919 r0drv/freebsd/memobj-r0drv-freebsd.c \
920 r0drv/freebsd/process-r0drv-freebsd.c \
921 r0drv/freebsd/semevent-r0drv-freebsd.c \
922 r0drv/freebsd/semeventmulti-r0drv-freebsd.c \
923 r0drv/freebsd/semfastmutex-r0drv-freebsd.c \
924 r0drv/freebsd/spinlock-r0drv-freebsd.c \
925 r0drv/freebsd/thread-r0drv-freebsd.c \
926 r0drv/freebsd/thread2-r0drv-freebsd.c \
927 r0drv/freebsd/time-r0drv-freebsd.c \
928 r0drv/freebsd/timer-r0drv-freebsd.c \
929 r0drv/memobj-r0drv.cpp
930
931RuntimeR0Drv_SOURCES.solaris = \
932 common/err/RTErrConvertFromErrno.cpp \
933 common/misc/thread.cpp \
934 common/string/memchr.asm \
935 generic/RTAssertDoBreakpoint-generic.cpp \
936 generic/RTLogWriteDebugger-generic.cpp \
937 generic/RTTimerCreate-generic.cpp \
938 r0drv/memobj-r0drv.cpp \
939 r0drv/solaris/alloc-r0drv-solaris.c \
940 r0drv/solaris/assert-r0drv-solaris.c \
941 r0drv/solaris/initterm-r0drv-solaris.c \
942 r0drv/solaris/memobj-r0drv-solaris.c \
943 r0drv/solaris/process-r0drv-solaris.c \
944 r0drv/solaris/semevent-r0drv-solaris.c \
945 r0drv/solaris/semeventmulti-r0drv-solaris.c \
946 r0drv/solaris/semfastmutex-r0drv-solaris.c \
947 r0drv/solaris/spinlock-r0drv-solaris.c \
948 r0drv/solaris/thread-r0drv-solaris.c \
949 r0drv/solaris/thread2-r0drv-solaris.c \
950 r0drv/solaris/time-r0drv-solaris.c \
951 r0drv/solaris/timer-r0drv-solaris.c
952
953## PORTME: Porters create and add their selection of platform specific Ring-0 Driver files here.
954
955
956#
957# RuntimeGuestR0 - Guest driver runtime.
958# This is almost the same as the RuntimeR0Drv, the main difference
959# is in the backdoor logging and the lack of sup.h (which should be
960# made irrelevant even for RuntimeR0Rdrv).
961#
962# TODO: RuntimeGuestR0_EXTENDS = RuntimeR0Drv (kBuild)
963#
964RuntimeGuestR0_TEMPLATE := VBOXGUESTR0LIB
965RuntimeGuestR0_SDKS.win := W2K3DDKX86 WINPSDKINCS
966RuntimeGuestR0_DEFS := $(RuntimeR0Drv_DEFS)
967RuntimeGuestR0_DEFS.$(BUILD_TARGET) := $(RuntimeR0Drv_DEFS.$(BUILD_TARGET))
968RuntimeGuestR0_INCS := $(PATH_SUB_CURRENT)
969RuntimeGuestR0_INCS.$(BUILD_TARGET) := $(RuntimeR0Drv_INCS.$(BUILD_TARGET))
970RuntimeGuestR0_SOURCES := $(filter-out generic/RTLogWriteUser-generic.cpp, $(RuntimeR0Drv_SOURCES))
971RuntimeGuestR0_SOURCES += VBox/logbackdoor.cpp
972RuntimeGuestR0_SOURCES.$(BUILD_TARGET) := $(RuntimeR0Drv_SOURCES.$(BUILD_TARGET))
973RuntimeGuestR0_SOURCES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH) := $(RuntimeR0Drv_SOURCES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH))
974ifdef VBOX_USE_VCC80
975RuntimeGuestR0_SOURCES.win += \
976 common/string/memchr.cpp \
977 common/string/memcmp.cpp \
978 common/string/memcpy.cpp \
979 common/string/memset.cpp \
980 common/string/strlen.cpp
981endif
982
983
984#
985# RuntimeW32GuestR0 - Win32 guest driver runtime.
986#
987RuntimeW32GuestR0_TEMPLATE = VBOXW32GUESTR0LIB
988RuntimeW32GuestR0_SDKS = W2K3DDKX86 WINPSDKINCS
989RuntimeW32GuestR0_INCS := $(PATH_SUB_CURRENT)
990RuntimeW32GuestR0_DEFS = IN_RT_R0 RT_WITH_VBOX RT_WITHOUT_NOCRT_WRAPPERS IN_SUP_R0
991RuntimeW32GuestR0_DEFS.$(BUILD_TARGET) =
992RuntimeW32GuestR0_SOURCES = \
993 $(filter-out generic/RTLogWriteUser-generic.cpp,$(RuntimeR0Drv_SOURCES)) \
994 $(RuntimeR0Drv_SOURCES.win) \
995 VBox/logbackdoor.cpp
996ifdef VBOX_USE_VCC80
997RuntimeW32GuestR0_SOURCES += \
998 common/string/memchr.cpp \
999 common/string/memcmp.cpp \
1000 common/string/memcpy.cpp \
1001 common/string/memset.cpp \
1002 common/string/strlen.cpp
1003endif
1004
1005
1006#
1007# RuntimeW32NT4GuestR0 - Win32 NT4 guest driver runtime.
1008#
1009RuntimeW32NT4GuestR0_TEMPLATE = VBOXW32GUESTR0LIB
1010RuntimeW32NT4GuestR0_SDKS = $(RuntimeW32GuestR0_SDKS)
1011RuntimeW32NT4GuestR0_DEFS = $(RuntimeW32GuestR0_DEFS) IPRT_TARGET_NT4
1012RuntimeW32NT4GuestR0_INCS = $(RuntimeW32GuestR0_INCS)
1013RuntimeW32NT4GuestR0_SOURCES = $(RuntimeW32GuestR0_SOURCES)
1014
1015
1016#
1017# RuntimeLnx32GuestR0 - 32-bit Linux guest driver runtime.
1018#
1019RuntimeLnx32GuestR0_TEMPLATE = VBOXLNX32GUESTR0
1020RuntimeLnx32GuestR0_DEFS = RT_WITH_VBOX RT_WITHOUT_NOCRT_WRAPPERS IN_SUP_R0 \
1021 MODULE KBUILD_MODNAME=KBUILD_STR\(vboxdrv\) KBUILD_BASENAME=KBUILD_STR\(vboxdrv\)
1022RuntimeLnx32GuestR0_INCS = $(RuntimeR0Drv_INCS.linux) $(RuntimeR0Drv_INCS)
1023RuntimeLnx32GuestR0_SOURCES = \
1024 $(RuntimeR0Drv_SOURCES) \
1025 $(RuntimeR0Drv_SOURCES.linux) \
1026 VBox/logbackdoor.cpp
1027
1028
1029#
1030# RuntimeOS2GuestR0 - OS/2 Warp 4.5 guest driver runtime.
1031#
1032RuntimeOS2GuestR0_TEMPLATE = VBOXOS2GUESTR0LIB
1033RuntimeOS2GuestR0_INCS := $(PATH_SUB_CURRENT)
1034RuntimeOS2GuestR0_DEFS = RT_WITH_VBOX RT_WITHOUT_NOCRT_WRAPPERS
1035RuntimeOS2GuestR0_SOURCES = \
1036 $(filter-out common/misc/assert.cpp generic/RTLogWriteUser-generic.cpp,$(RuntimeR0Drv_SOURCES)) \
1037 $(RuntimeR0Drv_SOURCES.os2) \
1038 VBox/logbackdoor.cpp
1039
1040
1041#
1042# RuntimeGC - Guest context library.
1043#
1044RuntimeGC_TEMPLATE = VBOXGC
1045RuntimeGC_DEFS = IN_RT_GC RT_WITH_VBOX
1046RuntimeGC_SOURCES = \
1047 common/log/log.cpp \
1048 common/log/logcom.cpp \
1049 common/log/logformat.cpp \
1050 common/misc/assert.cpp \
1051 common/misc/sanity-c.c \
1052 common/misc/sanity-cpp.cpp \
1053 common/string/memchr.cpp \
1054 common/string/memcmp.cpp \
1055 common/string/memcpy.cpp \
1056 common/string/memset.cpp \
1057 common/string/strcpy.cpp \
1058 common/string/strformat.cpp \
1059 common/string/strformatrt.cpp \
1060 common/string/strlen.cpp \
1061 common/string/strncmp.cpp \
1062 common/string/strpbrk.cpp \
1063 common/string/strprintf.cpp \
1064 common/table/avllu32.cpp \
1065 common/table/avlogcphys.cpp \
1066 common/table/avlogcptr.cpp \
1067 common/table/avlohcphys.cpp \
1068 common/table/avloioport.cpp \
1069 common/table/avlrogcphys.cpp \
1070 common/table/avlrogcptr.cpp \
1071 common/table/avlroioport.cpp \
1072 common/table/avlroogcptr.cpp \
1073 common/table/avlu32.cpp \
1074 common/time/timeprog.cpp \
1075 common/time/timesup.cpp \
1076 gc/initterm-gc.cpp \
1077 generic/RTAssertDoBreakpoint-generic.cpp \
1078 VBox/strformat-vbox.cpp \
1079
1080#if1of ($(BUILD_TARGET_ARCH),amd64 x86)
1081# RuntimeGC_SOURCES += common/time/timesupA.asm
1082#else
1083 RuntimeGC_SOURCES += common/time/timesupref.cpp
1084#endif
1085
1086RuntimeGC_SOURCES.win.x86 = $(RuntimeWin32ASM_SOURCES)
1087
1088ifeq ($(VBOX_LDR_FMT32),lx)
1089 RuntimeGC_SOURCES += os2/sys0.asm
1090endif
1091
1092ifeq ($(filter-out darwin solaris freebsd,$(BUILD_TARGET)),)
1093RuntimeGC_SOURCES += \
1094 common/math/gcc/adddi3.c \
1095 common/math/gcc/anddi3.c \
1096 common/math/gcc/ashldi3.c \
1097 common/math/gcc/ashrdi3.c \
1098 common/math/gcc/cmpdi2.c \
1099 common/math/gcc/divdi3.c \
1100 common/math/gcc/iordi3.c \
1101 common/math/gcc/lshldi3.c \
1102 common/math/gcc/lshrdi3.c \
1103 common/math/gcc/moddi3.c \
1104 common/math/gcc/muldi3.c \
1105 common/math/gcc/negdi2.c \
1106 common/math/gcc/notdi2.c \
1107 common/math/gcc/qdivrem.c \
1108 common/math/gcc/subdi3.c \
1109 common/math/gcc/ucmpdi2.c \
1110 common/math/gcc/udivdi3.c \
1111 common/math/gcc/umoddi3.c \
1112 common/math/gcc/xordi3.c
1113endif
1114
1115
1116#
1117# Static library for new & delete for the electric fence.
1118#
1119RuntimeEFCPP_TEMPLATE = $(RuntimeR3_TEMPLATE)
1120RuntimeEFCPP_SDKS = $(RuntimeR3_SDKS)
1121RuntimeEFCPP_SDKS.$(BUILD_TARGET) = $(RuntimeR3_SDKS.$(BUILD_TARGET))
1122RuntimeEFCPP_DEFS = $(RuntimeR3_DEFS)
1123RuntimeEFCPP_DEFS.$(BUILD_TARGET) = $(RuntimeR3_DEFS.$(BUILD_TARGET))
1124RuntimeEFCPP_INCS = $(RuntimeR3_INCS)
1125RuntimeEFCPP_INCS.$(BUILD_TARGET) = $(RuntimeR3_INCS.$(BUILD_TARGET))
1126RuntimeEFCPP_SOURCES = r3/alloc-ef-cpp.cpp
1127
1128
1129
1130#
1131# errmsg.cpp depends on a generated header.
1132#
1133common/err/errmsg.cpp_DEPS = $(PATH_TARGET)/errmsgdata.h
1134common/err/errmsg.cpp_INCS = $(PATH_TARGET)
1135
1136win/errmsgwin.cpp_DEPS = $(PATH_TARGET)/errmsgcomdata.h
1137win/errmsgwin.cpp_INCS = $(PATH_TARGET)
1138
1139
1140# Generate the rules
1141include $(PATH_KBUILD)/footer.kmk
1142
1143
1144ifneq ($(wildcard /usr/bin/chcon),)
1145# this is needed for testcases executed at build time
1146$(PATH_BIN)/VBoxRT.so:
1147 $(INSTALL) $(out) $@
1148 chcon -t texrel_shlib_t $@ || true
1149endif
1150
1151
1152#
1153# Generate the status code data.
1154#
1155$(PATH_TARGET)/errmsgdata.h: common/err/errmsg.sed $(DEPTH)/include/iprt/err.h $(DEPTH)/include/VBox/err.h
1156 $(call MSG_GENERATE,,$@,$(filter %.h,$^))
1157 $(QUIET)$(MKDIR) -p $(PATH_TARGET)
1158 $(QUIET)$(REDIRECT) -wo $@ -- $(SED) -f $< $(filter %.h,$^)
1159
1160## @todo r=bird: rename this to indicate that it's not only COM errors, but all win32/64 errors.
1161$(PATH_TARGET)/errmsgcomdata.h: common/err/errmsgcom.sed $(PATH_SDK_WINPSDK_INC)/WinError.h
1162 $(call MSG_GENERATE,,$@,$(filter %.h,$^))
1163 $(QUIET)$(MKDIR) -p $(PATH_TARGET)
1164 $(QUIET)$(REDIRECT) -wo $@ -- $(SED) -f $< $(filter %.h,$^)
1165
1166$(PATH_TARGET)/errmsgxpcomdata.h: common/err/errmsgxpcom.sed $(DEPTH)/src/libs/xpcom18a4/xpcom/base/nsError.h
1167 $(call MSG_GENERATE,,$@,$(filter %.h,$^))
1168 $(QUIET)$(MKDIR) -p $(PATH_TARGET)
1169 $(QUIET)$(REDIRECT) -wo $@ -- $(SED) -f $< $(filter %.h,$^)
1170
1171
1172#
1173# Aliases for .cpp.h files so we can more easily do syntax checking from the editor.
1174#
1175ldrELFRelocatable.cpp.o: ldrELF.o
1176ldrELFRelocatable.cpp.obj: ldrELF.obj
1177
1178
1179#
1180# Doxygen documentation.
1181#
1182DOXYGEN_INPUT_DIRS = \
1183 $(PATH_ROOT)/include/iprt \
1184 $(PATH_ROOT)/include/iprt/nocrt \
1185 $(PATH_ROOT)/include/iprt/nocrt/x86 \
1186 $(PATH_ROOT)/include/iprt/nocrt/amd64 \
1187 include/internal \
1188 common/alloc \
1189 common/checksum \
1190 common/err \
1191 common/ldr \
1192 common/log \
1193 common/misc \
1194 common/string \
1195 common/table \
1196 common/time \
1197 $(foreach dir, . r3 r0drv,\
1198 $(dir) \
1199 $(dir)/darwin \
1200 $(dir)/l4 \
1201 $(dir)/linux \
1202 $(dir)/nt \
1203 $(dir)/os2 \
1204 $(dir)/win \
1205 $(dir)/win32 \
1206 $(dir)/win64 \
1207 $(dir)/generic \
1208 )
1209
1210# These must come first in order to make things look nice.
1211DOXYGEN_INPUT_FIRST =\
1212 $(PATH_ROOT)/include/iprt/cdefs.h \
1213 $(PATH_ROOT)/include/iprt/types.h \
1214 $(PATH_ROOT)/include/iprt/runtime.h \
1215 $(PATH_ROOT)/include/iprt/param.h \
1216 $(PATH_ROOT)/include/iprt/assert.h \
1217 $(PATH_ROOT)/include/iprt/asm.h \
1218
1219DOXYGEN_INPUT := \
1220 $(filter-out %.cpp.h, $(sort $(wildcard $(addsuffix /*.h, $(DOXYGEN_INPUT_DIRS)))) ) \
1221 $(foreach dir, $(DOXYGEN_INPUT_DIRS), $(wildcard $(dir)/*.cpp $(dir)/.c $(dir)/.asm))
1222DOXYGEN_INPUT := \
1223 $(DOXYGEN_INPUT_FIRST) \
1224 $(filter-out $(DOXYGEN_INPUT_FIRST), $(DOXYGEN_INPUT))
1225
1226
1227DOXYGEN_OUTPUT = $(PATH_OUT)/docs/iprt
1228
1229-include $(PATH_TARGET)/Doxyfile.dep
1230
1231# Generate the Doxyfile
1232$(PATH_TARGET)/Doxyfile: Doxyfile \
1233 $(comp-vars DOXYGEN_INPUT,DOXYGEN_INPUT_PREV,FORCE) \
1234 $(comp-vars DOXYGEN_OUTPUT,DOXYGEN_OUTPUT_PREV,FORCE) \
1235 | $(call DIRDEP, $(PATH_TARGET))
1236 $(RM) -f $@ [email protected] $(PATH_TARGET)/Doxyfile.dep
1237 $(CP) -f Doxyfile [email protected]
1238 $(APPEND) [email protected]
1239 $(APPEND) [email protected] "OUTPUT_DIRECTORY = $(DOXYGEN_OUTPUT)"
1240 $(APPEND) [email protected] "WARN_LOGFILE = $(DOXYGEN_OUTPUT)/errors"
1241 $(APPEND) [email protected] "INCLUDE_PATH = $(PATH_ROOT)/include include . common/table"
1242 $(APPEND) [email protected] "INCLUDE_FILE_PATTERNS = *.cpp.h"
1243 $(APPEND) [email protected]
1244 $(APPEND) [email protected] "INPUT = $(DOXYGEN_INPUT)"
1245 $(APPEND) [email protected]
1246 $(MV) -f [email protected] $@
1247 @$(APPEND) $(PATH_TARGET)/Doxyfile.dep "DOXYGEN_OUTPUT_PREV = $(DOXYGEN_OUTPUT)"
1248 @$(APPEND) $(PATH_TARGET)/Doxyfile.dep "DOXYGEN_INPUT_PREV = $(DOXYGEN_INPUT)"
1249
1250# Create the output directory.
1251$(call DIRDEP, $(DOXYGEN_OUTPUT)):
1252 $(MKDIR) -p $@
1253
1254# Do the actual job.
1255$(PATH_TARGET)/docs.iprt: $(PATH_TARGET)/Doxyfile $(DOXYGEN_INPUT) | $(call DIRDEP, $(DOXYGEN_OUTPUT))
1256 $(RM) -f $(wildcard $(DOXYGEN_OUTPUT)/html/*) $(PATH_TARGET)/docs.iprt
1257 doxygen $(PATH_TARGET)/Doxyfile
1258 $(APPEND) $(PATH_TARGET)/docs.iprt
1259
1260# alias
1261docs: $(PATH_TARGET)/docs.iprt
1262
1263test:
1264 @echo test-$(comp-vars DOXYGEN_OUTPUT,DOXYGEN_OUTPUT_PREV,FORCE)
1265 @echo $(DOXYGEN_OUTPUT)
1266 @echo $(DOXYGEN_OUTPUT_PREV)
1267
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