Makefile.kmk revision 5bc8996c40d48f041460ff72c4ef6062b58aef9a
5b281ba489ca18f0380d7efc7a5108b606cce449vboxsync# Sub-Makefile for the IPRT (IPRT).
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync# Copyright (C) 2006-2007 Sun Microsystems, Inc.
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsync# This file is part of VirtualBox Open Source Edition (OSE), as
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsync# available from http://www.virtualbox.org. This file is free software;
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsync# you can redistribute it and/or modify it under the terms of the GNU
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsync# General Public License (GPL) as published by the Free Software
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsync# Foundation, in version 2 as it comes in the "COPYING" file of the
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsync# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsync# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsync# The contents of this file may alternatively be used under the terms
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsync# of the Common Development and Distribution License Version 1.0
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsync# (CDDL) only, as it comes in the "COPYING.CDDL" file of the
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsync# VirtualBox OSE distribution, in which case the provisions of the
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsync# CDDL are applicable instead of those of the GPL.
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsync# You may elect to license modified versions of this file under the
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsync# terms and conditions of either the GPL or the CDDL or both.
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync# Clara, CA 95054 USA or visit http://www.sun.com if you need
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync# additional information or have any questions.
3aad980b92149dd95a1ab72ddb8d11d61a28ace6vboxsyncSUB_DEPTH = ../../..
3aad980b92149dd95a1ab72ddb8d11d61a28ace6vboxsyncinclude $(KBUILD_PATH)/subheader.kmk
3aad980b92149dd95a1ab72ddb8d11d61a28ace6vboxsyncifdef VBOX_ONLY_ADDITIONS
0a7b20727716a00270f358a1c546473d8c36e8f3vboxsync # Only build the additions, sort out the legacy names first.
0a7b20727716a00270f358a1c546473d8c36e8f3vboxsync LIBRARIES += RuntimeGuestR0 RuntimeGuestR3 RuntimeGuestR3Shared RuntimeGuestR3Mini
0a7b20727716a00270f358a1c546473d8c36e8f3vboxsync #LIBRARIES.os2 = RuntimeGuestR0OS2Warp3
0a7b20727716a00270f358a1c546473d8c36e8f3vboxsync LIBRARIES.win.x86 += RuntimeGuestR0NT4
0a7b20727716a00270f358a1c546473d8c36e8f3vboxsync ifndef VBOX_WITH_ADDITION_DRIVERS
0a7b20727716a00270f358a1c546473d8c36e8f3vboxsync if1of ($(KBUILD_TARGET), linux l4) # All drivers are optional, can skip RuntimeGuestR0.
0a7b20727716a00270f358a1c546473d8c36e8f3vboxsync LIBRARIES := $(filter-out RuntimeGuestR0, $(LIBRARIES))
3aad980b92149dd95a1ab72ddb8d11d61a28ace6vboxsyncelse ifdef VBOX_ONLY_DOCS
3aad980b92149dd95a1ab72ddb8d11d61a28ace6vboxsync # Build docs only - need just regular R3 runtime.
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsync LIBRARIES += RuntimeR3
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsync DLLS += VBoxRT
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsyncelse # !VBOX_ONLY_ADDITIONS && !VBOX_ONLY_DOCS
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsync # Normal build.
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsync include $(PATH_SUB_CURRENT)/testcase/Makefile.kmk
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsync BLDPROGS += uniread
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsync LIBRARIES += RuntimeR3 RuntimeR0 RuntimeGC RuntimeEFCPP RuntimeR3NoCRTGCC
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsync ifdef VBOX_WITH_VBOXDRV
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsync LIBRARIES += RuntimeR0Drv
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsync ifdef VBOX_WITH_ADDITIONS
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsync LIBRARIES += RuntimeGuestR0 RuntimeGuestR3 RuntimeGuestR3Shared RuntimeGuestR3Mini
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsync #LIBRARIES.os2 += RuntimeGuestR0OS2Warp3
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsync LIBRARIES.win.x86 += RuntimeGuestR0NT4
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsync ifndef VBOX_WITH_ADDITION_DRIVERS
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsync if1of ($(KBUILD_TARGET), linux l4) # All drivers are optional, can skip RuntimeGuestR0.
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsync LIBRARIES := $(filter-out RuntimeGuestR0, $(LIBRARIES))
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsync endif # VBOX_WITH_ADDITIONS
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsync LIBRARIES.l4 += RuntimeR3L4 RuntimeLnxHostR3
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsync DLLS += VBoxRT
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsync# Where the generated stuff goes.
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsyncIPRT_OUT_DIR := $(PATH_TARGET)/Runtime
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsyncBLDDIRS += $(IPRT_OUT_DIR)
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsyncOTHER_CLEAN += \
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsync $(IPRT_OUT_DIR)/errmsgdata.h \
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsync $(IPRT_OUT_DIR)/errmsgcomdata.h \
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsync $(IPRT_OUT_DIR)/errmsgvboxcomdata.h \
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsync $(IPRT_OUT_DIR)/Doxyfile.iprt \
d605d5391db09e6395a1c091f148f4b86af84bd3vboxsync $(IPRT_OUT_DIR)/Doxyfile.iprt.dep \
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsync $(IPRT_OUT_DIR)/docs.iprt
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsyncVBOX_PATH_RUNTIME_SRC := $(PATH_SUB_CURRENT)
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsync# Unicode Specification reader used to regenerate unidata.cpp.
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsyncuniread_TEMPLATE = VBOXBLDPROG
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsyncuniread_INCS = include
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsync# Win64 assembly sources.
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsyncRuntimeWin64ASM_SOURCES = \
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsync# Win32 assembly sources.
89dfdbb56cf9dddad3c7685b41bda1e4e4c1d6f9vboxsyncRuntimeWin32ASM_SOURCES = \
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsync# NoCRT sources (minus math stuff).
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsyncRuntimeNoCrt_SOURCES = \
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsync# RuntimeR3 - Static Runtime for Ring-3 executables.
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsyncRuntimeR3_TEMPLATE = VBOXR3STATIC
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsyncRuntimeR3_SDKS = VBOX_LIBXML2 VBOX_BOOST
89dfdbb56cf9dddad3c7685b41bda1e4e4c1d6f9vboxsyncRuntimeR3_SDKS.win = WINPSDK W2K3DDK
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsyncRuntimeR3_DEFS = IN_RT_R3 IN_SUP_R3 LDR_WITH_NATIVE LDR_WITH_ELF32 LDR_WITH_PE RT_WITH_VBOX RT_NO_GIP
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsyncifdef IPRT_WITH_KSTUFF
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsync RuntimeR3_DEFS += LDR_WITH_KLDR
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsyncifdef VBOX_MAIN_RELEASE_LOG ## @todo (dmik): temporary, until RTThreadSelf/RTThreadAdopt are properly updated
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsync RuntimeR3_DEFS += RTCRITSECT_STRICT
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsyncRuntimeR3_INCS = \
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsync $(SDK_VBOX_ZLIB_INCS)
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsyncifdef VBOX_WITH_NEW_LIBLZF
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsyncRuntimeR3_INCS += \
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsyncRuntimeR3_INCS += \
89dfdbb56cf9dddad3c7685b41bda1e4e4c1d6f9vboxsyncifdef IPRT_WITH_KSTUFF
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsync RuntimeR3_INCS += \
9e5c26690d45216629b5f588aced8fcfb68c23b6vboxsync $(L4_INCDIR)
89dfdbb56cf9dddad3c7685b41bda1e4e4c1d6f9vboxsyncRuntimeR3_SOURCES = \
# RuntimeR3_SOURCES += common/time/timesupA.asm
RuntimeR3_SOURCES += common/time/timesupref.cpp
RuntimeR3_SOURCES.win.amd64 = $(RuntimeWin64ASM_SOURCES)
RuntimeR3_SOURCES.win.x86 = $(RuntimeWin32ASM_SOURCES)
# RuntimeGuestR3 - Guest Additions Runtime (static/exe).
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).
$(RuntimeR3_SOURCES.linux.$(KBUILD_TARGET_ARCH)) \
$(RuntimeR3_INCS.linux.$(KBUILD_TARGET_ARCH)) \
$(RuntimeR3_INCS.linux) \
VBoxRT_SDKS.win = WINPSDK W2K3DDK VBOX_NTDLL
VBoxRT_SOURCES.$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH) = $(RuntimeR3_SOURCES.$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH))
VBoxRT_INCS.$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH) = $(RuntimeR3_INCS.$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH))
VBoxRT_LDFLAGS.win = /MANIFEST
$(L4_LIBDIR)/libl4sys.a \
$(L4_LIBDIR)/libl4sys.p.a
VBoxRT_LIBS.l4 = \
$$(VBoxRT_0_OUTDIR)/VBoxRT.def: \
$(PATH_SUB_CURRENT)/r3/win/VBoxRT-$$(if-expr $$(KBUILD_TARGET_ARCH) == amd64,win64,win32).def \
# debugging the eprint.o bit.
VBoxRT_LDFLAGS.darwin += -v -Wl,-whyload -Wl,-v -Wl,-whatsloaded
ifneq ($(wildcard /usr/bin/chcon),)
VBoxRTDummy_LIBS = $(PATH_BIN)/VBoxRT.so
VBoxRTDummy_CLEAN= $(PATH_BIN)/VBoxRT.so
$(PATH_BIN)/VBoxRT.so: $$(TARGET_VBoxRT) | $$(dir $$@)
## @todo the *_alias.c stuff is busted, remove and use RT_WITH_NOCRT_ALIASES instead.
# RuntimeR0_SOURCES += common/time/timesupA.asm
RuntimeR0_SOURCES += common/time/timesupref.cpp
RuntimeR0_SOURCES.win.amd64 = $(RuntimeWin64ASM_SOURCES)
RuntimeR0_SOURCES.win.x86 = $(RuntimeWin32ASM_SOURCES)
RuntimeR0Drv_SDKS.win = W2K3DDK WINPSDKINCS
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!
## references to several string functions (e.g. strlen). We could include the
## The prototypes for the unresolved externals are declared in <linux/string.h>.
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)
## @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
$(QUIET)$(RM) $(PATH_RuntimeR0Drv)/bus_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
# Don't use mp-r0drv-solaris.c because it will cause crashes due to incorrect memobj-r0drv-solaris.c code.
# Use mp-r0drv-solaris.c.
# is in the backdoor logging and the lack of sup.h (which should be
RuntimeGuestR0_SOURCES := $(filter-out generic/RTLogWriteUser-generic.cpp, $(RuntimeR0Drv_SOURCES))
# RuntimeGC_SOURCES += common/time/timesupA.asm
RuntimeGC_SOURCES += common/time/timesupref.cpp
RuntimeGC_SOURCES.win.x86 = $(RuntimeWin32ASM_SOURCES)
RuntimeGC_SOURCES += os2/sys0.asm
RuntimeEFCPP_SOURCES = r3/alloc-ef-cpp.cpp
# errmsg.cpp depends on a generated header.
common/err/errmsg.cpp_INCS = $(IPRT_OUT_DIR)
win/errmsgwin.cpp_INCS = $(IPRT_OUT_DIR)
$(lib)_common/err/errmsgxpcom.cpp_INCS = $(IPRT_OUT_DIR)
$(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 \
$(IPRT_OUT_DIR)/errmsgcomdata.h: \
$(VBOX_PATH_RUNTIME_SRC)/common/err/errmsgcom.sed \
$$(PATH_SDK_WINPSDK_INC)/WinError.h \
$(IPRT_OUT_DIR)/errmsgvboxcomdata.h: \
$(VBOX_PATH_RUNTIME_SRC)/VBox/errmsgvboxcom.xsl \
# Aliases for .cpp.h files so we can more easily do syntax checking from the editor.
$(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 \
$(foreach dir, $(VBOX_PATH_RUNTIME_SRC) $(VBOX_PATH_RUNTIME_SRC)/r3 $(VBOX_PATH_RUNTIME_SRC)/r0drv,\
$(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 \
$(filter-out %.cpp.h, $(sort $(wildcard $(addsuffix /*.h, $(IPRT_DOXYFILE_INPUT_DIRS)))) ) \
IPRT_DOXYFILE_OUTPUT = $(PATH_OUT)/docs/iprt
includedep $(IPRT_OUT_DIR)/Doxyfile.iprt.dep
$(IPRT_OUT_DIR)/Doxyfile.iprt: \
$(VBOX_PATH_RUNTIME_SRC)/Makefile.kmk \
$(APPEND) $@.tmp "INCLUDE_PATH = $(PATH_ROOT)/include include . common/table"
$(APPEND) $@.tmp "INCLUDE_FILE_PATTERNS = *.cpp.h"
$(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
docs: $(IPRT_OUT_DIR)/docs.iprt
include $(KBUILD_PATH)/subfooter.kmk