Makefile.kmk revision 4a1654dd5b9f0ae4e149d909843a3ab07b8bec33
# $Id$
## @file
# Sub-Makefile for the IPRT (IPRT).
#
#
# Copyright (C) 2006-2007 Sun Microsystems, Inc.
#
# This file is part of VirtualBox Open Source Edition (OSE), as
# available from http://www.virtualbox.org. This file is free software;
# you can redistribute it and/or modify it under the terms of the GNU
# General Public License (GPL) as published by the Free Software
# Foundation, in version 2 as it comes in the "COPYING" file of the
# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
#
# The contents of this file may alternatively be used under the terms
# of the Common Development and Distribution License Version 1.0
# (CDDL) only, as it comes in the "COPYING.CDDL" file of the
# VirtualBox OSE distribution, in which case the provisions of the
# CDDL are applicable instead of those of the GPL.
#
# You may elect to license modified versions of this file under the
# terms and conditions of either the GPL or the CDDL or both.
#
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
# Clara, CA 95054 USA or visit http://www.sun.com if you need
# additional information or have any questions.
#
SUB_DEPTH = ../../..
include $(KBUILD_PATH)/subheader.kmk
ifdef VBOX_ONLY_ADDITIONS
#
# Only build the additions, sort out the legacy names first.
#
LIBRARIES += RuntimeGuestR0 RuntimeGuestR3 RuntimeGuestR3Shared RuntimeGuestR3Mini
#LIBRARIES.os2 = RuntimeGuestR0OS2Warp3
LIBRARIES.win.x86 += RuntimeGuestR0NT4
ifndef VBOX_WITH_ADDITION_DRIVERS
if1of ($(KBUILD_TARGET), linux l4) # All drivers are optional, can skip RuntimeGuestR0.
LIBRARIES := $(filter-out RuntimeGuestR0, $(LIBRARIES))
endif
endif
else ifdef VBOX_ONLY_DOCS
#
# Build docs only - need just regular R3 runtime.
#
LIBRARIES += RuntimeR3
DLLS += VBoxRT
else # !VBOX_ONLY_ADDITIONS && !VBOX_ONLY_DOCS
#
# Normal build.
#
include $(PATH_SUB_CURRENT)/testcase/Makefile.kmk
BLDPROGS += uniread
LIBRARIES += RuntimeR3 RuntimeR0 RuntimeGC RuntimeEFCPP RuntimeR3NoCRTGCC
ifdef VBOX_WITH_VBOXDRV
LIBRARIES += RuntimeR0Drv
endif
ifdef VBOX_WITH_ADDITIONS
LIBRARIES += RuntimeGuestR0 RuntimeGuestR3 RuntimeGuestR3Shared RuntimeGuestR3Mini
#LIBRARIES.os2 += RuntimeGuestR0OS2Warp3
LIBRARIES.win.x86 += RuntimeGuestR0NT4
ifndef VBOX_WITH_ADDITION_DRIVERS
if1of ($(KBUILD_TARGET), linux l4) # All drivers are optional, can skip RuntimeGuestR0.
LIBRARIES := $(filter-out RuntimeGuestR0, $(LIBRARIES))
endif
endif
endif # VBOX_WITH_ADDITIONS
LIBRARIES.l4 += RuntimeR3L4 RuntimeLnxHostR3
DLLS += VBoxRT
endif
# Where the generated stuff goes.
IPRT_OUT_DIR := $(PATH_TARGET)/Runtime
BLDDIRS += $(IPRT_OUT_DIR)
OTHER_CLEAN += \
$(IPRT_OUT_DIR)/errmsgdata.h \
$(IPRT_OUT_DIR)/errmsgcomdata.h \
$(IPRT_OUT_DIR)/errmsgvboxcomdata.h \
$(IPRT_OUT_DIR)/Doxyfile.iprt \
$(IPRT_OUT_DIR)/Doxyfile.iprt.dep \
$(IPRT_OUT_DIR)/docs.iprt
#
# Globals
#
VBOX_PATH_RUNTIME_SRC := $(PATH_SUB_CURRENT)
#
# Unicode Specification reader used to regenerate unidata.cpp.
#
uniread_TEMPLATE = VBOXBLDPROG
uniread_SOURCES = common/string/uniread.cpp
uniread_INCS = include
#
# Win64 assembly sources.
#
RuntimeWin64ASM_SOURCES = \
#
# Win32 assembly sources.
#
RuntimeWin32ASM_SOURCES = \
#
# NoCRT sources (minus math stuff).
#
RuntimeNoCrt_SOURCES = \
#
# RuntimeR3 - Static Runtime for Ring-3 executables.
#
RuntimeR3_TEMPLATE = VBOXR3STATIC
RuntimeR3_SDKS.win = WINPSDK W2K3DDK
RuntimeR3_DEFS = IN_RT_R3 IN_SUP_R3 LDR_WITH_NATIVE LDR_WITH_ELF32 LDR_WITH_PE RT_WITH_VBOX RT_NO_GIP
ifdef IPRT_WITH_KSTUFF
RuntimeR3_DEFS += LDR_WITH_KLDR
endif
ifdef VBOX_MAIN_RELEASE_LOG ## @todo (dmik): temporary, until RTThreadSelf/RTThreadAdopt are properly updated
RuntimeR3_DEFS += RTCRITSECT_STRICT
endif
RuntimeR3_INCS = \
include \
$(SDK_VBOX_ZLIB_INCS)
ifdef VBOX_WITH_NEW_LIBLZF
RuntimeR3_INCS += \
$(PATH_ROOT)/src/libs/liblzf-3.4
else
RuntimeR3_INCS += \
$(PATH_ROOT)/src/libs/liblzf-1.51
endif
ifdef IPRT_WITH_KSTUFF
RuntimeR3_INCS += \
$(PATH_ROOT)/src/libs/kStuff/kStuff/include
endif
$(L4_INCDIR)
# RuntimeR3_INCS.solaris = \
RuntimeR3_SOURCES = \
#if1of ($(KBUILD_TARGET_ARCH),amd64 x86)
# RuntimeR3_SOURCES += common/time/timesupA.asm
#else
RuntimeR3_SOURCES += common/time/timesupref.cpp
#endif
# Some versions of GCC might require this.
ifdef IPRT_WITH_KSTUFF
RuntimeR3_SOURCES += \
endif
# VBox specific stuff.
RuntimeR3_SOURCES += \
ifneq ($(KBUILD_TARGET),win)
RuntimeR3_SOURCES += \
endif
RuntimeR3_SOURCES.win.amd64 = $(RuntimeWin64ASM_SOURCES)
RuntimeR3_SOURCES.win.x86 = $(RuntimeWin32ASM_SOURCES)
ifdef RT_NEW_LINUX_MUTEX_CODE
else
endif
## @todo Make BSD sched, implement RTMP*.
ifdef RT_ASYNC_IO_CODE
endif
## PORTME: Porters add their selection of platform specific files for Ring-3 here.
#
# L4 RuntimeR3 subtarget since L4 headers won't work with VBOXR3.
#
RuntimeR3L4_TEMPLATE = VBOXR3NP
RuntimeR3L4_DEFS = IN_RT_R3 IN_SUP_R3 LDR_WITH_NATIVE LDR_WITH_ELF LDR_WITH_PE
ifneq ($(KBUILD_TARGET_ARCH),amd64)
RuntimeR3L4_DEFS += __PIC__
endif
RuntimeR3L4_INCS = \
include \
$(L4_INCDIR)
RuntimeR3L4_SOURCES = \
#
# RuntimeGuestR3 - Guest Additions Runtime (static/exe).
# (The KBUILD_HOST inheritance here is for l4 cross building the linux
# additions, while .x86 is for cross building x86 while targeting amd64.)
#
RuntimeGuestR3_TEMPLATE := VBOXGUESTR3LIB
## @todo change this to EXTEND the RuntimeR3 target.
RuntimeGuestR3_DEFS := $(filter-out RTCRITSECT_STRICT RT_NO_GIP, $(RuntimeR3_DEFS))
RuntimeGuestR3_DEFS.$(KBUILD_TARGET) := $(RuntimeR3_DEFS.$(KBUILD_TARGET))
RuntimeGuestR3_DEFS.$(KBUILD_HOST) := $(RuntimeR3_DEFS.$(KBUILD_HOST))
RuntimeGuestR3_INCS := $(RuntimeR3_INCS)
RuntimeGuestR3_INCS.$(KBUILD_TARGET) := $(RuntimeR3_INCS.$(KBUILD_TARGET))
RuntimeGuestR3_INCS.$(KBUILD_HOST) := $(RuntimeR3_INCS.$(KBUILD_HOST))
RuntimeGuestR3_SOURCES := $(filter-out \
, $(RuntimeR3_SOURCES))
RuntimeGuestR3_SOURCES += \
RuntimeGuestR3_SOURCES.$(KBUILD_TARGET) := $(RuntimeR3_SOURCES.$(KBUILD_TARGET))
RuntimeGuestR3_SOURCES.$(KBUILD_HOST) := $(RuntimeR3_SOURCES.$(KBUILD_HOST))
RuntimeGuestR3_SOURCES.$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH) := $(RuntimeR3_SOURCES.$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH))
RuntimeGuestR3_SOURCES.$(KBUILD_HOST).$(KBUILD_TARGET_ARCH) := $(RuntimeR3_SOURCES.$(KBUILD_HOST).$(KBUILD_TARGET_ARCH))
#
# RuntimeGuestR3Shared - Guest Additions Runtime (static/dll).
#
RuntimeGuestR3Shared_TEMPLATE := VBOXGUESTR3DLL
RuntimeGuestR3Shared_EXTENDS := RuntimeGuestR3
RuntimeGuestR3Shared_INST = $(INST_ADDITIONS_LIB)
#
# RuntimeGuestR3Mini - Minimal Guest Additions Runtime which does not require
# initialization and can be linked into an .so. Intended
# for X11 drivers, GRADD and similar.
#
RuntimeGuestR3Mini_TEMPLATE := VBOXGUESTR3DLL
## @todo change this to EXTEND the RuntimeGuestR3 target.
RuntimeGuestR3Mini_INST := $(INST_ADDITIONS_LIB)
RuntimeGuestR3Mini_DEFS := $(filter-out RTCRITSECT_STRICT RT_NO_GIP, $(RuntimeR3_DEFS)) RT_MINI
RuntimeGuestR3Mini_DEFS.$(KBUILD_TARGET) := $(RuntimeR3_DEFS.$(KBUILD_TARGET))
RuntimeGuestR3Mini_DEFS.$(KBUILD_HOST) := $(RuntimeR3_DEFS.$(KBUILD_HOST))
RuntimeGuestR3Mini_INCS := $(RuntimeR3_INCS)
RuntimeGuestR3Mini_INCS.$(KBUILD_TARGET) := $(RuntimeR3_INCS.$(KBUILD_TARGET))
RuntimeGuestR3Mini_INCS.$(KBUILD_HOST) := $(RuntimeR3_INCS.$(KBUILD_HOST))
RuntimeGuestR3Mini_SOURCES = \
# VBox specific stuff.
RuntimeGuestR3Mini_SOURCES += \
#
# RuntimeLnxHostR3 Linux host program runtime
# (Only used when building L4.)
#
RuntimeLnxHostR3_TEMPLATE = VBOXLNXHOSTR3LIB
RuntimeLnxHostR3_DEFS = IN_RT_R3 IN_SUP_R3 RT_WITH_VBOX RT_NO_GIP
RuntimeLnxHostR3_SOURCES = \
$(RuntimeR3_SOURCES.linux.$(KBUILD_TARGET_ARCH)) \
$(RuntimeR3_SOURCES)
RuntimeLnxHostR3_INCS = \
$(RuntimeR3_INCS.linux.$(KBUILD_TARGET_ARCH)) \
$(RuntimeR3_INCS.linux) \
$(RuntimeR3_INCS)
#
# VBoxRT - Shared Object / DLL version.
#
VBoxRT_TEMPLATE = VBOXR3
ifdef VBOX_WITH_LIBXML2_IN_VBOXRT
VBoxRT_SDKS = VBOX_OPENSSL VBOX_LIBXML2 VBOX_LIBCURL
endif
VBoxRT_SDKS.win = WINPSDK W2K3DDK VBOX_NTDLL
ifeq ($(KBUILD_TARGET)$(VBOX_WITH_HARDENING),darwin)
VBoxRT_INST = $(INST_DLL) $(INST_TESTCASE)
endif
VBoxRT_DEFS = $(filter-out RT_NO_GIP,$(RuntimeR3_DEFS)) IN_SUP_R3 IN_SUP_R3
VBoxRT_DEFS.$(KBUILD_TYPE) = $(RuntimeR3_DEFS.$(KBUILD_TYPE))
VBoxRT_SOURCES = \
$(RuntimeR3_SOURCES)
ifdef VBOX_WITH_LIBXML2_IN_VBOXRT
VBoxRT_SOURCES += \
endif
VBoxRT_SOURCES.$(KBUILD_TARGET) = $(RuntimeR3_SOURCES.$(KBUILD_TARGET))
VBoxRT_SOURCES.$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH) = $(RuntimeR3_SOURCES.$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH))
VBoxRT_INCS = $(RuntimeR3_INCS)
VBoxRT_INCS.$(KBUILD_TARGET) = $(RuntimeR3_INCS.$(KBUILD_TARGET))
VBoxRT_INCS.$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH) = $(RuntimeR3_INCS.$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH))
VBoxRT_LIBS = \
$(PATH_LIB)/SUPR3$(VBOX_SUFF_LIB) \
$(PATH_LIB)/VBox-liblzf$(VBOX_SUFF_LIB) \
$(SDK_VBOX_ZLIB_LIBS)
ifdef IPRT_WITH_KSTUFF
VBoxRT_LIBS += \
$(PATH_LIB)/VBox-kStuff$(VBOX_SUFF_LIB)
endif
ifdef VBOX_WITH_LIBXML2_IN_VBOXRT
ifndef SDK_VBOX_LIBXML2_LIBS
VBoxRT_LIBS += \
$(PATH_LIB)/VBox-libxml2$(VBOX_SUFF_LIB)
endif
ifndef SDK_VBOX_OPENSSL_LIBS
VBoxRT_LIBS += \
$(PATH_LIB)/VBox-libcrypto$(VBOX_SUFF_LIB)
endif
endif
iconv
iconv \
rt
kstat
VBoxRT_LDFLAGS.darwin = -framework IOKit -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/VBoxRT.dylib
ifdef VBOX_USE_VCC80
VBoxRT_LDFLAGS.win = /MANIFEST
endif
-Wl,-whole-archive \
$(PATH_LIB)/RuntimeR3L4$(VBOX_SUFF_LIB) \
-Wl,-no-whole-archive
ifeq ($(KBUILD_TARGET),l4)
VBoxRT_LIBS += \
$(L4_LIBDIR)/libl4sys.a \
$(L4_LIBDIR)/libl4sys.p.a
endif
VBoxRT_LIBS.l4 = \
$(PATH_LIB)/RuntimeR3L4$(VBOX_SUFF_LIB)
ifdef VBOX_WITH_LIBXML2_IN_VBOXRT
VBox/VBoxRTDeps.cpp_DEFS = VBOX_WITH_LIBXML2_IN_VBOXRT
endif
$$(VBoxRT_0_OUTDIR)/VBoxRT.def: \
$(PATH_SUB_CURRENT)/r3/win/VBoxRT-$$(if-expr $$(KBUILD_TARGET_ARCH) == amd64,win64,win32).def \
$(if-expr defined(VBOX_WITH_LIBXML2_IN_VBOXRT),$(PATH_SUB_CURRENT)/r3/win/VBoxRT-openssl.def,)
$(RM) -f -- $@
$(REDIRECT) -wto $@ -- $(CAT_EXT) $^
#
# HACK ALLERT! Make testcase run during build on SELinux boxes.
# Create a dummy DLL that ensure that VBoxRT is installed
# during the DLL pass and cleaned up later.
#
ifeq ($(KBUILD_TARGET),linux)
if1of (VBoxRT, $(DLLS))
ifneq ($(wildcard /usr/bin/chcon),)
VBoxRT_NOINST = true
DLLS += VBoxRTDummy
VBoxRTDummy_TEMPLATE = VBOXR3
VBoxRTDummy_NOINST = true
VBoxRTDummy_LIBS = $(PATH_BIN)/VBoxRT.so
VBoxRTDummy_CLEAN= $(PATH_BIN)/VBoxRT.so
BLDDIRS += $(PATH_BIN)
$(PATH_BIN)/VBoxRT.so: $$(TARGET_VBoxRT) | $$(dir $$@)
$(INSTALL) $< $@
chcon -t texrel_shlib_t $@ || true
VBoxRT:: VBoxRTDummy
endif # chcon present.
endif # building VBoxRT
endif # linux
#
# RuntimeR3NoCRTGCC - CRT replacement lib for VBoxREM.
# This is used together with VBoxRT.
#
## @todo the *_alias.c stuff is busted, remove and use RT_WITH_NOCRT_ALIASES instead.
RuntimeR3NoCRTGCC_TEMPLATE = VBOXNOCRTGCC
RuntimeR3NoCRTGCC_LIBSUFF = $(VBOX_SUFF_LIB)
RuntimeR3NoCRTGCC_INCS = include
RuntimeR3NoCRTGCC_SOURCES = \
\
\
$(RuntimeNoCrt_SOURCES) \
\
#
# RuntimeR0 - Ring0 library for VMMR0.
#
RuntimeR0_TEMPLATE = VBOXR0
RuntimeR0_DEFS = IN_RT_R0 RT_WITH_VBOX
RuntimeR0_INCS = include
RuntimeR0_SOURCES = \
\
$(RuntimeNoCrt_SOURCES)
if1of ($(KBUILD_TARGET), darwin solaris freebsd)
RuntimeR0_SOURCES += \
endif
#if1of ($(KBUILD_TARGET_ARCH),amd64 x86)
# RuntimeR0_SOURCES += common/time/timesupA.asm
#else
RuntimeR0_SOURCES += common/time/timesupref.cpp
#endif
RuntimeR0_SOURCES.win.amd64 = $(RuntimeWin64ASM_SOURCES)
RuntimeR0_SOURCES.win.x86 = $(RuntimeWin32ASM_SOURCES)
#
# RuntimeR0Drv - Ring0 library for host drivers.
#
RuntimeR0Drv_TEMPLATE = VBOXR0DRV
RuntimeR0Drv_SDKS.win = W2K3DDK WINPSDKINCS
RuntimeR0Drv_INCS := $(PATH_SUB_CURRENT) include
RuntimeR0Drv_DEFS = IN_RT_R0 RT_WITH_VBOX RT_WITHOUT_NOCRT_WRAPPERS
RuntimeR0Drv_DEFS.win = IN_SUP_R0
RuntimeR0Drv_DEFS.linux = MODULE KBUILD_MODNAME=KBUILD_STR\(vboxdrv\) KBUILD_BASENAME=KBUILD_STR\(vboxdrv\) IN_SUP_R0 # why is IN_SUP_R0 here? because!
ifdef VBOX_WITH_SOLARIS_VBI
endif
RuntimeR0Drv_SOURCES = \
## @todo: Linking against RuntimeR0Drv on Linux will result in unresolved external
## references to several string functions (e.g. strlen). We could include the
## missing functions here but our own implementations conflict with declarations
## of some Linux kernels (inline versus not inline, size_t versus unsigned int).
##
## The prototypes for the unresolved externals are declared in <linux/string.h>.
## This file is not included with extern "C" { ... } and therefore the function
## prototypes are mangled during C++ compilation. That's why we have to provide
## implementations with mangled function names.
##
## bird: Why don't we just extern "C" {} that file then?
## @todo thread2-r0drv-linux.c and assert-r0drv-linux.c
RuntimeR0Drv_SOURCES.win.amd64 = $(RuntimeWin64ASM_SOURCES)
RuntimeR0Drv_SOURCES.win.x86 = $(RuntimeWin32ASM_SOURCES)
\
\
$(PATH_RuntimeR0Drv)/bus_if.h \
$(PATH_RuntimeR0Drv)/device_if.h
RuntimeR0Drv_INCS.freebsd += $(PATH_RuntimeR0Drv)
ifeq ($(KBUILD_TARGET),freebsd)
#
# FreeBSD: Generate bus and device interface headers.
# We have to include headers for the RTMp* API which
# depends on these files.
#
# We cannot give a output path to the awk program, it will always generate
# the header next to the source. So, we'll have to temporarily copy the
# source file to the destination directory to work.
#
## @todo Create an install target for this and install it to gen-sys-hdrs/, user order deps to force RuntimeR0Drv to build it. Use it for the other drivers as well.
VBOX_AWK := /usr/bin/awk
$$(PATH_RuntimeR0Drv)/bus_if.h: $(VBOX_FREEBSD_SRC)/kern/bus_if.m | $$(dir $$@)
$(call MSG_TOOL,awk,RuntimeR0Drv,$<,$@)
$(QUIET)$(CP) -f $(VBOX_FREEBSD_SRC)/kern/bus_if.m $(PATH_RuntimeR0Drv)/bus_if.m
$(QUIET)$(VBOX_AWK) -f $(VBOX_FREEBSD_SRC)/tools/makeobjops.awk $(PATH_RuntimeR0Drv)/bus_if.m -h -p
$(QUIET)$(RM) $(PATH_RuntimeR0Drv)/bus_if.m
$$(PATH_RuntimeR0Drv)/device_if.h: $(VBOX_FREEBSD_SRC)/kern/device_if.m | $$(dir $$@)
$(call MSG_TOOL,awk,RuntimeR0Drv,$<,$@)
$(QUIET)$(CP) -f $(VBOX_FREEBSD_SRC)/kern/device_if.m $(PATH_RuntimeR0Drv)/device_if.m
$(QUIET)$(VBOX_AWK) -f $(VBOX_FREEBSD_SRC)/tools/makeobjops.awk $(PATH_RuntimeR0Drv)/device_if.m -h -p
$(QUIET)$(RM) $(PATH_RuntimeR0Drv)/device_if.m
endif # FreeBSD
ifdef VBOX_WITH_SOLARIS_VBI
else # !VBOX_WITH_SOLARIS_VBI
# Don't use mp-r0drv-solaris.c because it will cause crashes due to incorrect memobj-r0drv-solaris.c code.
ifeq (0,0)
# Stub it. ## @todo limit the stubbing to RTMpOn*.
else
# Use mp-r0drv-solaris.c.
endif
endif # !VBOX_WITH_SOLARIS_VBI
## PORTME: Porters create and add their selection of platform specific Ring-0 Driver files here.
#
# RuntimeGuestR0 - Guest driver runtime.
# This is almost the same as the RuntimeR0Drv, the main difference
# is in the backdoor logging and the lack of sup.h (which should be
# made irrelevant even for RuntimeR0Drv).
#
RuntimeGuestR0_TEMPLATE := VBOXGUESTR0LIB
RuntimeGuestR0_SOURCES := $(filter-out generic/RTLogWriteUser-generic.cpp, $(RuntimeR0Drv_SOURCES))
RuntimeGuestR0_SOURCES += \
RuntimeGuestR0_EXTENDS = RuntimeR0Drv
# HACK: no vbi for the solaris guest additions - yet.
#
# RuntimeGuestR0NT4 - Win32 NT4 guest driver runtime.
#
RuntimeGuestR0NT4_EXTENDS = RuntimeGuestR0
RuntimeGuestR0NT4_EXTENDS_BY = appending
RuntimeGuestR0NT4_DEFS = IPRT_TARGET_NT4
#
# RuntimeGC - Guest context library.
#
RuntimeGC_TEMPLATE = VBOXGC
RuntimeGC_DEFS = IN_RT_GC RT_WITH_VBOX
RuntimeGC_INCS = include
RuntimeGC_SOURCES = \
\
$(RuntimeNoCrt_SOURCES)
#if1of ($(KBUILD_TARGET_ARCH),amd64 x86)
# RuntimeGC_SOURCES += common/time/timesupA.asm
#else
RuntimeGC_SOURCES += common/time/timesupref.cpp
#endif
RuntimeGC_SOURCES.win.x86 = $(RuntimeWin32ASM_SOURCES)
ifeq ($(VBOX_LDR_FMT32),lx)
RuntimeGC_SOURCES += os2/sys0.asm
endif
if1of ($(KBUILD_TARGET), darwin solaris freebsd)
RuntimeGC_SOURCES += \
endif
#
# Static library for new & delete for the electric fence.
#
RuntimeEFCPP_TEMPLATE = $(RuntimeR3_TEMPLATE)
RuntimeEFCPP_SDKS = $(RuntimeR3_SDKS)
RuntimeEFCPP_SDKS.$(KBUILD_TARGET) = $(RuntimeR3_SDKS.$(KBUILD_TARGET))
RuntimeEFCPP_DEFS = $(RuntimeR3_DEFS)
RuntimeEFCPP_DEFS.$(KBUILD_TARGET) = $(RuntimeR3_DEFS.$(KBUILD_TARGET))
RuntimeEFCPP_INCS = $(RuntimeR3_INCS)
RuntimeEFCPP_INCS.$(KBUILD_TARGET) = $(RuntimeR3_INCS.$(KBUILD_TARGET))
RuntimeEFCPP_SOURCES = r3/alloc-ef-cpp.cpp
#
# errmsg.cpp depends on a generated header.
#
common/err/errmsg.cpp_DEPS = $(IPRT_OUT_DIR)/errmsgdata.h
common/err/errmsg.cpp_INCS = $(IPRT_OUT_DIR)
win/errmsgwin.cpp_DEPS = $(IPRT_OUT_DIR)/errmsgcomdata.h
win/errmsgwin.cpp_INCS = $(IPRT_OUT_DIR)
# Our COM errors only for R3 libraries on the host
define def_errmsgwin_deps
$(lib)_win/errmsgwin.cpp_DEPS = $(IPRT_OUT_DIR)/errmsgvboxcomdata.h
$(lib)_common/err/errmsgxpcom.cpp_INCS = $(IPRT_OUT_DIR)
$(lib)_common/err/errmsgxpcom.cpp_DEPS = $(IPRT_OUT_DIR)/errmsgvboxcomdata.h
endef
$(foreach lib,RuntimeR3 VBoxRT RuntimeLnxHostR3,$(eval $(def_errmsgwin_deps)))
#
# Generate the status code data.
#
$(IPRT_OUT_DIR)/errmsgdata.h: \
$(VBOX_PATH_RUNTIME_SRC)/common/err/errmsg.sed \
$(PATH_ROOT)/include/iprt/err.h \
$(PATH_ROOT)/include/VBox/err.h \
| $$(dir $$@)
$(call MSG_GENERATE,,$@,$(filter %.h,$^))
$(QUIET)$(REDIRECT) -wo $@ -- $(SED) -f $< $(filter %.h,$^)
## @todo r=bird: rename this to indicate that it's not only COM errors, but all win32/64 errors.
$(IPRT_OUT_DIR)/errmsgcomdata.h: \
$(VBOX_PATH_RUNTIME_SRC)/common/err/errmsgcom.sed \
$$(PATH_SDK_WINPSDK_INC)/WinError.h \
| $$(dir $$@)
$(call MSG_GENERATE,,$@,$(filter %.h,$^))
$(QUIET)$(REDIRECT) -wo $@ -- $(SED) -f $< $(filter %.h,$^)
$(IPRT_OUT_DIR)/errmsgvboxcomdata.h: \
$(VBOX_PATH_RUNTIME_SRC)/VBox/errmsgvboxcom.xsl \
$(VBOX_XIDL_FILE_SRC) \
| $$(dir $$@)
$(call MSG_GENERATE,,$@,$(filter %.xidl,$^))
$(VBOX_XSLTPROC) -o $@ $< $(filter %.xidl,$^)
#
# Aliases for .cpp.h files so we can more easily do syntax checking from the editor.
#
#
# Doxygen documentation.
#
IPRT_DOXYFILE_INPUT_DIRS = \
$(PATH_ROOT)/include/iprt \
$(PATH_ROOT)/include/iprt/nocrt \
$(PATH_ROOT)/include/iprt/nocrt/x86 \
$(PATH_ROOT)/include/iprt/nocrt/amd64 \
$(VBOX_PATH_RUNTIME_SRC)/include/internal \
$(VBOX_PATH_RUNTIME_SRC)/common/alloc \
$(VBOX_PATH_RUNTIME_SRC)/common/checksum \
$(VBOX_PATH_RUNTIME_SRC)/common/err \
$(VBOX_PATH_RUNTIME_SRC)/common/ldr \
$(VBOX_PATH_RUNTIME_SRC)/common/log \
$(VBOX_PATH_RUNTIME_SRC)/common/misc \
$(VBOX_PATH_RUNTIME_SRC)/common/string \
$(VBOX_PATH_RUNTIME_SRC)/common/table \
$(VBOX_PATH_RUNTIME_SRC)/common/time \
$(VBOX_PATH_RUNTIME_SRC)/VBox \
$(foreach dir, $(VBOX_PATH_RUNTIME_SRC) $(VBOX_PATH_RUNTIME_SRC)/r3 $(VBOX_PATH_RUNTIME_SRC)/r0drv,\
$(dir) \
$(dir)/darwin \
$(dir)/l4 \
$(dir)/linux \
$(dir)/nt \
$(dir)/os2 \
$(dir)/win \
$(dir)/win32 \
$(dir)/win64 \
$(dir)/generic \
)
# These must come first in order to make things look nice.
IPRT_DOXYFILE_INPUT_FIRST =\
$(PATH_ROOT)/include/iprt/cdefs.h \
$(PATH_ROOT)/include/iprt/types.h \
$(PATH_ROOT)/include/iprt/runtime.h \
$(PATH_ROOT)/include/iprt/param.h \
$(PATH_ROOT)/include/iprt/assert.h \
$(PATH_ROOT)/include/iprt/asm.h \
IPRT_DOXYFILE_INPUT := \
$(filter-out %.cpp.h, $(sort $(wildcard $(addsuffix /*.h, $(IPRT_DOXYFILE_INPUT_DIRS)))) ) \
$(foreach dir, $(IPRT_DOXYFILE_INPUT_DIRS), $(wildcard $(dir)/*.cpp $(dir)/.c $(dir)/.asm))
IPRT_DOXYFILE_INPUT := \
$(IPRT_DOXYFILE_INPUT_FIRST) \
$(filter-out $(IPRT_DOXYFILE_INPUT_FIRST), $(IPRT_DOXYFILE_INPUT))
IPRT_DOXYFILE_OUTPUT = $(PATH_OUT)/docs/iprt
BLDDIRS += $(IPRT_DOXYFILE_OUTPUT)
includedep $(IPRT_OUT_DIR)/Doxyfile.iprt.dep
# Generate the Doxyfile
$(IPRT_OUT_DIR)/Doxyfile.iprt: \
$(VBOX_PATH_RUNTIME_SRC)/Doxyfile \
$(VBOX_PATH_RUNTIME_SRC)/Makefile.kmk \
$(comp-vars IPRT_DOXYFILE_INPUT,DOXYGEN_INPUT_PREV,FORCE) \
$(comp-vars IPRT_DOXYFILE_OUTPUT,DOXYGEN_OUTPUT_PREV,FORCE) \
| $$(dir $$@)
$(RM) -f $@ $@.tmp $@.dep
$(CP) -f $(VBOX_PATH_RUNTIME_SRC)/Doxyfile $@.tmp
$(APPEND) $@.tmp
$(APPEND) $@.tmp "OUTPUT_DIRECTORY = $(IPRT_DOXYFILE_OUTPUT)"
$(APPEND) $@.tmp "WARN_LOGFILE = $(IPRT_DOXYFILE_OUTPUT)/errors"
$(APPEND) $@.tmp "INCLUDE_PATH = $(PATH_ROOT)/include include . common/table"
$(APPEND) $@.tmp "INCLUDE_FILE_PATTERNS = *.cpp.h"
$(APPEND) $@.tmp "PREDEFINED += $(ARCH_BITS_DEFS)"
$(APPEND) $@.tmp
$(APPEND) $@.tmp "INPUT = $(IPRT_DOXYFILE_INPUT)"
$(APPEND) $@.tmp
$(MV) -f $@.tmp $@
@$(APPEND) $@.dep "DOXYGEN_OUTPUT_PREV = $(IPRT_DOXYFILE_OUTPUT)"
@$(APPEND) $@.dep "DOXYGEN_INPUT_PREV = $(IPRT_DOXYFILE_INPUT)"
# Do the actual job.
$(IPRT_OUT_DIR)/docs.iprt: $(IPRT_OUT_DIR)/Doxyfile.iprt $$(IPRT_DOXYFILE_INPUT) | $(IPRT_DOXYFILE_OUTPUT)/
$(RM) -f $(wildcard $(IPRT_DOXYFILE_OUTPUT)/html/*) $(IPRT_OUT_DIR)/docs.iprt
doxygen $(IPRT_OUT_DIR)/Doxyfile.iprt
$(APPEND) $(IPRT_OUT_DIR)/docs.iprt
# aliases
if !defined(VBOX_ONLY_DOCS) && defined(VBOX_WITH_ALL_DOXYGEN_TARGETS)
docs: $(IPRT_OUT_DIR)/docs.iprt
endif
test-doxygen::
@echo test-$(comp-vars IPRT_DOXYFILE_OUTPUT,DOXYGEN_OUTPUT_PREV,FORCE)
@echo $(IPRT_DOXYFILE_OUTPUT)
@echo $(DOXYGEN_OUTPUT_PREV)
@echo $(IPRT_DOXYFILE_INPUT)
#
# Generate the rules (we're the to sub-makefile).
#
include $(KBUILD_PATH)/subfooter.kmk