Makefile.kmk revision 3d177ef5b67d80b697305787bf29e968fb256b3a
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync# Sub-Makefile for the IPRT (IPRT).
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync# Copyright (C) 2006-2007 Sun Microsystems, Inc.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync# This file is part of VirtualBox Open Source Edition (OSE), as
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync# available from http://www.virtualbox.org. This file is free software;
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync# you can redistribute it and/or modify it under the terms of the GNU
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync# General Public License (GPL) as published by the Free Software
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync# Foundation, in version 2 as it comes in the "COPYING" file of the
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync# The contents of this file may alternatively be used under the terms
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync# of the Common Development and Distribution License Version 1.0
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync# (CDDL) only, as it comes in the "COPYING.CDDL" file of the
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync# VirtualBox OSE distribution, in which case the provisions of the
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync# CDDL are applicable instead of those of the GPL.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync# You may elect to license modified versions of this file under the
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync# terms and conditions of either the GPL or the CDDL or both.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync# Clara, CA 95054 USA or visit http://www.sun.com if you need
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync# additional information or have any questions.
7220367ea1944fa8a7694534401321ad86eb70c6vboxsyncSUB_DEPTH = ../../..
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncinclude $(KBUILD_PATH)/subheader.kmk
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncifdef VBOX_ONLY_ADDITIONS
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync # Only build the additions, sort out the legacy names first.
30f237f6ee470d86afe123226be6d049f3dd9467vboxsync LIBRARIES += RuntimeGuestR0 RuntimeGuestR3 RuntimeGuestR3Shared RuntimeGuestR3Mini
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync #LIBRARIES.os2 = RuntimeGuestR0OS2Warp3
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync LIBRARIES.win.x86 += RuntimeGuestR0NT4
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync ifndef VBOX_WITH_ADDITION_DRIVERS
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync if1of ($(KBUILD_TARGET), linux l4) # All drivers are optional, can skip RuntimeGuestR0.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync LIBRARIES := $(filter-out RuntimeGuestR0, $(LIBRARIES))
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncelse ifdef VBOX_ONLY_DOCS
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync # Build docs only - need just regular R3 runtime.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync LIBRARIES += RuntimeR3
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync DLLS += VBoxRT
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncelse # !VBOX_ONLY_ADDITIONS && !VBOX_ONLY_DOCS
30f237f6ee470d86afe123226be6d049f3dd9467vboxsync # Normal build.
30f237f6ee470d86afe123226be6d049f3dd9467vboxsync include $(PATH_SUB_CURRENT)/testcase/Makefile.kmk
30f237f6ee470d86afe123226be6d049f3dd9467vboxsync BLDPROGS += uniread
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync LIBRARIES += RuntimeR3 RuntimeR0 RuntimeGC RuntimeEFCPP RuntimeR3NoCRTGCC
30f237f6ee470d86afe123226be6d049f3dd9467vboxsync ifdef VBOX_WITH_VBOXDRV
30f237f6ee470d86afe123226be6d049f3dd9467vboxsync LIBRARIES += RuntimeR0Drv
30f237f6ee470d86afe123226be6d049f3dd9467vboxsync ifdef VBOX_WITH_ADDITIONS
30f237f6ee470d86afe123226be6d049f3dd9467vboxsync LIBRARIES += RuntimeGuestR0 RuntimeGuestR3 RuntimeGuestR3Shared RuntimeGuestR3Mini
30f237f6ee470d86afe123226be6d049f3dd9467vboxsync #LIBRARIES.os2 += RuntimeGuestR0OS2Warp3
30f237f6ee470d86afe123226be6d049f3dd9467vboxsync LIBRARIES.win.x86 += RuntimeGuestR0NT4
30f237f6ee470d86afe123226be6d049f3dd9467vboxsync ifndef VBOX_WITH_ADDITION_DRIVERS
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync if1of ($(KBUILD_TARGET), linux l4) # All drivers are optional, can skip RuntimeGuestR0.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync LIBRARIES := $(filter-out RuntimeGuestR0, $(LIBRARIES))
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync endif # VBOX_WITH_ADDITIONS
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync LIBRARIES.l4 += RuntimeR3L4 RuntimeLnxHostR3
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync DLLS += VBoxRT
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync# Where the generated stuff goes.
30f237f6ee470d86afe123226be6d049f3dd9467vboxsyncIPRT_OUT_DIR := $(PATH_TARGET)/Runtime
30f237f6ee470d86afe123226be6d049f3dd9467vboxsyncBLDDIRS += $(IPRT_OUT_DIR)
30f237f6ee470d86afe123226be6d049f3dd9467vboxsyncOTHER_CLEAN += \
30f237f6ee470d86afe123226be6d049f3dd9467vboxsync $(IPRT_OUT_DIR)/errmsgdata.h \
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync $(IPRT_OUT_DIR)/errmsgcomdata.h \
30f237f6ee470d86afe123226be6d049f3dd9467vboxsync $(IPRT_OUT_DIR)/errmsgvboxcomdata.h \
30f237f6ee470d86afe123226be6d049f3dd9467vboxsync $(IPRT_OUT_DIR)/Doxyfile.iprt \
30f237f6ee470d86afe123226be6d049f3dd9467vboxsync $(IPRT_OUT_DIR)/Doxyfile.iprt.dep \
4ef1cd1012e75ff26e27b27d319ecfdf470b2190vboxsync $(IPRT_OUT_DIR)/docs.iprt
30f237f6ee470d86afe123226be6d049f3dd9467vboxsyncVBOX_PATH_RUNTIME_SRC := $(PATH_SUB_CURRENT)
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync# Set the defines that buildconfig.cpp needs. Its used by several targets.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync IPRT_BLDCFG_SCM_REV=$(VBOX_SVN_REV) \
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync IPRT_BLDCFG_VERSION_STRING=\"$(VBOX_VERSION_STRING)\" \
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync IPRT_BLDCFG_VERSION_MAJOR=$(VBOX_VERSION_MAJOR) \
7220367ea1944fa8a7694534401321ad86eb70c6vboxsync IPRT_BLDCFG_VERSION_MINOR=$(VBOX_VERSION_MINOR) \
7220367ea1944fa8a7694534401321ad86eb70c6vboxsync IPRT_BLDCFG_VERSION_BUILD=$(VBOX_VERSION_BUILD)
# Unicode Specification reader used to regenerate unidata.cpp.
uniread_SOURCES = common/string/uniread.cpp
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 VBOX_MAIN_RELEASE_LOG ## @todo (dmik): temporary, until RTThreadSelf/RTThreadAdopt are properly updated
$(PATH_ROOT)/src/libs/liblzf-3.4
$(PATH_ROOT)/src/libs/liblzf-1.51
$(PATH_ROOT)/src/libs/kStuff/kStuff/include
# RuntimeR3_INCS.solaris = \
# RuntimeR3_SOURCES += common/time/timesupA.asm
RuntimeR3_SOURCES += common/time/timesupref.cpp
RuntimeR3_SOURCES += common/misc/lzjb.c
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_SOURCES.win += \
$(VBoxRT_0_OUTDIR)/VBoxRT.def
VBoxRT_SOURCES.linux += \
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 \
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
## 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