VirtualBox

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

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

Sanity checks and fixes for building 32-bit guest stuff correctly when targetting 64-bit systems.

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