Makefile.kmk revision 2938e8e82a3275158ae4f3444a224e97015784cb
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsync# Sub-Makefile for the IPRT (IPRT).
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsync# Copyright (C) 2006-2007 Sun Microsystems, Inc.
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsync# This file is part of VirtualBox Open Source Edition (OSE), as
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsync# available from http://www.virtualbox.org. This file is free software;
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsync# you can redistribute it and/or modify it under the terms of the GNU
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsync# General Public License (GPL) as published by the Free Software
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsync# Foundation, in version 2 as it comes in the "COPYING" file of the
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsync# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsync# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsync# The contents of this file may alternatively be used under the terms
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsync# of the Common Development and Distribution License Version 1.0
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsync# (CDDL) only, as it comes in the "COPYING.CDDL" file of the
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsync# VirtualBox OSE distribution, in which case the provisions of the
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsync# CDDL are applicable instead of those of the GPL.
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsync# You may elect to license modified versions of this file under the
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsync# terms and conditions of either the GPL or the CDDL or both.
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsync# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsync# Clara, CA 95054 USA or visit http://www.sun.com if you need
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsync# additional information or have any questions.
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsyncDEPTH ?= ../../..
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsyncSUB_DEPTH = .
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsyncinclude $(KBUILD_PATH)/subheader.kmk
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsyncifdef VBOX_ONLY_ADDITIONS
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsync # Only build the additions, sort out the legacy names first.
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsync LIBRARIES = RuntimeGuestR0 RuntimeGuestR3 RuntimeGuestR3Mini
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsync #LIBRARIES.os2 = RuntimeGuestR0OS2Warp3
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsync LIBRARIES.win.x86 = RuntimeGuestR0NT4
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsync ifndef VBOX_WITH_ADDITION_DRIVERS
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsync if1of ($(KBUILD_TARGET), linux l4) # All drivers are optional, can skip RuntimeGuestR0.
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsync LIBRARIES := $(filter-out RuntimeGuestR0, $(LIBRARIES))
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsync # Normal build.
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsync BLDPROGS = uniread
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsync LIBRARIES = RuntimeR3 RuntimeR0 RuntimeGC RuntimeEFCPP RuntimeR3NoCRTGCC
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsync ifdef VBOX_WITH_VBOXDRV
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsync LIBRARIES += RuntimeR0Drv
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsync ifdef VBOX_WITH_ADDITIONS
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsync LIBRARIES += RuntimeGuestR0 RuntimeGuestR3 RuntimeGuestR3Mini
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsync #LIBRARIES.os2 = RuntimeGuestR0OS2Warp3
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsync LIBRARIES.win.x86 = RuntimeGuestR0NT4
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsync ifndef VBOX_WITH_ADDITION_DRIVERS
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsync if1of ($(KBUILD_TARGET), linux l4) # All drivers are optional, can skip RuntimeGuestR0.
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsync LIBRARIES := $(filter-out RuntimeGuestR0, $(LIBRARIES))
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsync endif # VBOX_WITH_ADDITIONS
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsync LIBRARIES.l4 = RuntimeR3L4 RuntimeLnxHostR3
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsync DLLS = VBoxRT
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsync OTHER_CLEAN = \
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsync $(PATH_TARGET)/errmsgdata.h \
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsync $(PATH_TARGET)/errmsgcomdata.h \
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsync $(PATH_TARGET)/Doxyfile \
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsync $(PATH_TARGET)/Doxyfile.dep \
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsync $(PATH_TARGET)/docs.iprt
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsync# Unicode Specification reader used to regenerate unidata.cpp.
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsyncuniread_TEMPLATE = VBOXBLDPROG
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsyncuniread_INCS = include
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsync# Win64 assembly sources.
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsyncRuntimeWin64ASM_SOURCES = \
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsync# Win32 assembly sources.
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsyncRuntimeWin32ASM_SOURCES = \
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsync# RuntimeR3 - Static Runtime for Ring-3 executables.
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsyncRuntimeR3_TEMPLATE = VBOXR3EXE
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsyncRuntimeR3_SDKS.win = WINPSDK W2K3DDK
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsyncRuntimeR3_DEFS = IN_RT_R3 IN_SUP_R3 LDR_WITH_NATIVE LDR_WITH_ELF32 LDR_WITH_PE RT_WITH_VBOX
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsyncifdef IPRT_WITH_KSTUFF
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsync RuntimeR3_DEFS += LDR_WITH_KLDR
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsyncifdef VBOX_MAIN_RELEASE_LOG ## @todo (dmik): temporary, until RTThreadSelf/RTThreadAdopt are properly updated
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsync RuntimeR3_DEFS += RTCRITSECT_STRICT
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsyncRuntimeR3_INCS = \
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsyncifdef IPRT_WITH_KSTUFF
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsync RuntimeR3_INCS += \
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsync $(L4_INCDIR)
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsyncRuntimeR3_SOURCES = \
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsync#if1of ($(KBUILD_TARGET_ARCH),amd64 x86)
b9fc40283b616e122f07c8f48b0bf9c6afc3fab2vboxsync# 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 and 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: common/err/errmsg.sed $(DEPTH)/include/iprt/err.h $(DEPTH)/include/VBox/err.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 \
$(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, $(DOXYGEN_INPUT_DIRS)))) ) \
DOXYGEN_OUTPUT = $(PATH_OUT)/docs/iprt
-include $(PATH_TARGET)/Doxyfile.dep
$(PATH_TARGET)/Doxyfile: Doxyfile Makefile.kmk \
$(RM) -f $@ $@.tmp $(PATH_TARGET)/Doxyfile.dep
$(APPEND) $@.tmp "INCLUDE_PATH = $(PATH_ROOT)/include include . common/table"
$(APPEND) $@.tmp "INCLUDE_FILE_PATTERNS = *.cpp.h"
@$(APPEND) $(PATH_TARGET)/Doxyfile.dep "DOXYGEN_OUTPUT_PREV = $(DOXYGEN_OUTPUT)"
@$(APPEND) $(PATH_TARGET)/Doxyfile.dep "DOXYGEN_INPUT_PREV = $(DOXYGEN_INPUT)"
$(PATH_TARGET)/docs.iprt: $(PATH_TARGET)/Doxyfile $(DOXYGEN_INPUT) | $(call DIRDEP, $(DOXYGEN_OUTPUT))
$(RM) -f $(wildcard $(DOXYGEN_OUTPUT)/html/*) $(PATH_TARGET)/docs.iprt
$(APPEND) $(PATH_TARGET)/docs.iprt
docs: $(PATH_TARGET)/docs.iprt