VirtualBox

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

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

memcmp, strchr, strcmp.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 25.9 KB
Line 
1# $Id: Makefile 1174 2007-03-03 23:49:53Z 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/RTAssertDoBreakpoint-vbox.cpp \
229 VBox/log-vbox.cpp
230
231RuntimeR3_SOURCES.win = \
232 generic/RTDirQueryInfo-generic.cpp \
233 generic/RTDirSetTimes-generic.cpp \
234 generic/semsrw-generic.cpp \
235 generic/semnoint-generic.cpp \
236 generic/rand-stubs-generic.cpp \
237 nt/RTErrConvertFromNtStatus.cpp \
238 win32/errmsgwin.cpp \
239 r3/posix/env-posix.cpp \
240 r3/win32/alloc-win32.cpp \
241 r3/win32/dir-win32.cpp \
242 r3/win32/fileio-win32.cpp \
243 r3/win32/fs-win32.cpp \
244 r3/win32/ldrNative-win32.cpp \
245 r3/win32/path-win32.cpp \
246 r3/win32/process-win32.cpp \
247 r3/win32/RTLogWriteDebugger-win32.cpp \
248 r3/win32/sched-win32.cpp \
249 r3/win32/sems-win32.cpp \
250 r3/win32/system-win32.cpp \
251 r3/win32/thread-win32.cpp \
252 r3/win32/time-win32.cpp \
253 r3/win32/timer-win32.cpp \
254 r3/win32/utf16locale-win32.cpp \
255 r3/win32/utf8-win32.cpp \
256 r3/win32/uuid-win32.cpp \
257 timesup.cpp \
258 win32/RTErrConvertFromWin32.cpp
259
260RuntimeR3_SOURCES.win.amd64 = \
261 $(RuntimeWin64ASM_SOURCES)
262
263RuntimeR3_SOURCES.linux = \
264 generic/RTDirQueryInfo-generic.cpp \
265 generic/RTDirSetTimes-generic.cpp \
266 generic/RTFileMove-generic.cpp \
267 generic/RTLogWriteDebugger-generic.cpp \
268 generic/pathhost-generic.cpp \
269 generic/uuid-generic.cpp \
270 r3/linux/sched-linux.cpp \
271 r3/posix/alloc-posix.cpp \
272 r3/posix/dir-posix.cpp \
273 r3/posix/env-posix.cpp \
274 r3/posix/fileio-posix.cpp \
275 r3/posix/fs-posix.cpp \
276 r3/posix/ldrNative-posix.cpp \
277 r3/posix/path-posix.cpp \
278 r3/posix/process-posix.cpp \
279 r3/posix/rand-posix.cpp \
280 r3/posix/system-posix.cpp \
281 r3/posix/thread-posix.cpp \
282 r3/posix/time-posix.cpp \
283 r3/posix/timer-posix.cpp \
284 generic/utf16locale-generic.cpp \
285 r3/posix/utf8-posix.cpp \
286 timesup.cpp
287ifeq ($(BUILD_TARGET_ARCH),amd64)
288 RuntimeR3_SOURCES.linux += r3/linux/sems-linux.cpp
289else
290 RuntimeR3_SOURCES.linux += r3/posix/sems-posix.cpp
291endif
292
293RuntimeR3_SOURCES.os2 = \
294 generic/RTDirQueryInfo-generic.cpp \
295 generic/RTDirSetTimes-generic.cpp \
296 generic/RTFileMove-generic.cpp \
297 generic/RTLogWriteDebugger-generic.cpp \
298 generic/pathhost-generic.cpp \
299 generic/rand-stubs-generic.cpp \
300 generic/semsrw-generic.cpp \
301 generic/semnoint-generic.cpp \
302 generic/sched-generic.cpp \
303 generic/uuid-generic.cpp \
304 os2/RTErrConvertFromOS2.cpp \
305 r3/os2/sems-os2.cpp \
306 r3/os2/system-os2.cpp \
307 r3/os2/thread-os2.cpp \
308 r3/posix/alloc-posix.cpp \
309 r3/posix/dir-posix.cpp \
310 r3/posix/env-posix.cpp \
311 r3/posix/fileio-posix.cpp \
312 r3/posix/fs-posix.cpp \
313 r3/posix/ldrNative-posix.cpp \
314 r3/posix/path-posix.cpp \
315 r3/posix/process-posix.cpp \
316 r3/posix/time-posix.cpp \
317 r3/posix/timer-posix.cpp \
318 generic/utf16locale-generic.cpp \
319 r3/posix/utf8-posix.cpp \
320 timesup.cpp \
321
322RuntimeR3_SOURCES.darwin = \
323 generic/RTDirQueryInfo-generic.cpp \
324 generic/RTDirSetTimes-generic.cpp \
325 generic/RTFileMove-generic.cpp \
326 generic/RTLogWriteDebugger-generic.cpp \
327 generic/pathhost-generic.cpp \
328 generic/sched-generic.cpp \
329 generic/timer-generic.cpp \
330 generic/utf16locale-generic.cpp \
331 generic/uuid-generic.cpp\
332 r3/darwin/alloc-darwin.cpp \
333 r3/posix/dir-posix.cpp \
334 r3/posix/env-posix.cpp \
335 r3/posix/fileio-posix.cpp \
336 r3/posix/fs-posix.cpp \
337 r3/posix/ldrNative-posix.cpp \
338 r3/posix/path-posix.cpp \
339 r3/posix/process-posix.cpp \
340 r3/posix/rand-posix.cpp \
341 r3/posix/sems-posix.cpp \
342 r3/posix/system-posix.cpp \
343 r3/posix/thread-posix.cpp \
344 r3/posix/utf8-posix.cpp \
345 r3/darwin/time-darwin.cpp \
346 timesup.cpp \
347
348## @todo Make BSD sched.
349RuntimeR3_SOURCES.freebsd = \
350 generic/RTDirQueryInfo-generic.cpp \
351 generic/RTDirSetTimes-generic.cpp \
352 generic/RTFileMove-generic.cpp \
353 generic/RTLogWriteDebugger-generic.cpp \
354 generic/pathhost-generic.cpp \
355 generic/sched-generic.cpp \
356 generic/uuid-generic.cpp \
357 r3/freebsd/alloc-freebsd.cpp \
358 r3/posix/dir-posix.cpp \
359 r3/posix/env-posix.cpp \
360 r3/posix/fileio-posix.cpp \
361 r3/posix/fs-posix.cpp \
362 r3/posix/ldrNative-posix.cpp \
363 r3/posix/path-posix.cpp \
364 r3/posix/process-posix.cpp \
365 r3/posix/rand-posix.cpp \
366 r3/posix/sems-posix.cpp \
367 r3/posix/system-posix.cpp \
368 r3/posix/thread-posix.cpp \
369 r3/posix/time-posix.cpp \
370 r3/posix/timer-posix.cpp \
371 generic/utf16locale-generic.cpp \
372 r3/posix/utf8-posix.cpp \
373 timesup.cpp \
374
375## PORTME: Porters add their selection of platform specific files for Ring-3 here.
376
377
378#
379# L4 RuntimeR3 subtarget since L4 headers won't work with VBOXR3.
380#
381RuntimeR3L4_TEMPLATE = VBOXR3NP
382RuntimeR3L4_DEFS = IN_RT_R3 IN_SUP_R3 LDR_WITH_NATIVE LDR_WITH_ELF LDR_WITH_PE
383RuntimeR3L4_INCS = $(L4_INCDIR) \
384 $(PATH_ROOT)/src/libs/libuuid
385
386RuntimeR3L4_SOURCES = \
387 generic/RTDirQueryInfo-generic.cpp \
388 generic/RTDirSetTimes-generic.cpp \
389 generic/RTFileMove-generic.cpp \
390 generic/RTLogWriteDebugger-generic.cpp \
391 generic/fs-stubs-generic.cpp \
392 generic/pathhost-generic.cpp \
393 generic/sched-generic.cpp \
394 generic/semsrw-generic.cpp \
395 generic/semnoint-generic.cpp \
396 generic/uuid-generic.cpp \
397 l4/l4-errno.cpp \
398 l4/process-l4env.cpp \
399 l4/sems-l4env.cpp \
400 l4/system-l4env.cpp \
401 l4/thread-l4env.cpp \
402 l4/timer-l4env.cpp \
403 generic/utf16locale-generic.cpp \
404 l4/utf8-l4env.cpp \
405 r3/posix/alloc-posix.cpp \
406 r3/posix/env-posix.cpp \
407 r3/posix/dir-posix.cpp \
408 r3/posix/fileio-posix.cpp \
409 r3/posix/ldrNative-posix.cpp \
410 r3/posix/path-posix.cpp \
411 r3/posix/rand-posix.cpp \
412 r3/posix/time-posix.cpp \
413 timesup.cpp
414
415#
416# RuntimeW32GuestR3 - Win32 guest program runtime.
417#
418RuntimeW32GuestR3_TEMPLATE = VBOXW32GUESTR3LIB
419RuntimeW32GuestR3_SDKS = WINPSDK W2K3DDK
420RuntimeW32GuestR3_DEFS = IN_RT_R3 IN_SUP_R3 LDR_WITH_NATIVE LDR_WITH_ELF32 LDR_WITH_PE RT_WITH_VBOX
421ifdef IPRT_WITH_KLDR
422 RuntimeW32GuestR3_DEFS += LDR_WITH_KLDR KLDR_USE_CRT
423 RuntimeW32GuestR3_DEFS.debug += KLDRMOD_STRICT KLDRMODLX_STRICT KLDRMODPE_STRICT KLDRMODNATIVE_STRICT KLDRRDR_STRICT
424endif
425RuntimeW32GuestR3_SOURCES = $(RuntimeR3_SOURCES.win) $(RuntimeR3_SOURCES)
426RuntimeW32GuestR3_INCS = $(RuntimeR3_INCS.win) $(RuntimeR3_INCS)
427
428
429#
430# RuntimeLnx32GuestR3 - 32-bit Linux guest program runtime.
431#
432RuntimeLnx32GuestR3_TEMPLATE = VBOXLNX32GUESTR3LIB
433RuntimeLnx32GuestR3_DEFS = IN_RT_R3 IN_SUP_R3 LDR_WITH_NATIVE LDR_WITH_ELF32 LDR_WITH_PE RT_WITH_VBOX
434ifdef IPRT_WITH_KLDR
435 RuntimeLnx32GuestR3_DEFS += LDR_WITH_KLDR KLDR_USE_CRT
436 RuntimeLnx32GuestR3_DEFS.debug += KLDRMOD_STRICT KLDRMODLX_STRICT KLDRMODPE_STRICT KLDRMODNATIVE_STRICT KLDRRDR_STRICT
437endif
438RuntimeLnx32GuestR3_SOURCES = $(RuntimeR3_SOURCES.linux) $(RuntimeR3_SOURCES)
439RuntimeLnx32GuestR3_INCS = $(RuntimeR3_INCS.linux) $(RuntimeR3_INCS)
440
441
442#
443# VBoxRT - Shared Object / DLL version.
444#
445VBoxRT_TEMPLATE = VBOXR3
446VBoxRT_SDKS.win = WINPSDK W2K3DDK VBOX_NTDLL
447ifeq ($(BUILD_TARGET),darwin)
448VBoxRT_INST = $(INST_DLL) $(INST_TESTCASE)
449endif
450VBoxRT_DEFS = $(RuntimeR3_DEFS) IN_SUP_R3 IN_SUP_R3
451VBoxRT_DEFS.$(BUILD_TYPE) = $(RuntimeR3_DEFS.$(BUILD_TYPE))
452VBoxRT_SOURCES = \
453 VBox/VBoxRTDeps.cpp \
454 $(RuntimeR3_SOURCES)
455VBoxRT_SOURCES.$(BUILD_TARGET) = $(RuntimeR3_SOURCES.$(BUILD_TARGET))
456VBoxRT_SOURCES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH) = $(RuntimeR3_SOURCES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH))
457VBoxRT_SOURCES.win += r3/win32/dllmain-win32.cpp
458VBoxRT_SOURCES.win.amd64 += r3/win64/VBoxRT-win64.def
459VBoxRT_INCS = $(RuntimeR3_INCS)
460VBoxRT_INCS.$(BUILD_TARGET) = $(RuntimeR3_INCS.$(BUILD_TARGET))
461VBoxRT_INCS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH) = $(RuntimeR3_INCS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH))
462VBoxRT_LIBS = \
463 $(PATH_LIB)/SUPR3$(VBOX_SUFF_LIB) \
464 $(PATH_LIB)/VBox-liblzf$(VBOX_SUFF_LIB)
465VBoxRT_LIBS.darwin = \
466 iconv
467VBoxRT_LIBS.freebsd = \
468 iconv
469VBoxRT_LIBPATH.freebsd = \
470 /usr/local/lib
471VBoxRT_LDFLAGS.darwin = -framework IOKit -install_name @executable_path/VBoxRT.dylib
472ifdef VBOX_USE_VCC80
473VBoxRT_LDFLAGS.win = /MANIFEST
474endif
475VBoxRT_LDFLAGS.l4 = \
476 -Wl,-whole-archive \
477 $(PATH_LIB)/RuntimeR3L4$(VBOX_SUFF_LIB) \
478 -Wl,-no-whole-archive
479ifeq ($(BUILD_TARGET),l4)
480VBoxRT_LIBS += \
481 $(L4_LIBDIR)/libl4sys.a \
482 $(L4_LIBDIR)/libl4sys.p.a
483endif
484VBoxRT_LIBS.l4 = \
485 $(PATH_LIB)/VBox-uuid$(VBOX_SUFF_LIB) \
486 $(PATH_LIB)/RuntimeR3L4$(VBOX_SUFF_LIB)
487
488
489#
490# RuntimeR3NoCRTGCC - CRT replacement lib for VBoxREM.
491# This is used together with VBoxRT.
492#
493RuntimeR3NoCRTGCC_TEMPLATE = VBOXNOCRTGCC
494RuntimeR3NoCRTGCC_LIBSUFF = $(VBOX_SUFF_LIB)
495RuntimeR3NoCRTGCC_SOURCES = \
496 misc/sanity-cpp.cpp \
497 misc/sanity-c.c \
498 \
499 math/ceill.asm \
500 math/cosl.asm \
501 math/fabs.asm \
502 math/fabsf.asm \
503 math/fabsl.asm \
504 math/floor.asm \
505 math/floorf.asm \
506 math/floorl.asm \
507 math/ldexpl.asm \
508 math/llrint.asm \
509 math/llrintf.asm \
510 math/llrintl.asm \
511 math/logl.asm \
512 math/lrint.asm \
513 math/lrintf.asm \
514 math/lrintl.asm \
515 math/remainder.asm \
516 math/remainderf.asm \
517 math/remainderl.asm \
518 math/sinl.asm \
519 math/tanl.asm \
520 math/trunc.asm \
521 math/truncf.asm \
522 math/truncl.asm \
523 \
524 misc/setjmp.asm \
525 \
526 string/memchr.asm \
527 string/memchr_alias.c \
528 string/memcmp.asm \
529 string/memcmp_alias.c \
530 string/memcpy.asm \
531 string/memcpy_alias.c \
532 string/mempcpy.asm \
533 string/memset.asm \
534 string/memset_alias.c \
535 string/strchr.asm \
536 string/strchr_alias.c \
537 string/strcmp.asm \
538 string/strcmp_alias.c
539
540RuntimeR3NoCRTGCC_SOURCES.x86 = \
541 math/x86/fenv-x86.c \
542 math/gcc/adddi3.c \
543 math/gcc/anddi3.c \
544 math/gcc/ashldi3.c \
545 math/gcc/ashrdi3.c \
546 math/gcc/cmpdi2.c \
547 math/gcc/divdi3.c \
548 math/gcc/iordi3.c \
549 math/gcc/lshldi3.c \
550 math/gcc/lshrdi3.c \
551 math/gcc/moddi3.c \
552 math/gcc/muldi3.c \
553 math/gcc/negdi2.c \
554 math/gcc/notdi2.c \
555 math/gcc/qdivrem.c \
556 math/gcc/subdi3.c \
557 math/gcc/ucmpdi2.c \
558 math/gcc/udivdi3.c \
559 math/gcc/umoddi3.c \
560 math/gcc/xordi3.c
561
562
563## @todo stop using the old memcpy.c and memset.c code.
564
565#
566# RuntimeR0 - Ring0 library for VMMR0.
567#
568RuntimeR0_TEMPLATE = VBOXR0
569RuntimeR0_DEFS = IN_RT_R0 RT_WITH_VBOX
570RuntimeR0_SOURCES = \
571 misc/sanity-cpp.cpp \
572 misc/sanity-c.c \
573 assert.cpp \
574 generic/RTAssertDoBreakpoint-generic.cpp \
575 table/avlhcphys.cpp \
576 table/avlgcptr.cpp \
577 table/avlogcphys.cpp \
578 table/avlohcphys.cpp \
579 table/avlpv.cpp \
580 table/avlrogcphys.cpp \
581 table/avlogcptr.cpp \
582 table/avlrogcptr.cpp \
583 table/avlroogcptr.cpp \
584 table/avloioport.cpp \
585 table/avlroioport.cpp \
586 logcom.cpp \
587 logformat.cpp \
588 strformat.cpp \
589 strformatrt.cpp \
590 strprintf.cpp \
591 string/memchr.cpp \
592 string/memcmp.cpp \
593 string/memcpy.cpp \
594 string/memset.cpp \
595 string/strcpy.cpp \
596 string/strlen.cpp \
597 string/strncmp.cpp \
598 string/strpbrk.cpp \
599 VBox/strformat-vbox.cpp \
600 timesup.cpp
601
602RuntimeR0_SOURCES.win.amd64 = $(RuntimeWin64ASM_SOURCES)
603
604RuntimeR0_SOURCES.os2 = \
605 os2/RTErrConvertFromOS2.cpp \
606 os2/sys0.asm
607
608RuntimeR0_SOURCES.darwin.x86 = \
609 math/gcc/adddi3.c \
610 math/gcc/anddi3.c \
611 math/gcc/ashldi3.c \
612 math/gcc/ashrdi3.c \
613 math/gcc/cmpdi2.c \
614 math/gcc/divdi3.c \
615 math/gcc/iordi3.c \
616 math/gcc/lshldi3.c \
617 math/gcc/lshrdi3.c \
618 math/gcc/moddi3.c \
619 math/gcc/muldi3.c \
620 math/gcc/negdi2.c \
621 math/gcc/notdi2.c \
622 math/gcc/qdivrem.c \
623 math/gcc/subdi3.c \
624 math/gcc/ucmpdi2.c \
625 math/gcc/udivdi3.c \
626 math/gcc/umoddi3.c \
627 math/gcc/xordi3.c
628
629
630string/memchr.cpp_CXXFLAGS.win = -Oi-
631string/memcmp.cpp_CXXFLAGS.win = -Oi-
632string/memcpy.cpp_CXXFLAGS.win = -Oi-
633string/memset.cpp_CXXFLAGS.win = -Oi-
634string/strcpy.cpp_CXXFLAGS.win = -Oi-
635string/strlen.cpp_CXXFLAGS.win = -Oi-
636
637ifeq ($(BUILD_TARGET),l4)
638RuntimeR0Drv_BLD_TRG = linux
639RuntimeR0Drv_BLD_TRG_ARCH = x86
640RuntimeR0Drv_BLD_TRG_CPU = i386
641endif
642
643#
644# RuntimeR0Drv - Ring0 library for host drivers.
645#
646RuntimeR0Drv_TEMPLATE = VBOXR0DRV
647RuntimeR0Drv_SDKS.win = W2K3DDK WINPSDKINCS
648RuntimeR0Drv_DEFS = IN_RT_R0 RT_WITH_VBOX RT_WITHOUT_NOCRT_WRAPPERS
649RuntimeR0Drv_DEFS.win = IN_SUP_R0
650RuntimeR0Drv_DEFS.linux = MODULE KBUILD_MODNAME=KBUILD_STR\(vboxdrv\) KBUILD_BASENAME=KBUILD_STR\(vboxdrv\) IN_SUP_R0 # why is IN_SUP_R0 here? because!
651
652RuntimeR0Drv_INCS.linux = \
653 r0drv/linux
654
655RuntimeR0Drv_SOURCES = \
656 misc/sanity-cpp.cpp \
657 misc/sanity-c.c \
658 assert.cpp \
659 generic/RTAssertDoBreakpoint-generic.cpp \
660 log.cpp \
661 logcom.cpp \
662 logformat.cpp \
663 string/strpbrk.cpp \
664 strformat.cpp \
665 strformatrt.cpp \
666 strtonum.cpp \
667 strprintf.cpp \
668 VBox/strformat-vbox.cpp \
669 r0drv/alloc-r0drv.cpp \
670 r0drv/initterm-r0drv.cpp \
671 generic/RTLogWriteStdErr-stub-generic.cpp \
672 generic/RTLogWriteStdOut-stub-generic.cpp \
673 generic/RTLogWriteUser-generic.cpp \
674 VBox/log-vbox.cpp \
675 table/avlpv.cpp \
676 crc32.cpp \
677 crc64.cpp
678
679RuntimeR0Drv_SOURCES.linux = \
680 alloc/heapsimple.cpp \
681 r0drv/linux/alloc-r0drv-linux.c \
682 r0drv/linux/initterm-r0drv-linux.c \
683 r0drv/linux/process-r0drv-linux.c \
684 r0drv/linux/RTLogWriteDebugger-r0drv-linux.c \
685 r0drv/linux/semaphore-r0drv-linux.c \
686 r0drv/linux/spinlock-r0drv-linux.c \
687 r0drv/linux/thread-r0drv-linux.c
688
689RuntimeR0Drv_SOURCES.win = \
690 nt/RTErrConvertFromNtStatus.cpp \
691 r0drv/nt/alloc-r0drv-nt.cpp \
692 r0drv/nt/initterm-r0drv-nt.cpp \
693 r0drv/nt/process-r0drv-nt.cpp \
694 r0drv/nt/RTLogWriteDebugger-r0drv-nt.cpp \
695 r0drv/nt/semaphore-r0drv-nt.cpp \
696 r0drv/nt/spinlock-r0drv-nt.cpp \
697 r0drv/nt/thread-r0drv-nt.cpp \
698 string/strncmp.cpp
699
700RuntimeR0Drv_SOURCES.win.amd64 = \
701 $(RuntimeWin64ASM_SOURCES)
702
703RuntimeR0Drv_SOURCES.darwin = \
704 RTErrConvertFromErrno.cpp \
705 string/memchr.asm \
706 r0drv/memobj-r0drv.cpp \
707 r0drv/darwin/alloc-r0drv-darwin.cpp \
708 r0drv/darwin/memobj-r0drv-darwin.cpp \
709 r0drv/darwin/initterm-r0drv-darwin.cpp \
710 r0drv/darwin/process-r0drv-darwin.cpp \
711 r0drv/darwin/RTLogWriteDebugger-r0drv-darwin.cpp \
712 r0drv/darwin/semaphore-r0drv-darwin.cpp \
713 r0drv/darwin/spinlock-r0drv-darwin.cpp \
714 r0drv/darwin/thread-r0drv-darwin.cpp \
715 r0drv/darwin/thread2-r0drv-darwin.cpp \
716 r0drv/darwin/time-r0drv-darwin.cpp \
717 thread.cpp \
718 generic/timer-generic.cpp \
719
720RuntimeR0Drv_SOURCES.os2 = \
721 os2/RTErrConvertFromOS2.cpp \
722 os2/sys0.asm
723
724## PORTME: Porters create and add their selection of platform specific Ring-0 Driver files here.
725
726#
727# RuntimeW32GuestR0 - Win32 guest driver runtime.
728#
729RuntimeW32GuestR0_TEMPLATE = VBOXW32GUESTR0LIB
730RuntimeW32GuestR0_SDKS = W2K3DDKX86 WINPSDKINCS
731RuntimeW32GuestR0_DEFS = IN_RT_R0 RT_WITH_VBOX RT_WITHOUT_NOCRT_WRAPPERS IN_SUP_R0
732RuntimeW32GuestR0_SOURCES = \
733 $(RuntimeR0Drv_SOURCES) \
734 $(RuntimeR0Drv_SOURCES.win) \
735 VBox/logbackdoor.cpp \
736 logR0.cpp
737ifdef VBOX_USE_VCC80
738RuntimeW32GuestR0_SOURCES += \
739 string/memchr.cpp \
740 string/memcmp.cpp \
741 string/memcpy.cpp \
742 string/memset.cpp \
743 string/strlen.cpp
744endif
745
746
747#
748# RuntimeW32NT4GuestR0 - Win32 NT4 guest driver runtime.
749#
750RuntimeW32NT4GuestR0_TEMPLATE = VBOXW32GUESTR0LIB
751RuntimeW32NT4GuestR0_SDKS = $(RuntimeW32GuestR0_SDKS)
752RuntimeW32NT4GuestR0_DEFS = $(RuntimeW32GuestR0_DEFS) IPRT_TARGET_NT4
753RuntimeW32NT4GuestR0_INCS = $(RuntimeW32GuestR0_INCS)
754RuntimeW32NT4GuestR0_SOURCES = $(RuntimeW32GuestR0_SOURCES)
755
756
757#
758# RuntimeLnx32GuestR0 - 32-bit Linux guest driver runtime.
759#
760RuntimeLnx32GuestR0_TEMPLATE = VBOXLNX32GUESTR0
761RuntimeLnx32GuestR0_DEFS = RT_WITH_VBOX RT_WITHOUT_NOCRT_WRAPPERS IN_SUP_R0 \
762 MODULE KBUILD_MODNAME=KBUILD_STR\(vboxdrv\) KBUILD_BASENAME=KBUILD_STR\(vboxdrv\)
763RuntimeLnx32GuestR0_INCS = $(RuntimeR0Drv_INCS.linux) $(RuntimeR0Drv_INCS)
764RuntimeLnx32GuestR0_SOURCES = \
765 $(RuntimeR0Drv_SOURCES) \
766 $(RuntimeR0Drv_SOURCES.linux) \
767 VBox/logbackdoor.cpp
768
769#
770# RuntimeGC - Guest context library.
771#
772RuntimeGC_TEMPLATE = VBOXGC
773RuntimeGC_DEFS = IN_RT_GC RT_WITH_VBOX
774RuntimeGC_SOURCES = \
775 misc/sanity-cpp.cpp \
776 misc/sanity-c.c \
777 table/avlogcphys.cpp \
778 table/avlrogcphys.cpp \
779 table/avlogcptr.cpp \
780 table/avlohcphys.cpp \
781 table/avlrogcptr.cpp \
782 table/avlroogcptr.cpp \
783 table/avloioport.cpp \
784 table/avlroioport.cpp \
785 assert.cpp \
786 generic/RTAssertDoBreakpoint-generic.cpp \
787 log.cpp \
788 logcom.cpp \
789 logformat.cpp \
790 string/strpbrk.cpp \
791 string/strncmp.cpp \
792 strformat.cpp \
793 strformatrt.cpp \
794 strprintf.cpp \
795 VBox/strformat-vbox.cpp \
796 timesup.cpp \
797 string/memchr.cpp \
798 string/memcmp.cpp \
799 string/memcpy.cpp \
800 string/memset.cpp \
801 string/strcpy.cpp \
802 string/strlen.cpp
803
804ifeq ($(VBOX_LDR_FMT32),lx)
805RuntimeGC_SOURCES += os2/sys0.asm
806endif
807
808RuntimeGC_SOURCES.darwin = \
809 math/gcc/adddi3.c \
810 math/gcc/anddi3.c \
811 math/gcc/ashldi3.c \
812 math/gcc/ashrdi3.c \
813 math/gcc/cmpdi2.c \
814 math/gcc/divdi3.c \
815 math/gcc/iordi3.c \
816 math/gcc/lshldi3.c \
817 math/gcc/lshrdi3.c \
818 math/gcc/moddi3.c \
819 math/gcc/muldi3.c \
820 math/gcc/negdi2.c \
821 math/gcc/notdi2.c \
822 math/gcc/qdivrem.c \
823 math/gcc/subdi3.c \
824 math/gcc/ucmpdi2.c \
825 math/gcc/udivdi3.c \
826 math/gcc/umoddi3.c \
827 math/gcc/xordi3.c
828
829
830#
831# Static library for new & delete for the electric fence.
832#
833RuntimeEFCPP_TEMPLATE = $(RuntimeR3_TEMPLATE)
834RuntimeEFCPP_SDKS = $(RuntimeR3_SDKS)
835RuntimeEFCPP_SDKS.$(BUILD_TARGET) = $(RuntimeR3_SDKS.$(BUILD_TARGET))
836RuntimeEFCPP_DEFS = $(RuntimeR3_DEFS)
837RuntimeEFCPP_DEFS.$(BUILD_TARGET) = $(RuntimeR3_DEFS.$(BUILD_TARGET))
838RuntimeEFCPP_INCS = $(RuntimeR3_INCS)
839RuntimeEFCPP_INCS.$(BUILD_TARGET) = $(RuntimeR3_INCS.$(BUILD_TARGET))
840RuntimeEFCPP_SOURCES = r3/alloc-ef-cpp.cpp
841
842
843
844#
845# errmsg.cpp depends on a generated header.
846#
847errmsg.cpp_DEPS = $(PATH_TARGET)/errmsgdata.h
848errmsg.cpp_INCS = $(PATH_TARGET)
849
850win32/errmsgwin.cpp_DEPS = $(PATH_TARGET)/errmsgcomdata.h
851win32/errmsgwin.cpp_INCS = $(PATH_TARGET)
852
853linux/errmsglinux.cpp_DEPS = $(PATH_TARGET)/errmsgxpcomdata.h
854linux/errmsglinux.cpp_INCS = $(PATH_TARGET)
855
856
857# Generate the rules
858include $(PATH_KBUILD)/footer.kmk
859
860
861#
862# Generate the status code data.
863#
864$(PATH_TARGET)/errmsgdata.h: errmsg.sed $(DEPTH)/include/iprt/err.h $(DEPTH)/include/VBox/err.h
865 $(call MSG_L1,Generating $@)
866 $(QUIET)$(MKDIR) -p $(PATH_TARGET)
867 $(QUIET)$(SED) -f $< $(filter %.h,$^) > $@
868## @todo r=bird: rename this to indicate that it's not only COM errors, but all win32/64 errors.
869$(PATH_TARGET)/errmsgcomdata.h: errmsgcom.sed $(PATH_SDK_WINPSDK_INC)/WinError.h
870 $(call MSG_L1,Generating $@)
871 $(QUIET)$(MKDIR) -p $(PATH_TARGET)
872 $(QUIET)$(SED) -f $< $(filter %.h,$^) > $@
873$(PATH_TARGET)/errmsgxpcomdata.h: errmsgxpcom.sed $(DEPTH)/src/libs/xpcom18a4/xpcom/base/nsError.h
874 $(call MSG_L1,Generating $@)
875 $(QUIET)$(MKDIR) -p $(PATH_TARGET)
876 $(QUIET)$(SED) -f $< $(filter %.h,$^) > $@
877
878
879#
880# Aliases for .cpp.h files so we can more easily do syntax checking from the editor.
881#
882ldrELFRelocatable.cpp.o: ldrELF.o
883ldrELFRelocatable.cpp.obj: ldrELF.obj
884
885
886#
887# Doxygen documentation.
888#
889DOXYGEN_INPUT_DIRS = \
890 $(PATH_ROOT)/include/iprt \
891 $(PATH_ROOT)/include/iprt/nocrt \
892 $(PATH_ROOT)/include/iprt/nocrt/x86 \
893 $(PATH_ROOT)/include/iprt/nocrt/amd64 \
894 include/internal \
895 string \
896 table \
897 $(foreach dir, . r3 r0drv,\
898 $(dir) \
899 $(dir)/darwin \
900 $(dir)/l4 \
901 $(dir)/linux \
902 $(dir)/nt \
903 $(dir)/os2 \
904 $(dir)/win \
905 $(dir)/win32 \
906 $(dir)/win64 \
907 $(dir)/generic \
908 )
909
910# These must come first in order to make things look nice.
911DOXYGEN_INPUT_FIRST =\
912 $(PATH_ROOT)/include/iprt/cdefs.h \
913 $(PATH_ROOT)/include/iprt/types.h \
914 $(PATH_ROOT)/include/iprt/runtime.h \
915 $(PATH_ROOT)/include/iprt/param.h \
916 $(PATH_ROOT)/include/iprt/assert.h \
917 $(PATH_ROOT)/include/iprt/asm.h \
918
919DOXYGEN_INPUT := \
920 $(filter-out %.cpp.h, $(sort $(wildcard $(addsuffix /*.h, $(DOXYGEN_INPUT_DIRS)))) ) \
921 $(foreach dir, $(DOXYGEN_INPUT_DIRS), $(wildcard $(dir)/*.cpp $(dir)/.c $(dir)/.asm))
922DOXYGEN_INPUT := \
923 $(DOXYGEN_INPUT_FIRST) \
924 $(filter-out $(DOXYGEN_INPUT_FIRST), $(DOXYGEN_INPUT))
925
926
927DOXYGEN_OUTPUT = $(PATH_OUT)/docs/iprt
928
929-include $(PATH_TARGET)/Doxyfile.dep
930
931# Generate the Doxyfile
932$(PATH_TARGET)/Doxyfile: Doxyfile \
933 $(comp-vars DOXYGEN_INPUT,DOXYGEN_INPUT_PREV,FORCE) \
934 $(comp-vars DOXYGEN_OUTPUT,DOXYGEN_OUTPUT_PREV,FORCE) \
935 | $(call DIRDEP, $(PATH_TARGET))
936 $(RM) -f $@ $@.tmp $(PATH_TARGET)/Doxyfile.dep
937 $(CP) -f Doxyfile $@.tmp
938 $(APPEND) $@.tmp
939 $(APPEND) $@.tmp "OUTPUT_DIRECTORY = $(DOXYGEN_OUTPUT)"
940 $(APPEND) $@.tmp "WARN_LOGFILE = $(DOXYGEN_OUTPUT)/errors"
941 $(APPEND) $@.tmp "INCLUDE_PATH = $(PATH_ROOT)/include include . table"
942 $(APPEND) $@.tmp "INCLUDE_FILE_PATTERNS = *.cpp.h"
943 $(APPEND) $@.tmp
944 $(APPEND) $@.tmp "INPUT = $(DOXYGEN_INPUT)"
945 $(APPEND) $@.tmp
946 $(MV) -f $@.tmp $@
947 @$(APPEND) $(PATH_TARGET)/Doxyfile.dep "DOXYGEN_OUTPUT_PREV = $(DOXYGEN_OUTPUT)"
948 @$(APPEND) $(PATH_TARGET)/Doxyfile.dep "DOXYGEN_INPUT_PREV = $(DOXYGEN_INPUT)"
949
950# Create the output directory.
951$(call DIRDEP, $(DOXYGEN_OUTPUT)):
952 $(MKDIR) -p $@
953
954# Do the actual job.
955$(PATH_TARGET)/docs.iprt: $(PATH_TARGET)/Doxyfile $(DOXYGEN_INPUT) | $(call DIRDEP, $(DOXYGEN_OUTPUT))
956 $(RM) -f $(wildcard $(DOXYGEN_OUTPUT)/html/*) $(PATH_TARGET)/docs.iprt
957 doxygen $(PATH_TARGET)/Doxyfile
958 $(APPEND) $(PATH_TARGET)/docs.iprt
959
960# alias
961docs: $(PATH_TARGET)/docs.iprt
962
963test:
964 @echo test-$(comp-vars DOXYGEN_OUTPUT,DOXYGEN_OUTPUT_PREV,FORCE)
965 @echo $(DOXYGEN_OUTPUT)
966 @echo $(DOXYGEN_OUTPUT_PREV)
967
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