VirtualBox

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

Last change on this file since 3829 was 3707, checked in by vboxsync, 17 years ago

assert-r0drv-darwin.cpp.

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