Makefile.kmk revision a4c4bba9139e4fd62b07a5ece5c3f7119849d178
1881dc979c443212bf91478a1799b23a43d8666fvboxsync# Sub-Makefile for the IPRT.
1881dc979c443212bf91478a1799b23a43d8666fvboxsync# Copyright (C) 2006-2013 Oracle Corporation
1881dc979c443212bf91478a1799b23a43d8666fvboxsync# This file is part of VirtualBox Open Source Edition (OSE), as
1881dc979c443212bf91478a1799b23a43d8666fvboxsync# available from http://www.virtualbox.org. This file is free software;
1881dc979c443212bf91478a1799b23a43d8666fvboxsync# you can redistribute it and/or modify it under the terms of the GNU
1881dc979c443212bf91478a1799b23a43d8666fvboxsync# General Public License (GPL) as published by the Free Software
1881dc979c443212bf91478a1799b23a43d8666fvboxsync# Foundation, in version 2 as it comes in the "COPYING" file of the
1881dc979c443212bf91478a1799b23a43d8666fvboxsync# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
1881dc979c443212bf91478a1799b23a43d8666fvboxsync# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
1881dc979c443212bf91478a1799b23a43d8666fvboxsync# The contents of this file may alternatively be used under the terms
1881dc979c443212bf91478a1799b23a43d8666fvboxsync# of the Common Development and Distribution License Version 1.0
1881dc979c443212bf91478a1799b23a43d8666fvboxsync# (CDDL) only, as it comes in the "COPYING.CDDL" file of the
1881dc979c443212bf91478a1799b23a43d8666fvboxsync# VirtualBox OSE distribution, in which case the provisions of the
1881dc979c443212bf91478a1799b23a43d8666fvboxsync# CDDL are applicable instead of those of the GPL.
1881dc979c443212bf91478a1799b23a43d8666fvboxsync# You may elect to license modified versions of this file under the
1881dc979c443212bf91478a1799b23a43d8666fvboxsync# terms and conditions of either the GPL or the CDDL or both.
1881dc979c443212bf91478a1799b23a43d8666fvboxsyncSUB_DEPTH = ../../..
1881dc979c443212bf91478a1799b23a43d8666fvboxsyncinclude $(KBUILD_PATH)/subheader.kmk
1881dc979c443212bf91478a1799b23a43d8666fvboxsyncifdef VBOX_ONLY_ADDITIONS
1881dc979c443212bf91478a1799b23a43d8666fvboxsync # Only build the additions, sort out the legacy names first.
1881dc979c443212bf91478a1799b23a43d8666fvboxsync LIBRARIES += RuntimeGuestR3 RuntimeGuestR3Shared RuntimeGuestR3Mini
1881dc979c443212bf91478a1799b23a43d8666fvboxsync LIBRARIES.win.amd64 += RuntimeGuestR3-x86 RuntimeGuestR3Shared-x86
1881dc979c443212bf91478a1799b23a43d8666fvboxsync ifdef VBOX_WITH_ADDITION_DRIVERS
#LIBRARIES.os2 += RuntimeGuestR0OS2Warp3
LIBRARIES.win.x86 += RuntimeGuestR0NT4
LIBRARIES.solaris += RuntimeR0Stub
LIBRARIES.win += RuntimeR0Stub
LIBRARIES.win.x86 += RuntimeR3VccTricks
include $(PATH_SUB_CURRENT)/tools/Makefile.kmk
LIBRARIES.solaris += RuntimeR0Stub
LIBRARIES.win += RuntimeR0Stub RuntimeRCStub
include $(PATH_SUB_CURRENT)/tools/Makefile.kmk
include $(PATH_SUB_CURRENT)/testcase/Makefile.kmk
include $(PATH_SUB_CURRENT)/tools/Makefile.kmk
LIBRARIES.solaris += RuntimeR0Stub
LIBRARIES.win += RuntimeR0Stub
LIBRARIES.win += RuntimeRCStub
LIBRARIES.win.amd64 += RuntimeGuestR3-x86 RuntimeGuestR3Shared-x86
#LIBRARIES.os2 += RuntimeGuestR0OS2Warp3
LIBRARIES.win.x86 += RuntimeGuestR0NT4
LIBRARIES.win.x86 += RuntimeR3VccTricks
LIBRARIES.win += RuntimeR3NtDll-x86
LIBRARIES.win += RuntimeR3NtDll-amd64
$(IPRT_OUT_DIR)/errmsgdata.h \
$(IPRT_OUT_DIR)/errmsgcomdata.h \
$(IPRT_OUT_DIR)/errmsgvboxcomdata.h \
$(IPRT_OUT_DIR)/errmsgvboxcomdata.h.ts \
$(IPRT_OUT_DIR)/Doxyfile.iprt \
$(IPRT_OUT_DIR)/Doxyfile.iprt.dep \
$(IPRT_OUT_DIR)/docs.iprt
# Set the defines that buildconfig.cpp needs. Its used by several targets.
uniread_SOURCES = common/string/uniread.cpp
RuntimeR3_SDKS.win = $(VBOX_WINPSDK) $(VBOX_WINDDK)
RuntimeR3_DEFS.linux += IPRT_WITH_FUTEX_BASED_SEMS
$(PATH_ROOT)/src/libs/liblzf-3.4
$(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
$(if $(VBOX_WITH_DBUS),VBox/dbus.cpp,)
RuntimeR3_SOURCES.win.amd64 := $(RuntimeWin64ASM_SOURCES)
RuntimeR3_SOURCES.win.x86 := $(RuntimeWin32ASM_SOURCES)
# RuntimeGuestR3 - Guest Additions Runtime (static/exe).
RuntimeGuestR3_DEFS := $(filter-out RTCRITSECT_STRICT RT_NO_GIP IPRT_WITH_OPENSSL, $(RuntimeR3_DEFS))
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).
VBoxRT_SDKS.win = $(VBOX_WINPSDK) $(VBOX_WINDDK) VBOX_NTDLL
$(filter-out common/checksum/crc32.cpp, $(RuntimeR3_SOURCES)) \
VBoxRT_SOURCES += common/misc/s3.cpp
VBoxRT_SOURCES += common/misc/http.cpp
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_LIBS.solaris += smbios
VBoxRT_LIBS.win = \
$(PATH_SDK_$(VBOX_WINDDK)_LIB)/vccomsup.lib \
$(PATH_SDK_$(VBOX_WINDDK)_LIB)/wbemuuid.lib
VBoxRT_LDFLAGS.darwin = -framework IOKit -framework CoreFoundation -framework CoreServices -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/VBoxRT.dylib
VBoxRT_LDFLAGS.win = /MANIFEST
$$(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_STAGE_BIN)/VBoxRT.so
VBoxRTDummy_CLEAN = $(PATH_STAGE_BIN)/VBoxRT.so
$(PATH_STAGE_BIN)/VBoxRT.so: $$(VBoxRT_1_TARGET) | $$(dir $$@)
VBoxRT-x86_INST.win = $(INST_DLL)x86/
VBoxRT-x86_LIBS.solaris += smbios
$(VBoxRT-x86_0_OUTDIR)/VBoxRT-x86.def
$$(VBoxRT-x86_0_OUTDIR)/VBoxRT-x86.def: \
$(PATH_SUB_CURRENT)/r3/win/VBoxRT-win32.def \
# VBoxRTImp - Import library/hack.
ifeq ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH),win.amd64)
$(call VBOX_GENERATE_IMPORT_TARGET_FN,VBoxRTImp,VBoxRT,VBox/VBoxRTImp.def r3/win/VBoxRT-openssl-ose.def r3/win/VBoxRT-win64.def)
else ifeq ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH),win.x86)
$(call VBOX_GENERATE_IMPORT_TARGET_FN,VBoxRTImp,VBoxRT,VBox/VBoxRTImp.def r3/win/VBoxRT-openssl-ose.def r3/win/VBoxRT-win32.def)
$(call VBOX_GENERATE_IMPORT_TARGET_FN,VBoxRTImp,VBoxRT,VBox/VBoxRTImp.def r3/win/VBoxRT-openssl-ose.def)
## @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 = ReorderCompilerIncs $(VBOX_WINDDK) $(VBOX_WINPSDK)INCS VBOX_OPENSSL
RuntimeR0Drv_DEFS.win = IN_SUP_R0 LDR_ONLY_PE
RuntimeR0Drv_DEFS.linux = MODULE KBUILD_MODNAME=KBUILD_STR\(vboxdrv\) KBUILD_BASENAME=KBUILD_STR\(vboxdrv\) IN_SUP_R0
RuntimeR0Drv_SOURCES.win.amd64 := $(RuntimeWin64ASM_SOURCES)
RuntimeR0Drv_SOURCES.win.x86 := $(RuntimeWin32ASM_SOURCES)
$(PATH_STAGE)/gen-sys-hdrs/bus_if.h \
$(PATH_STAGE)/gen-sys-hdrs/device_if.h
# is in the backdoor logging and the lack of sup.h (which should be
RuntimeGuestR0_SOURCES := $(filter-out generic/RTLogWriteUser-generic.cpp, $(RuntimeR0Drv_SOURCES))
# RuntimeRC_SOURCES += common/time/timesupA.asm
RuntimeRC_SOURCES += common/time/timesupref.cpp
RuntimeRC_SOURCES.win.x86 = $(RuntimeWin32ASM_SOURCES)
RuntimeRC_SOURCES += os2/sys0.asm
RuntimeEFCPP_SOURCES := r3/alloc-ef-cpp.cpp
# later WINDDK ntdll.lib have and thus we may easily end up with
$(RuntimeR3NtDll-x86_0_OUTDIR)/ntdll-mini-implib.asm
$(RuntimeR3NtDll-x86_0_OUTDIR)/ntdll-mini-implib.asm
$$(RuntimeR3NtDll-x86_0_OUTDIR)/ntdll-mini-implib.asm: $(PATH_SUB_CURRENT)/r3/win/ntdll-mini-implib.def | $$(dir $$@)
'%include "iprt/asmdefs.mac"' \
# 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_$(VBOX_WINPSDK)_INC)/WinError.h \
$(VBOX_PATH_RUNTIME_SRC)/VBox/errmsgvboxcom.xsl \
$(QUIET)$(VBOX_XSLTPROC) -o $(IPRT_OUT_DIR)/errmsgvboxcomdata.h.ts $< $(filter %.xidl,$^)
$(QUIET)$(CP) --changed -fv $(IPRT_OUT_DIR)/errmsgvboxcomdata.h.ts $(IPRT_OUT_DIR)/errmsgvboxcomdata.h
VBOX_AWK := /usr/bin/awk
$(FreeBSDGeneratedKernelHeaders_0_OUTDIR)/bus_if.h \
$(FreeBSDGeneratedKernelHeaders_0_OUTDIR)/device_if.h \
$(FreeBSDGeneratedKernelHeaders_0_OUTDIR)/pci_if.h
$$(FreeBSDGeneratedKernelHeaders_0_OUTDIR)/bus_if.h: $(VBOX_FREEBSD_SRC)/kern/bus_if.m | $$(dir $$@)
$(QUIET)$(CP) -f $< $(@D)/bus_if.m
$(QUIET)$(RM) $(@D)/bus_if.m
$$(FreeBSDGeneratedKernelHeaders_0_OUTDIR)/device_if.h: $(VBOX_FREEBSD_SRC)/kern/device_if.m | $$(dir $$@)
$(QUIET)$(CP) -f $< $(@D)/device_if.m
$(QUIET)$(RM) $(@D)/device_if.m
$$(FreeBSDGeneratedKernelHeaders_0_OUTDIR)/pci_if.h: $(VBOX_FREEBSD_SRC)/dev/pci/pci_if.m | $$(dir $$@)
$(QUIET)$(CP) -f $< $(@D)/pci_if.m
$(QUIET)$(RM) $(@D)/pci_if.m
# Aliases for .cpp.h files so we can more easily do syntax checking from the editor.
$(PATH_ROOT)/include/iprt \
$(PATH_ROOT)/include/iprt/cpp \
$(PATH_ROOT)/include/iprt/linux \
$(PATH_ROOT)/include/iprt/nocrt \
$(PATH_ROOT)/include/iprt/nocrt/x86 \
$(PATH_ROOT)/include/iprt/nocrt/amd64 \
$(PATH_ROOT)/include/iprt/nocrt/compiler \
$(VBOX_PATH_RUNTIME_SRC)/include/internal \
$(VBOX_PATH_RUNTIME_SRC)/common/alloc \
$(VBOX_PATH_RUNTIME_SRC)/common/asm \
$(VBOX_PATH_RUNTIME_SRC)/common/checksum \
$(VBOX_PATH_RUNTIME_SRC)/common/dbg \
$(VBOX_PATH_RUNTIME_SRC)/common/err \
$(VBOX_PATH_RUNTIME_SRC)/common/ldr \
$(VBOX_PATH_RUNTIME_SRC)/common/log \
$(VBOX_PATH_RUNTIME_SRC)/common/math \
$(VBOX_PATH_RUNTIME_SRC)/common/math/amd64 \
$(VBOX_PATH_RUNTIME_SRC)/common/math/gcc \
$(VBOX_PATH_RUNTIME_SRC)/common/math/x86 \
$(VBOX_PATH_RUNTIME_SRC)/common/misc \
$(VBOX_PATH_RUNTIME_SRC)/common/path \
$(VBOX_PATH_RUNTIME_SRC)/common/rand \
$(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
test-mangling:: $(IPRT_OUT_DIR)/mangling.run
OTHERS += $(IPRT_OUT_DIR)/mangling.run
CLEANS += $(IPRT_OUT_DIR)/mangling.run
$(IPRT_OUT_DIR)/mangling.run: \
# Generate a SED script from mangling.h that checks for known symbols.
$(PATH_ROOT)/include/iprt/mangling.h \
's/define \([^ ]*\) \([ ]*\)$(DOLLAR)/define \1 \2RT_MANGLER(\1)/' \
# Find the best way to generate a symbol list and subject it to mangling.h.
-e '/^HIDDEN [[:xdigit:]]\+ RT/bkeep-hidden' \
-e '/^HIDDEN [[:xdigit:]]\+ g_[a-z0-9]*RT/bkeep-hidden' \
$(QUIET)nm $^ 2> /dev/null \
$(if-expr "$(KBUILD_TARGET)" == "darwin" || "$(KBUILD_TARGET)" == "os2" || "$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)" == "win.x86", \
BLDPROGS.win += ntBldSymDb
ntBldSymDb_SOURCES = r0drv/nt/ntBldSymDb.cpp