VirtualBox

source: vbox/trunk/src/VBox/Runtime/Makefile.kmk@ 2919

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

Implemented local time functions. (not properly tested yet)

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