VirtualBox

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

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

Made it built (but currently disabled).

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