Makefile.kmk revision 5763f13421bf47d142d5165590170a5d991daede
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding# Sub-Makefile for the IPRT (IPRT).
4e8732935d428b2a70151b178a95cbba5d3839f5wrowe# Copyright (C) 2006-2007 Sun Microsystems, Inc.
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding# This file is part of VirtualBox Open Source Edition (OSE), as
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding# available from http://www.virtualbox.org. This file is free software;
4e8732935d428b2a70151b178a95cbba5d3839f5wrowe# you can redistribute it and/or modify it under the terms of the GNU
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding# General Public License (GPL) as published by the Free Software
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding# Foundation, in version 2 as it comes in the "COPYING" file of the
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding# The contents of this file may alternatively be used under the terms
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding# of the Common Development and Distribution License Version 1.0
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding# (CDDL) only, as it comes in the "COPYING.CDDL" file of the
4e8732935d428b2a70151b178a95cbba5d3839f5wrowe# VirtualBox OSE distribution, in which case the provisions of the
4e8732935d428b2a70151b178a95cbba5d3839f5wrowe# CDDL are applicable instead of those of the GPL.
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding# You may elect to license modified versions of this file under the
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding# terms and conditions of either the GPL or the CDDL or both.
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding# Clara, CA 95054 USA or visit http://www.sun.com if you need
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding# additional information or have any questions.
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingifdef VBOX_KBUILD_HACKING
4e8732935d428b2a70151b178a95cbba5d3839f5wroweSUB_DEPTH = ../../..
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingSUB_DEPTH = .
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingDEPTH ?= ../../..
9ec65cbae2f760e485a1c54df5b19853688d5c91wroweinclude $(KBUILD_PATH)/subheader.kmk
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingifdef VBOX_ONLY_ADDITIONS
9ec65cbae2f760e485a1c54df5b19853688d5c91wrowe # Only build the additions, sort out the legacy names first.
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding LIBRARIES += RuntimeGuestR0 RuntimeGuestR3 RuntimeGuestR3Mini
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding #LIBRARIES.os2 = RuntimeGuestR0OS2Warp3
9ec65cbae2f760e485a1c54df5b19853688d5c91wrowe LIBRARIES.win.x86 += RuntimeGuestR0NT4
56e85d89d42a6980f31b800266649efbed338da3wrowe ifndef VBOX_WITH_ADDITION_DRIVERS
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding if1of ($(KBUILD_TARGET), linux l4) # All drivers are optional, can skip RuntimeGuestR0.
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding LIBRARIES := $(filter-out RuntimeGuestR0, $(LIBRARIES))
94b262d3639149df0b02642a9daa6db8bff58577wrowe # Normal build.
94b262d3639149df0b02642a9daa6db8bff58577wrowe include $(PATH_SUB_CURRENT)/testcase/Makefile.kmk
94b262d3639149df0b02642a9daa6db8bff58577wrowe BLDPROGS += uniread
94b262d3639149df0b02642a9daa6db8bff58577wrowe LIBRARIES += RuntimeR3 RuntimeR0 RuntimeGC RuntimeEFCPP RuntimeR3NoCRTGCC
94b262d3639149df0b02642a9daa6db8bff58577wrowe ifdef VBOX_WITH_VBOXDRV
94b262d3639149df0b02642a9daa6db8bff58577wrowe LIBRARIES += RuntimeR0Drv
4e8732935d428b2a70151b178a95cbba5d3839f5wrowe ifdef VBOX_WITH_ADDITIONS
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding LIBRARIES += RuntimeGuestR0 RuntimeGuestR3 RuntimeGuestR3Mini
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding #LIBRARIES.os2 += RuntimeGuestR0OS2Warp3
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding LIBRARIES.win.x86 += RuntimeGuestR0NT4
9ec65cbae2f760e485a1c54df5b19853688d5c91wrowe ifndef VBOX_WITH_ADDITION_DRIVERS
9ec65cbae2f760e485a1c54df5b19853688d5c91wrowe if1of ($(KBUILD_TARGET), linux l4) # All drivers are optional, can skip RuntimeGuestR0.
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding LIBRARIES := $(filter-out RuntimeGuestR0, $(LIBRARIES))
9ec65cbae2f760e485a1c54df5b19853688d5c91wrowe endif # VBOX_WITH_ADDITIONS
9ec65cbae2f760e485a1c54df5b19853688d5c91wrowe LIBRARIES.l4 += RuntimeR3L4 RuntimeLnxHostR3
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding DLLS += VBoxRT
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding OTHER_CLEAN += \
5ac28f3fe2417368757f29cf381338357605fd52wrowe $(PATH_TARGET)/errmsgdata.h \
e1ad80c048e29e968221817698529d73098f07a4wrowe $(PATH_TARGET)/errmsgcomdata.h \
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding $(PATH_TARGET)/Doxyfile.iprt \
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding $(PATH_TARGET)/Doxyfile.iprt.dep \
4439ba95daf7b82794fe338726790e2dab89d119wrowe $(PATH_TARGET)/docs.iprt
94b262d3639149df0b02642a9daa6db8bff58577wroweVBOX_PATH_RUNTIME_SRC := $(PATH_SUB_CURRENT)
94b262d3639149df0b02642a9daa6db8bff58577wrowe# Unicode Specification reader used to regenerate unidata.cpp.
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldinguniread_TEMPLATE = VBOXBLDPROG
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldinguniread_INCS = include
4e8732935d428b2a70151b178a95cbba5d3839f5wrowe# Win64 assembly sources.
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingRuntimeWin64ASM_SOURCES = \
RuntimeR3_SDKS.win = WINPSDK W2K3DDK
ifdef VBOX_MAIN_RELEASE_LOG ## @todo (dmik): temporary, until RTThreadSelf/RTThreadAdopt are properly updated
$(PATH_ROOT)/src/libs/liblzf-1.51
$(PATH_ROOT)/src/libs/kStuff/kStuff/include
# for iconv.h
# RuntimeR3_INCS.solaris = \
# 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_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))
$(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 = \
# 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!
## @todo assert-r0drv-nt.cpp
RuntimeR0Drv_SOURCES.win.amd64 = $(RuntimeWin64ASM_SOURCES)
RuntimeR0Drv_SOURCES.win.x86 = $(RuntimeWin32ASM_SOURCES)
# 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))
RuntimeGuestR0_SOURCES += VBox/logbackdoor.cpp
# 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 = $(PATH_TARGET)
win/errmsgwin.cpp_INCS = $(PATH_TARGET)
include $(KBUILD_PATH)/subfooter.kmk
ifneq ($(wildcard /usr/bin/chcon),)
$(PATH_BIN)/VBoxRT.so:
$(PATH_TARGET)/errmsgdata.h: \
$(VBOX_PATH_RUNTIME_SRC)/common/err/errmsg.sed \
$(PATH_ROOT)/include/iprt/err.h \
$(PATH_ROOT)/include/VBox/err.h
$(PATH_TARGET)/errmsgcomdata.h: \
$(VBOX_PATH_RUNTIME_SRC)/common/err/errmsgcom.sed \
$$(PATH_SDK_WINPSDK_INC)/WinError.h
# 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
-include $(PATH_TARGET)/Doxyfile.iprt.dep
$(PATH_TARGET)/Doxyfile.iprt: \
$(VBOX_PATH_RUNTIME_SRC)/Makefile.kmk \
$(RM) -f $@ $@.tmp $(PATH_TARGET)/Doxyfile.iprt.dep
$(APPEND) $@.tmp "INCLUDE_PATH = $(PATH_ROOT)/include include . common/table"
$(APPEND) $@.tmp "INCLUDE_FILE_PATTERNS = *.cpp.h"
@$(APPEND) $(PATH_TARGET)/Doxyfile.iprt.dep "DOXYGEN_OUTPUT_PREV = $(IPRT_DOXYFILE_OUTPUT)"
@$(APPEND) $(PATH_TARGET)/Doxyfile.iprt.dep "DOXYGEN_INPUT_PREV = $(IPRT_DOXYFILE_INPUT)"
$(PATH_TARGET)/docs.iprt: $(PATH_TARGET)/Doxyfile.iprt $(IPRT_DOXYFILE_INPUT) | $(call DIRDEP, $(IPRT_DOXYFILE_OUTPUT))
$(RM) -f $(wildcard $(IPRT_DOXYFILE_OUTPUT)/html/*) $(PATH_TARGET)/docs.iprt
doxygen $(PATH_TARGET)/Doxyfile.iprt
$(APPEND) $(PATH_TARGET)/docs.iprt
docs: $(PATH_TARGET)/docs.iprt