VirtualBox

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

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

Bool and AMD64 hacking.

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