VirtualBox

source: vbox/trunk/src/VBox/Runtime/Makefile@ 925

Last change on this file since 925 was 894, checked in by vboxsync, 18 years ago

kLdr integration. tstLdrObj.gc now works on darwin.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 25.3 KB
Line 
1# $Id: Makefile 894 2007-02-14 09:50:17Z vboxsync $
2## @file
3# Makefile for the InnoTek Portable Runtime (IPRT).
4#
5
6#
7# Copyright (C) 2006 InnoTek Systemberatung 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 as published by the Free Software Foundation,
13# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
14# distribution. VirtualBox OSE is distributed in the hope that it will
15# be useful, but WITHOUT ANY WARRANTY of any kind.
16#
17# If you received this file as part of a commercial VirtualBox
18# distribution, then only the terms of your commercial VirtualBox
19# license agreement apply instead of the previous paragraph.
20#
21
22
23DEPTH = ../../..
24include $(PATH_KBUILD)/header.kmk
25
26ifndef VBOX_ADDITIONS_LINUX_ONLY
27 # Normal mode.
28 BLDPROGS = uniread
29 LIBRARIES = RuntimeR3 RuntimeR0 RuntimeGC RuntimeEFCPP RuntimeR3NoCRTGCC
30 ifdef VBOX_WITH_VBOXDRV
31 LIBRARIES += RuntimeR0Drv
32 endif
33 ifdef VBOX_WITH_WIN32_ADDITIONS
34 LIBRARIES += RuntimeW32GuestR0 RuntimeW32GuestR3 RuntimeW32NT4GuestR0
35 endif
36 ifdef VBOX_WITH_LINUX_ADDITIONS
37 LIBRARIES += RuntimeLnx32GuestR3
38 ifdef VBOX_WITH_LINUX_ADDITIONS_32BIT_R0
39 LIBRARIES += RuntimeLnx32GuestR0
40 endif
41 endif
42 LIBRARIES.l4= RuntimeR3L4
43 DLLS = VBoxRT
44 OTHER_CLEAN = \
45 $(PATH_TARGET)/errmsgdata.h \
46 $(PATH_TARGET)/errmsgcomdata.h \
47 $(PATH_TARGET)/Doxyfile \
48 $(PATH_TARGET)/Doxyfile.dep \
49 $(PATH_TARGET)/docs.iprt
50
51 SUBDIRS_AFTER = testcase
52
53else
54 # Linux target guest runtime only mode.
55 LIBRARIES = RuntimeLnx32GuestR0 RuntimeLnx32GuestR3
56endif # only linux guest additions
57
58
59# global (for now at least)
60INCS += include
61
62ifeq ($(USERNAME),bird)
63 ifneq ($(wildcard ./kLdr/kLdrModMachO.c),)
64 IPRT_WITH_KLDR=1
65 IPRT_PATH_KLDR=./kLdr
66 endif
67endif
68
69#
70# Unicode Specification reader used to regenerate unidata.cpp.
71#
72uniread_TEMPLATE = VBOXBLDPROG
73uniread_SOURCES = uniread.cpp
74
75#
76# Win64 assembly sources.
77#
78RuntimeWin64ASM_SOURCES = \
79 win64/ASMAtomicBitClear.asm \
80 win64/ASMAtomicBitTestAndToggle.asm \
81 win64/ASMAtomicBitToggle.asm \
82 win64/ASMAtomicReadU64.asm \
83 win64/ASMAtomicXchgU16.asm \
84 win64/ASMAtomicXchgU8.asm \
85 win64/ASMBitFirstClear.asm \
86 win64/ASMBitFirstSet.asm \
87 win64/ASMGetCS.asm \
88 win64/ASMGetDS.asm \
89 win64/ASMGetES.asm \
90 win64/ASMGetFlags.asm \
91 win64/ASMGetFS.asm \
92 win64/ASMGetGS.asm \
93 win64/ASMGetIDTR.asm \
94 win64/ASMGetGDTR.asm \
95 win64/ASMGetTR.asm \
96 win64/ASMGetSS.asm \
97 win64/ASMProbeReadByte.asm \
98 win64/ASMSetFlags.asm \
99 win64/ASMGetDR0.asm \
100 win64/ASMGetDR1.asm \
101 win64/ASMGetDR2.asm \
102 win64/ASMGetDR3.asm \
103 win64/ASMGetDR6.asm \
104 win64/ASMGetDR7.asm \
105
106#
107# RuntimeR3 - Static Runtime for Ring-3 executables.
108#
109RuntimeR3_TEMPLATE = VBOXR3EXE
110RuntimeR3_SDKS.win = WINPSDK W2K3DDK
111RuntimeR3_DEFS = IN_RT_R3 IN_SUP_R3 LDR_WITH_NATIVE LDR_WITH_ELF32 LDR_WITH_PE RT_WITH_VBOX
112ifdef IPRT_WITH_KLDR
113 RuntimeR3_DEFS += LDR_WITH_KLDR KLDR_USE_CRT
114 RuntimeR3_DEFS.debug += KLDRMOD_STRICT KLDRMODLX_STRICT KLDRMODPE_STRICT KLDRMODNATIVE_STRICT KLDRRDR_STRICT
115endif
116RuntimeR3_DEFS.l4 = L4
117ifdef VBOX_MAIN_RELEASE_LOG ## @todo (dmik): temporary, until RTThreadSelf/RTThreadAdopt are properly updated
118 RuntimeR3_DEFS += RTCRITSECT_STRICT
119endif
120RuntimeR3_INCS = \
121 $(PATH_ROOT)/src/libs/liblzf-1.51
122ifdef IPRT_WITH_KLDR
123 RuntimeR3_INCS += \
124 $(IPRT_PATH_KLDR)
125endif
126RuntimeR3_INCS.l4 = \
127 $(PATH_ROOT)/src/libs/libuuid \
128 $(L4_INCDIR)
129# for iconv.h
130RuntimeR3_INCS.freebsd = \
131 /usr/local/include
132
133RuntimeR3_SOURCES = \
134 misc/sanity-cpp.cpp \
135 misc/sanity-c.c \
136 alloc.cpp \
137 alloc/heapsimple.cpp \
138 assert.cpp \
139 table/avlhcphys.cpp \
140 table/avlgcptr.cpp \
141 table/avlogcphys.cpp \
142 table/avlogcptr.cpp \
143 table/avlohcphys.cpp \
144 table/avloioport.cpp \
145 table/avlpv.cpp \
146 table/avlrgcptr.cpp \
147 table/avlrogcphys.cpp \
148 table/avlrogcptr.cpp \
149 table/avlroogcptr.cpp \
150 table/avlroioport.cpp \
151 table/avlu32.cpp \
152 table/avlul.cpp \
153 table/table.cpp \
154 crc32.cpp \
155 crc64.cpp \
156 dir.cpp \
157 errmsg.cpp \
158 fileio.cpp \
159 fs.cpp \
160 generic/critsect-generic.cpp \
161 generic/RTFileCopy-generic.cpp \
162 generic/RTLogWriteStdErr-generic.cpp \
163 generic/RTLogWriteStdOut-generic.cpp \
164 generic/RTLogWriteUser-generic.cpp \
165 generic/semfastmutex-generic.cpp \
166 generic/spinlock-generic.cpp \
167 ldr.cpp \
168 ldrFile.cpp \
169 ldrNative.cpp \
170 ldrELF.cpp \
171 ldrEx.cpp \
172 ldrPE.cpp \
173 log.cpp \
174 logcom.cpp \
175 logformat.cpp \
176 md5.cpp \
177 path.cpp \
178 req.cpp \
179 r3/alloc-ef.cpp \
180 r3/alloc.cpp \
181 r3/init.cpp \
182 r3/process.cpp \
183 r3/stream.cpp \
184 r3/tcp.cpp \
185 RTErrConvertFromErrno.cpp \
186 semspingpong.cpp \
187 straprintf.cpp \
188 strformat.cpp \
189 strformatrt.cpp \
190 string.cpp \
191 strprintf.cpp \
192 strspace.cpp \
193 strstrip.cpp \
194 strtonum.cpp \
195 thread.cpp \
196 time.cpp \
197 timeprog.cpp \
198 uni.cpp \
199 unidata.cpp \
200 utf-16.cpp \
201 utf-8.cpp \
202 zip.cpp \
203 misc/rand.cpp \
204
205ifdef IPRT_WITH_KLDR
206 RuntimeR3_SOURCES += \
207 ldrkLdr.cpp \
208 $(IPRT_PATH_KLDR)/kLdrMod.c \
209 $(IPRT_PATH_KLDR)/kLdrModLX.c \
210 $(IPRT_PATH_KLDR)/kLdrModPE.c \
211 $(IPRT_PATH_KLDR)/kLdrModMachO.c \
212 $(IPRT_PATH_KLDR)/kLdrModNative.c \
213 $(IPRT_PATH_KLDR)/kLdrMisc.c \
214 $(IPRT_PATH_KLDR)/kLdrRdr.c \
215 $(IPRT_PATH_KLDR)/kLdrHlpStr.c
216# We Implement these using IPRT facilities.
217# $(IPRT_PATH_KLDR)/kLdrHlp.c \
218# $(IPRT_PATH_KLDR)/kLdrHlpHeap.c \
219# $(IPRT_PATH_KLDR)/kLdrHlpSem.c \
220# $(IPRT_PATH_KLDR)/kLdrHlpMem.c \
221# $(IPRT_PATH_KLDR)/kLdrHlpPath.c
222
223endif
224
225# VBox specific stuff.
226RuntimeR3_SOURCES += \
227 VBox/strformat-vbox.cpp \
228 VBox/log-vbox.cpp
229
230RuntimeR3_SOURCES.win = \
231 generic/RTDirQueryInfo-generic.cpp \
232 generic/RTDirSetTimes-generic.cpp \
233 generic/semsrw-generic.cpp \
234 generic/semnoint-generic.cpp \
235 generic/rand-stubs-generic.cpp \
236 nt/RTErrConvertFromNtStatus.cpp \
237 win32/errmsgwin.cpp \
238 r3/win32/alloc-win32.cpp \
239 r3/win32/dir-win32.cpp \
240 r3/win32/fileio-win32.cpp \
241 r3/win32/fs-win32.cpp \
242 r3/win32/ldrNative-win32.cpp \
243 r3/win32/path-win32.cpp \
244 r3/win32/process-win32.cpp \
245 r3/win32/RTLogWriteDebugger-win32.cpp \
246 r3/win32/sched-win32.cpp \
247 r3/win32/sems-win32.cpp \
248 r3/win32/system-win32.cpp \
249 r3/win32/thread-win32.cpp \
250 r3/win32/time-win32.cpp \
251 r3/win32/timer-win32.cpp \
252 r3/win32/utf16locale-win32.cpp \
253 r3/win32/utf8-win32.cpp \
254 r3/win32/uuid-win32.cpp \
255 timesup.cpp \
256 win32/RTErrConvertFromWin32.cpp
257
258RuntimeR3_SOURCES.win.amd64 = \
259 $(RuntimeWin64ASM_SOURCES)
260
261RuntimeR3_SOURCES.linux = \
262 generic/RTDirQueryInfo-generic.cpp \
263 generic/RTDirSetTimes-generic.cpp \
264 generic/RTFileMove-generic.cpp \
265 generic/RTLogWriteDebugger-generic.cpp \
266 generic/pathhost-generic.cpp \
267 generic/uuid-generic.cpp \
268 r3/linux/sched-linux.cpp \
269 r3/posix/alloc-posix.cpp \
270 r3/posix/dir-posix.cpp \
271 r3/posix/fileio-posix.cpp \
272 r3/posix/fs-posix.cpp \
273 r3/posix/ldrNative-posix.cpp \
274 r3/posix/path-posix.cpp \
275 r3/posix/process-posix.cpp \
276 r3/posix/rand-posix.cpp \
277 r3/posix/system-posix.cpp \
278 r3/posix/thread-posix.cpp \
279 r3/posix/time-posix.cpp \
280 r3/posix/timer-posix.cpp \
281 generic/utf16locale-generic.cpp \
282 r3/posix/utf8-posix.cpp \
283 timesup.cpp
284ifeq ($(BUILD_TARGET_ARCH),amd64)
285 RuntimeR3_SOURCES.linux += r3/linux/sems-linux.cpp
286else
287 RuntimeR3_SOURCES.linux += r3/posix/sems-posix.cpp
288endif
289
290RuntimeR3_SOURCES.os2 = \
291 generic/RTDirQueryInfo-generic.cpp \
292 generic/RTDirSetTimes-generic.cpp \
293 generic/RTFileMove-generic.cpp \
294 generic/RTLogWriteDebugger-generic.cpp \
295 generic/pathhost-generic.cpp \
296 generic/rand-stubs-generic.cpp \
297 generic/semsrw-generic.cpp \
298 generic/semnoint-generic.cpp \
299 generic/sched-generic.cpp \
300 generic/uuid-generic.cpp \
301 os2/RTErrConvertFromOS2.cpp \
302 r3/os2/sems-os2.cpp \
303 r3/os2/system-os2.cpp \
304 r3/os2/thread-os2.cpp \
305 r3/posix/alloc-posix.cpp \
306 r3/posix/dir-posix.cpp \
307 r3/posix/fileio-posix.cpp \
308 r3/posix/fs-posix.cpp \
309 r3/posix/ldrNative-posix.cpp \
310 r3/posix/path-posix.cpp \
311 r3/posix/process-posix.cpp \
312 r3/posix/time-posix.cpp \
313 r3/posix/timer-posix.cpp \
314 generic/utf16locale-generic.cpp \
315 r3/posix/utf8-posix.cpp \
316 timesup.cpp \
317
318RuntimeR3_SOURCES.darwin = \
319 generic/RTDirQueryInfo-generic.cpp \
320 generic/RTDirSetTimes-generic.cpp \
321 generic/RTFileMove-generic.cpp \
322 generic/RTLogWriteDebugger-generic.cpp \
323 generic/pathhost-generic.cpp \
324 generic/sched-generic.cpp \
325 generic/timer-generic.cpp \
326 generic/utf16locale-generic.cpp \
327 generic/uuid-generic.cpp\
328 r3/darwin/alloc-darwin.cpp \
329 r3/posix/dir-posix.cpp \
330 r3/posix/fileio-posix.cpp \
331 r3/posix/fs-posix.cpp \
332 r3/posix/ldrNative-posix.cpp \
333 r3/posix/path-posix.cpp \
334 r3/posix/process-posix.cpp \
335 r3/posix/rand-posix.cpp \
336 r3/posix/sems-posix.cpp \
337 r3/posix/system-posix.cpp \
338 r3/posix/thread-posix.cpp \
339 r3/posix/utf8-posix.cpp \
340 r3/darwin/time-darwin.cpp \
341 timesup.cpp \
342
343## @todo Make BSD sched.
344RuntimeR3_SOURCES.freebsd = \
345 generic/RTDirQueryInfo-generic.cpp \
346 generic/RTDirSetTimes-generic.cpp \
347 generic/RTFileMove-generic.cpp \
348 generic/RTLogWriteDebugger-generic.cpp \
349 generic/pathhost-generic.cpp \
350 generic/sched-generic.cpp \
351 generic/uuid-generic.cpp \
352 r3/freebsd/alloc-freebsd.cpp \
353 r3/posix/dir-posix.cpp \
354 r3/posix/fileio-posix.cpp \
355 r3/posix/fs-posix.cpp \
356 r3/posix/ldrNative-posix.cpp \
357 r3/posix/path-posix.cpp \
358 r3/posix/process-posix.cpp \
359 r3/posix/rand-posix.cpp \
360 r3/posix/sems-posix.cpp \
361 r3/posix/system-posix.cpp \
362 r3/posix/thread-posix.cpp \
363 r3/posix/time-posix.cpp \
364 r3/posix/timer-posix.cpp \
365 generic/utf16locale-generic.cpp \
366 r3/posix/utf8-posix.cpp \
367 timesup.cpp \
368
369## PORTME: Porters add their selection of platform specific files for Ring-3 here.
370
371
372#
373# L4 RuntimeR3 subtarget since L4 headers won't work with VBOXR3.
374#
375RuntimeR3L4_TEMPLATE = VBOXR3NP
376RuntimeR3L4_DEFS = IN_RT_R3 IN_SUP_R3 LDR_WITH_NATIVE LDR_WITH_ELF LDR_WITH_PE
377RuntimeR3L4_INCS = $(L4_INCDIR) \
378 $(PATH_ROOT)/src/libs/libuuid
379
380RuntimeR3L4_SOURCES = \
381 generic/RTDirQueryInfo-generic.cpp \
382 generic/RTDirSetTimes-generic.cpp \
383 generic/RTFileMove-generic.cpp \
384 generic/RTLogWriteDebugger-generic.cpp \
385 generic/fs-stubs-generic.cpp \
386 generic/pathhost-generic.cpp \
387 generic/sched-generic.cpp \
388 generic/semsrw-generic.cpp \
389 generic/semnoint-generic.cpp \
390 generic/uuid-generic.cpp \
391 l4/l4-errno.cpp \
392 l4/process-l4env.cpp \
393 l4/sems-l4env.cpp \
394 l4/system-l4env.cpp \
395 l4/thread-l4env.cpp \
396 l4/timer-l4env.cpp \
397 generic/utf16locale-generic.cpp \
398 l4/utf8-l4env.cpp \
399 r3/posix/alloc-posix.cpp \
400 r3/posix/dir-posix.cpp \
401 r3/posix/fileio-posix.cpp \
402 r3/posix/ldrNative-posix.cpp \
403 r3/posix/path-posix.cpp \
404 r3/posix/rand-posix.cpp \
405 r3/posix/time-posix.cpp \
406 timesup.cpp
407
408#
409# RuntimeW32GuestR3 - Win32 guest program runtime.
410#
411RuntimeW32GuestR3_TEMPLATE = VBOXW32GUESTR3LIB
412RuntimeW32GuestR3_SDKS = WINPSDK W2K3DDK
413RuntimeW32GuestR3_DEFS = IN_RT_R3 IN_SUP_R3 LDR_WITH_NATIVE LDR_WITH_ELF32 LDR_WITH_PE RT_WITH_VBOX
414ifdef IPRT_WITH_KLDR
415 RuntimeW32GuestR3_DEFS += LDR_WITH_KLDR KLDR_USE_CRT
416 RuntimeW32GuestR3_DEFS.debug += KLDRMOD_STRICT KLDRMODLX_STRICT KLDRMODPE_STRICT KLDRMODNATIVE_STRICT KLDRRDR_STRICT
417endif
418RuntimeW32GuestR3_SOURCES = $(RuntimeR3_SOURCES.win) $(RuntimeR3_SOURCES)
419RuntimeW32GuestR3_INCS = $(RuntimeR3_INCS.win) $(RuntimeR3_INCS)
420
421
422#
423# RuntimeLnx32GuestR3 - 32-bit Linux guest program runtime.
424#
425RuntimeLnx32GuestR3_TEMPLATE = VBOXLNX32GUESTR3LIB
426RuntimeLnx32GuestR3_DEFS = IN_RT_R3 IN_SUP_R3 LDR_WITH_NATIVE LDR_WITH_ELF32 LDR_WITH_PE RT_WITH_VBOX
427ifdef IPRT_WITH_KLDR
428 RuntimeLnx32GuestR3_DEFS += LDR_WITH_KLDR KLDR_USE_CRT
429 RuntimeLnx32GuestR3_DEFS.debug += KLDRMOD_STRICT KLDRMODLX_STRICT KLDRMODPE_STRICT KLDRMODNATIVE_STRICT KLDRRDR_STRICT
430endif
431RuntimeLnx32GuestR3_SOURCES = $(RuntimeR3_SOURCES.linux) $(RuntimeR3_SOURCES)
432RuntimeLnx32GuestR3_INCS = $(RuntimeR3_INCS.linux) $(RuntimeR3_INCS)
433
434
435#
436# VBoxRT - Shared Object / DLL version.
437#
438VBoxRT_TEMPLATE = VBOXR3
439VBoxRT_SDKS.win = WINPSDK W2K3DDK VBOX_NTDLL
440VBoxRT_DEFS = $(RuntimeR3_DEFS) IN_SUP_R3 IN_SUP_R3
441VBoxRT_DEFS.$(BUILD_TYPE) = $(RuntimeR3_DEFS.$(BUILD_TYPE))
442VBoxRT_SOURCES = \
443 VBox/VBoxRTDeps.cpp \
444 $(RuntimeR3_SOURCES)
445VBoxRT_SOURCES.$(BUILD_TARGET) = $(RuntimeR3_SOURCES.$(BUILD_TARGET))
446VBoxRT_SOURCES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH) = $(RuntimeR3_SOURCES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH))
447VBoxRT_SOURCES.win += r3/win32/dllmain-win32.cpp
448VBoxRT_SOURCES.win.amd64 += r3/win64/VBoxRT-win64.def
449VBoxRT_INCS = $(RuntimeR3_INCS)
450VBoxRT_INCS.$(BUILD_TARGET) = $(RuntimeR3_INCS.$(BUILD_TARGET))
451VBoxRT_INCS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH) = $(RuntimeR3_INCS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH))
452VBoxRT_LIBS = \
453 $(PATH_LIB)/SUPR3$(VBOX_SUFF_LIB) \
454 $(PATH_LIB)/VBox-liblzf$(VBOX_SUFF_LIB)
455VBoxRT_LIBS.darwin = \
456 iconv
457VBoxRT_LIBS.freebsd = \
458 iconv
459VBoxRT_LIBPATH.freebsd = \
460 /usr/local/lib
461VBoxRT_LDFLAGS.darwin = -framework IOKit
462ifdef VBOX_USE_VCC80
463VBoxRT_LDFLAGS.win = /MANIFEST
464endif
465VBoxRT_LDFLAGS.l4 = \
466 -Wl,-whole-archive \
467 $(PATH_LIB)/RuntimeR3L4$(VBOX_SUFF_LIB) \
468 -Wl,-no-whole-archive
469ifeq ($(BUILD_TARGET),l4)
470VBoxRT_LIBS += \
471 $(L4_LIBDIR)/libl4sys.a \
472 $(L4_LIBDIR)/libl4sys.p.a
473endif
474VBoxRT_LIBS.l4 = \
475 $(PATH_LIB)/VBox-uuid$(VBOX_SUFF_LIB) \
476 $(PATH_LIB)/RuntimeR3L4$(VBOX_SUFF_LIB)
477
478#
479# RuntimeR3NoCRTGCC - CRT replacement lib for VBoxREM.
480# This is used together with VBoxRT.
481#
482RuntimeR3NoCRTGCC_TEMPLATE = VBOXNOCRTGCC
483RuntimeR3NoCRTGCC_LIBSUFF = $(VBOX_SUFF_LIB)
484RuntimeR3NoCRTGCC_SOURCES = \
485 misc/sanity-cpp.cpp \
486 misc/sanity-c.c \
487 \
488 math/ceill.asm \
489 math/cosl.asm \
490 math/fabs.asm \
491 math/fabsf.asm \
492 math/fabsl.asm \
493 math/floor.asm \
494 math/floorf.asm \
495 math/floorl.asm \
496 math/ldexpl.asm \
497 math/llrint.asm \
498 math/llrintf.asm \
499 math/llrintl.asm \
500 math/logl.asm \
501 math/lrint.asm \
502 math/lrintf.asm \
503 math/lrintl.asm \
504 math/remainder.asm \
505 math/remainderf.asm \
506 math/remainderl.asm \
507 math/sinl.asm \
508 math/tanl.asm \
509 math/trunc.asm \
510 math/truncf.asm \
511 math/truncl.asm \
512 \
513 misc/setjmp.asm \
514 \
515 string/memchr.asm \
516 string/memchr_alias.c \
517 string/memcpy.asm \
518 string/memcpy_alias.c \
519 string/mempcpy.asm \
520 string/memset.asm \
521 string/memset_alias.c
522
523RuntimeR3NoCRTGCC_SOURCES.x86 = \
524 math/x86/fenv-x86.c \
525 math/gcc/adddi3.c \
526 math/gcc/anddi3.c \
527 math/gcc/ashldi3.c \
528 math/gcc/ashrdi3.c \
529 math/gcc/cmpdi2.c \
530 math/gcc/divdi3.c \
531 math/gcc/iordi3.c \
532 math/gcc/lshldi3.c \
533 math/gcc/lshrdi3.c \
534 math/gcc/moddi3.c \
535 math/gcc/muldi3.c \
536 math/gcc/negdi2.c \
537 math/gcc/notdi2.c \
538 math/gcc/qdivrem.c \
539 math/gcc/subdi3.c \
540 math/gcc/ucmpdi2.c \
541 math/gcc/udivdi3.c \
542 math/gcc/umoddi3.c \
543 math/gcc/xordi3.c
544
545
546## @todo stop using the old memcpy.c and memset.c code.
547
548#
549# RuntimeR0 - Ring0 library for VMMR0.
550#
551RuntimeR0_TEMPLATE = VBOXR0
552RuntimeR0_DEFS = IN_RT_R0 RT_WITH_VBOX
553RuntimeR0_SOURCES = \
554 misc/sanity-cpp.cpp \
555 misc/sanity-c.c \
556 assert.cpp \
557 table/avlhcphys.cpp \
558 table/avlgcptr.cpp \
559 table/avlogcphys.cpp \
560 table/avlohcphys.cpp \
561 table/avlpv.cpp \
562 table/avlrogcphys.cpp \
563 table/avlogcptr.cpp \
564 table/avlrogcptr.cpp \
565 table/avlroogcptr.cpp \
566 table/avloioport.cpp \
567 table/avlroioport.cpp \
568 logcom.cpp \
569 logformat.cpp \
570 strformat.cpp \
571 strformatrt.cpp \
572 strprintf.cpp \
573 string/memchr.cpp \
574 string/memcmp.cpp \
575 string/memcpy.cpp \
576 string/memset.cpp \
577 string/strcpy.cpp \
578 string/strlen.cpp \
579 string/strncmp.cpp \
580 string/strpbrk.cpp \
581 VBox/strformat-vbox.cpp \
582 timesup.cpp
583
584RuntimeR0_SOURCES.win.amd64 = $(RuntimeWin64ASM_SOURCES)
585
586RuntimeR0_SOURCES.os2 = \
587 os2/RTErrConvertFromOS2.cpp \
588 os2/sys0.asm
589
590RuntimeR0_SOURCES.darwin.x86 = \
591 math/gcc/adddi3.c \
592 math/gcc/anddi3.c \
593 math/gcc/ashldi3.c \
594 math/gcc/ashrdi3.c \
595 math/gcc/cmpdi2.c \
596 math/gcc/divdi3.c \
597 math/gcc/iordi3.c \
598 math/gcc/lshldi3.c \
599 math/gcc/lshrdi3.c \
600 math/gcc/moddi3.c \
601 math/gcc/muldi3.c \
602 math/gcc/negdi2.c \
603 math/gcc/notdi2.c \
604 math/gcc/qdivrem.c \
605 math/gcc/subdi3.c \
606 math/gcc/ucmpdi2.c \
607 math/gcc/udivdi3.c \
608 math/gcc/umoddi3.c \
609 math/gcc/xordi3.c
610
611
612string/memchr.cpp_CXXFLAGS.win = -Oi-
613string/memcmp.cpp_CXXFLAGS.win = -Oi-
614string/memcpy.cpp_CXXFLAGS.win = -Oi-
615string/memset.cpp_CXXFLAGS.win = -Oi-
616string/strcpy.cpp_CXXFLAGS.win = -Oi-
617string/strlen.cpp_CXXFLAGS.win = -Oi-
618
619ifeq ($(BUILD_TARGET),l4)
620RuntimeR0Drv_BLD_TRG = linux
621RuntimeR0Drv_BLD_TRG_ARCH = x86
622RuntimeR0Drv_BLD_TRG_CPU = i386
623endif
624
625#
626# RuntimeR0Drv - Ring0 library for host drivers.
627#
628RuntimeR0Drv_TEMPLATE = VBOXR0DRV
629RuntimeR0Drv_SDKS.win = W2K3DDK WINPSDKINCS
630RuntimeR0Drv_DEFS = IN_RT_R0 RT_WITH_VBOX RT_WITHOUT_NOCRT_WRAPPERS
631RuntimeR0Drv_DEFS.win = IN_SUP_R0
632RuntimeR0Drv_DEFS.linux = MODULE KBUILD_MODNAME=KBUILD_STR\(vboxdrv\) KBUILD_BASENAME=KBUILD_STR\(vboxdrv\) IN_SUP_R0 # why is IN_SUP_R0 here? because!
633
634RuntimeR0Drv_INCS.linux = \
635 r0drv/linux
636
637RuntimeR0Drv_SOURCES = \
638 misc/sanity-cpp.cpp \
639 misc/sanity-c.c \
640 assert.cpp \
641 log.cpp \
642 logcom.cpp \
643 logformat.cpp \
644 string/strpbrk.cpp \
645 strformat.cpp \
646 strformatrt.cpp \
647 strtonum.cpp \
648 strprintf.cpp \
649 VBox/strformat-vbox.cpp \
650 r0drv/alloc-r0drv.cpp \
651 r0drv/initterm-r0drv.cpp \
652 generic/RTLogWriteStdErr-stub-generic.cpp \
653 generic/RTLogWriteStdOut-stub-generic.cpp \
654 generic/RTLogWriteUser-generic.cpp \
655 VBox/log-vbox.cpp \
656 table/avlpv.cpp \
657 crc32.cpp \
658 crc64.cpp
659
660RuntimeR0Drv_SOURCES.linux = \
661 alloc/heapsimple.cpp \
662 r0drv/linux/alloc-r0drv-linux.c \
663 r0drv/linux/initterm-r0drv-linux.c \
664 r0drv/linux/process-r0drv-linux.c \
665 r0drv/linux/RTLogWriteDebugger-r0drv-linux.c \
666 r0drv/linux/semaphore-r0drv-linux.c \
667 r0drv/linux/spinlock-r0drv-linux.c \
668 r0drv/linux/thread-r0drv-linux.c
669
670RuntimeR0Drv_SOURCES.win = \
671 nt/RTErrConvertFromNtStatus.cpp \
672 r0drv/nt/alloc-r0drv-nt.cpp \
673 r0drv/nt/initterm-r0drv-nt.cpp \
674 r0drv/nt/process-r0drv-nt.cpp \
675 r0drv/nt/RTLogWriteDebugger-r0drv-nt.cpp \
676 r0drv/nt/semaphore-r0drv-nt.cpp \
677 r0drv/nt/spinlock-r0drv-nt.cpp \
678 r0drv/nt/thread-r0drv-nt.cpp \
679 string/strncmp.cpp
680
681RuntimeR0Drv_SOURCES.win.amd64 = \
682 $(RuntimeWin64ASM_SOURCES)
683
684RuntimeR0Drv_SOURCES.darwin = \
685 RTErrConvertFromErrno.cpp \
686 string/memchr.asm \
687 r0drv/memobj-r0drv.cpp \
688 r0drv/darwin/alloc-r0drv-darwin.cpp \
689 r0drv/darwin/memobj-r0drv-darwin.cpp \
690 r0drv/darwin/initterm-r0drv-darwin.cpp \
691 r0drv/darwin/process-r0drv-darwin.cpp \
692 r0drv/darwin/RTLogWriteDebugger-r0drv-darwin.cpp \
693 r0drv/darwin/semaphore-r0drv-darwin.cpp \
694 r0drv/darwin/spinlock-r0drv-darwin.cpp \
695 r0drv/darwin/thread-r0drv-darwin.cpp \
696 r0drv/darwin/thread2-r0drv-darwin.cpp \
697 r0drv/darwin/time-r0drv-darwin.cpp \
698 thread.cpp \
699 generic/timer-generic.cpp \
700
701RuntimeR0Drv_SOURCES.os2 = \
702 os2/RTErrConvertFromOS2.cpp \
703 os2/sys0.asm
704
705## PORTME: Porters create and add their selection of platform specific Ring-0 Driver files here.
706
707#
708# RuntimeW32GuestR0 - Win32 guest driver runtime.
709#
710RuntimeW32GuestR0_TEMPLATE = VBOXW32GUESTR0LIB
711RuntimeW32GuestR0_SDKS = W2K3DDKX86 WINPSDKINCS
712RuntimeW32GuestR0_DEFS = IN_RT_R0 RT_WITH_VBOX RT_WITHOUT_NOCRT_WRAPPERS IN_SUP_R0
713RuntimeW32GuestR0_SOURCES = \
714 $(RuntimeR0Drv_SOURCES) \
715 $(RuntimeR0Drv_SOURCES.win) \
716 VBox/logbackdoor.cpp \
717 logR0.cpp
718ifdef VBOX_USE_VCC80
719RuntimeW32GuestR0_SOURCES += \
720 string/memchr.cpp \
721 string/memcmp.cpp \
722 string/memcpy.cpp \
723 string/memset.cpp \
724 string/strlen.cpp
725endif
726
727
728#
729# RuntimeW32NT4GuestR0 - Win32 NT4 guest driver runtime.
730#
731RuntimeW32NT4GuestR0_TEMPLATE = VBOXW32GUESTR0LIB
732RuntimeW32NT4GuestR0_SDKS = $(RuntimeW32GuestR0_SDKS)
733RuntimeW32NT4GuestR0_DEFS = $(RuntimeW32GuestR0_DEFS) IPRT_TARGET_NT4
734RuntimeW32NT4GuestR0_INCS = $(RuntimeW32GuestR0_INCS)
735RuntimeW32NT4GuestR0_SOURCES = $(RuntimeW32GuestR0_SOURCES)
736
737
738#
739# RuntimeLnx32GuestR0 - 32-bit Linux guest driver runtime.
740#
741RuntimeLnx32GuestR0_TEMPLATE = VBOXLNX32GUESTR0
742RuntimeLnx32GuestR0_DEFS = RT_WITH_VBOX RT_WITHOUT_NOCRT_WRAPPERS IN_SUP_R0 \
743 MODULE KBUILD_MODNAME=KBUILD_STR\(vboxdrv\) KBUILD_BASENAME=KBUILD_STR\(vboxdrv\)
744RuntimeLnx32GuestR0_INCS = $(RuntimeR0Drv_INCS.linux) $(RuntimeR0Drv_INCS)
745RuntimeLnx32GuestR0_SOURCES = \
746 $(RuntimeR0Drv_SOURCES) \
747 $(RuntimeR0Drv_SOURCES.linux) \
748 VBox/logbackdoor.cpp
749
750#
751# RuntimeGC - Guest context library.
752#
753RuntimeGC_TEMPLATE = VBOXGC
754RuntimeGC_DEFS = IN_RT_GC RT_WITH_VBOX
755RuntimeGC_SOURCES = \
756 misc/sanity-cpp.cpp \
757 misc/sanity-c.c \
758 table/avlogcphys.cpp \
759 table/avlrogcphys.cpp \
760 table/avlogcptr.cpp \
761 table/avlohcphys.cpp \
762 table/avlrogcptr.cpp \
763 table/avlroogcptr.cpp \
764 table/avloioport.cpp \
765 table/avlroioport.cpp \
766 assert.cpp \
767 log.cpp \
768 logcom.cpp \
769 logformat.cpp \
770 string/strpbrk.cpp \
771 string/strncmp.cpp \
772 strformat.cpp \
773 strformatrt.cpp \
774 strprintf.cpp \
775 VBox/strformat-vbox.cpp \
776 timesup.cpp \
777 string/memchr.cpp \
778 string/memcmp.cpp \
779 string/memcpy.cpp \
780 string/memset.cpp \
781 string/strcpy.cpp \
782 string/strlen.cpp
783
784ifeq ($(VBOX_LDR_FMT32),lx)
785RuntimeGC_SOURCES += os2/sys0.asm
786endif
787
788RuntimeGC_SOURCES.darwin = \
789 math/gcc/adddi3.c \
790 math/gcc/anddi3.c \
791 math/gcc/ashldi3.c \
792 math/gcc/ashrdi3.c \
793 math/gcc/cmpdi2.c \
794 math/gcc/divdi3.c \
795 math/gcc/iordi3.c \
796 math/gcc/lshldi3.c \
797 math/gcc/lshrdi3.c \
798 math/gcc/moddi3.c \
799 math/gcc/muldi3.c \
800 math/gcc/negdi2.c \
801 math/gcc/notdi2.c \
802 math/gcc/qdivrem.c \
803 math/gcc/subdi3.c \
804 math/gcc/ucmpdi2.c \
805 math/gcc/udivdi3.c \
806 math/gcc/umoddi3.c \
807 math/gcc/xordi3.c
808
809
810#
811# Static library for new & delete for the electric fence.
812#
813RuntimeEFCPP_TEMPLATE = $(RuntimeR3_TEMPLATE)
814RuntimeEFCPP_SDKS = $(RuntimeR3_SDKS)
815RuntimeEFCPP_SDKS.$(BUILD_TARGET) = $(RuntimeR3_SDKS.$(BUILD_TARGET))
816RuntimeEFCPP_DEFS = $(RuntimeR3_DEFS)
817RuntimeEFCPP_DEFS.$(BUILD_TARGET) = $(RuntimeR3_DEFS.$(BUILD_TARGET))
818RuntimeEFCPP_INCS = $(RuntimeR3_INCS)
819RuntimeEFCPP_INCS.$(BUILD_TARGET) = $(RuntimeR3_INCS.$(BUILD_TARGET))
820RuntimeEFCPP_SOURCES = r3/alloc-ef-cpp.cpp
821
822
823
824#
825# errmsg.cpp depends on a generated header.
826#
827errmsg.cpp_DEPS = $(PATH_TARGET)/errmsgdata.h
828errmsg.cpp_INCS = $(PATH_TARGET)
829
830win32/errmsgwin.cpp_DEPS = $(PATH_TARGET)/errmsgcomdata.h
831win32/errmsgwin.cpp_INCS = $(PATH_TARGET)
832
833linux/errmsglinux.cpp_DEPS = $(PATH_TARGET)/errmsgxpcomdata.h
834linux/errmsglinux.cpp_INCS = $(PATH_TARGET)
835
836
837# Generate the rules
838include $(PATH_KBUILD)/footer.kmk
839
840
841#
842# Generate the status code data.
843#
844$(PATH_TARGET)/errmsgdata.h: errmsg.sed $(DEPTH)/include/iprt/err.h $(DEPTH)/include/VBox/err.h
845 $(call MSG_L1,Generating $@)
846 $(QUIET)$(MKDIR) -p $(PATH_TARGET)
847 $(QUIET)$(SED) -f $< $(filter %.h,$^) > $@
848## @todo r=bird: rename this to indicate that it's not only COM errors, but all win32/64 errors.
849$(PATH_TARGET)/errmsgcomdata.h: errmsgcom.sed $(PATH_SDK_WINPSDK_INC)/WinError.h
850 $(call MSG_L1,Generating $@)
851 $(QUIET)$(MKDIR) -p $(PATH_TARGET)
852 $(QUIET)$(SED) -f $< $(filter %.h,$^) > $@
853$(PATH_TARGET)/errmsgxpcomdata.h: errmsgxpcom.sed $(DEPTH)/src/libs/xpcom18a4/xpcom/base/nsError.h
854 $(call MSG_L1,Generating $@)
855 $(QUIET)$(MKDIR) -p $(PATH_TARGET)
856 $(QUIET)$(SED) -f $< $(filter %.h,$^) > $@
857
858
859#
860# Aliases for .cpp.h files so we can more easily do syntax checking from the editor.
861#
862ldrELFRelocatable.cpp.o: ldrELF.o
863ldrELFRelocatable.cpp.obj: ldrELF.obj
864
865
866#
867# Doxygen documentation.
868#
869DOXYGEN_INPUT_DIRS = \
870 $(PATH_ROOT)/include/iprt \
871 $(PATH_ROOT)/include/iprt/nocrt \
872 $(PATH_ROOT)/include/iprt/nocrt/x86 \
873 $(PATH_ROOT)/include/iprt/nocrt/amd64 \
874 include/internal \
875 string \
876 table \
877 $(foreach dir, . r3 r0drv,\
878 $(dir) \
879 $(dir)/darwin \
880 $(dir)/l4 \
881 $(dir)/linux \
882 $(dir)/nt \
883 $(dir)/os2 \
884 $(dir)/win \
885 $(dir)/win32 \
886 $(dir)/win64 \
887 $(dir)/generic \
888 )
889
890# These must come first in order to make things look nice.
891DOXYGEN_INPUT_FIRST =\
892 $(PATH_ROOT)/include/iprt/cdefs.h \
893 $(PATH_ROOT)/include/iprt/types.h \
894 $(PATH_ROOT)/include/iprt/runtime.h \
895 $(PATH_ROOT)/include/iprt/param.h \
896 $(PATH_ROOT)/include/iprt/assert.h \
897 $(PATH_ROOT)/include/iprt/asm.h \
898
899DOXYGEN_INPUT := \
900 $(filter-out %.cpp.h, $(sort $(wildcard $(addsuffix /*.h, $(DOXYGEN_INPUT_DIRS)))) ) \
901 $(foreach dir, $(DOXYGEN_INPUT_DIRS), $(wildcard $(dir)/*.cpp $(dir)/.c $(dir)/.asm))
902DOXYGEN_INPUT := \
903 $(DOXYGEN_INPUT_FIRST) \
904 $(filter-out $(DOXYGEN_INPUT_FIRST), $(DOXYGEN_INPUT))
905
906
907DOXYGEN_OUTPUT = $(PATH_OUT)/docs/iprt
908
909-include $(PATH_TARGET)/Doxyfile.dep
910
911# Generate the Doxyfile
912$(PATH_TARGET)/Doxyfile: Doxyfile \
913 $(comp-vars DOXYGEN_INPUT,DOXYGEN_INPUT_PREV,FORCE) \
914 $(comp-vars DOXYGEN_OUTPUT,DOXYGEN_OUTPUT_PREV,FORCE) \
915 | $(call DIRDEP, $(PATH_TARGET))
916 $(RM) -f $@ $@.tmp $(PATH_TARGET)/Doxyfile.dep
917 $(CP) -f Doxyfile $@.tmp
918 $(APPEND) $@.tmp
919 $(APPEND) $@.tmp "OUTPUT_DIRECTORY = $(DOXYGEN_OUTPUT)"
920 $(APPEND) $@.tmp "WARN_LOGFILE = $(DOXYGEN_OUTPUT)/errors"
921 $(APPEND) $@.tmp "INCLUDE_PATH = $(PATH_ROOT)/include include . table"
922 $(APPEND) $@.tmp "INCLUDE_FILE_PATTERNS = *.cpp.h"
923 $(APPEND) $@.tmp
924 $(APPEND) $@.tmp "INPUT = $(DOXYGEN_INPUT)"
925 $(APPEND) $@.tmp
926 $(MV) -f $@.tmp $@
927 @$(APPEND) $(PATH_TARGET)/Doxyfile.dep "DOXYGEN_OUTPUT_PREV = $(DOXYGEN_OUTPUT)"
928 @$(APPEND) $(PATH_TARGET)/Doxyfile.dep "DOXYGEN_INPUT_PREV = $(DOXYGEN_INPUT)"
929
930# Create the output directory.
931$(call DIRDEP, $(DOXYGEN_OUTPUT)):
932 $(MKDIR) -p $@
933
934# Do the actual job.
935$(PATH_TARGET)/docs.iprt: $(PATH_TARGET)/Doxyfile $(DOXYGEN_INPUT) | $(call DIRDEP, $(DOXYGEN_OUTPUT))
936 $(RM) -f $(wildcard $(DOXYGEN_OUTPUT)/html/*) $(PATH_TARGET)/docs.iprt
937 doxygen $(PATH_TARGET)/Doxyfile
938 $(APPEND) $(PATH_TARGET)/docs.iprt
939
940# alias
941docs: $(PATH_TARGET)/docs.iprt
942
943test:
944 @echo test-$(comp-vars DOXYGEN_OUTPUT,DOXYGEN_OUTPUT_PREV,FORCE)
945 @echo $(DOXYGEN_OUTPUT)
946 @echo $(DOXYGEN_OUTPUT_PREV)
947
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette