Makefile.kmk revision db41c02126eebb66c1d95989a6dcf7205e7d790e
5b281ba489ca18f0380d7efc7a5108b606cce449vboxsync# Sub-Makefile for the IPRT.
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync# Copyright (C) 2006-2013 Oracle Corporation
aa8e7b8e4c5a3d78d8d9ccda1e0822c230b06544vboxsync# This file is part of VirtualBox Open Source Edition (OSE), as
aa8e7b8e4c5a3d78d8d9ccda1e0822c230b06544vboxsync# available from http://www.virtualbox.org. This file is free software;
aa8e7b8e4c5a3d78d8d9ccda1e0822c230b06544vboxsync# you can redistribute it and/or modify it under the terms of the GNU
aa8e7b8e4c5a3d78d8d9ccda1e0822c230b06544vboxsync# General Public License (GPL) as published by the Free Software
aa8e7b8e4c5a3d78d8d9ccda1e0822c230b06544vboxsync# Foundation, in version 2 as it comes in the "COPYING" file of the
aa8e7b8e4c5a3d78d8d9ccda1e0822c230b06544vboxsync# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
aa8e7b8e4c5a3d78d8d9ccda1e0822c230b06544vboxsync# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
aa8e7b8e4c5a3d78d8d9ccda1e0822c230b06544vboxsync# The contents of this file may alternatively be used under the terms
aa8e7b8e4c5a3d78d8d9ccda1e0822c230b06544vboxsync# of the Common Development and Distribution License Version 1.0
aa8e7b8e4c5a3d78d8d9ccda1e0822c230b06544vboxsync# (CDDL) only, as it comes in the "COPYING.CDDL" file of the
aa8e7b8e4c5a3d78d8d9ccda1e0822c230b06544vboxsync# VirtualBox OSE distribution, in which case the provisions of the
aa8e7b8e4c5a3d78d8d9ccda1e0822c230b06544vboxsync# CDDL are applicable instead of those of the GPL.
aa8e7b8e4c5a3d78d8d9ccda1e0822c230b06544vboxsync# You may elect to license modified versions of this file under the
aa8e7b8e4c5a3d78d8d9ccda1e0822c230b06544vboxsync# terms and conditions of either the GPL or the CDDL or both.
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsyncSUB_DEPTH = ../../..
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsyncinclude $(KBUILD_PATH)/subheader.kmk
aa8e7b8e4c5a3d78d8d9ccda1e0822c230b06544vboxsyncifdef VBOX_ONLY_ADDITIONS
aa8e7b8e4c5a3d78d8d9ccda1e0822c230b06544vboxsync # Only build the additions, sort out the legacy names first.
aa8e7b8e4c5a3d78d8d9ccda1e0822c230b06544vboxsync LIBRARIES += RuntimeGuestR3 RuntimeGuestR3Shared RuntimeGuestR3Mini
aa8e7b8e4c5a3d78d8d9ccda1e0822c230b06544vboxsync LIBRARIES.win.amd64 += RuntimeGuestR3-x86 RuntimeGuestR3Shared-x86
aa8e7b8e4c5a3d78d8d9ccda1e0822c230b06544vboxsync ifdef VBOX_WITH_ADDITION_DRIVERS
aa8e7b8e4c5a3d78d8d9ccda1e0822c230b06544vboxsync LIBRARIES += RuntimeGuestR0
aa8e7b8e4c5a3d78d8d9ccda1e0822c230b06544vboxsync #LIBRARIES.os2 += RuntimeGuestR0OS2Warp3
aa8e7b8e4c5a3d78d8d9ccda1e0822c230b06544vboxsync LIBRARIES.win.x86 += RuntimeGuestR0NT4
aa8e7b8e4c5a3d78d8d9ccda1e0822c230b06544vboxsyncelse ifdef VBOX_ONLY_TESTSUITE
aa8e7b8e4c5a3d78d8d9ccda1e0822c230b06544vboxsync # Only build the testsuite.
LIBRARIES.solaris += RuntimeR0Stub
LIBRARIES.win += RuntimeR0Stub
LIBRARIES.win.x86 += RuntimeR3VccTricks
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.l4 += RuntimeR3L4 RuntimeLnxHostR3
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.
# Unicode Specification reader used to regenerate unidata.cpp.
uniread_SOURCES = common/string/uniread.cpp
RuntimeR3_SDKS = VBOX_LIBXML2 VBOX_OPENSSL VBOX_BOOST ## @todo why is BOOST and XML2 here? r3/xml.cpp is not in this lib...
RuntimeR3_SDKS.win = $(VBOX_WINPSDK) $(VBOX_WINDDK)
RuntimeR3_DEFS = IN_RT_R3 IN_SUP_R3 LDR_WITH_NATIVE LDR_WITH_ELF32 LDR_WITH_PE RT_WITH_VBOX RT_NO_GIP
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_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 = $(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
$(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_STAGE_BIN)/VBoxRT.so
VBoxRTDummy_CLEAN = $(PATH_STAGE_BIN)/VBoxRT.so
$(PATH_STAGE_BIN)/VBoxRT.so: $$(VBoxRT_1_TARGET) | $$(dir $$@)
# 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
RuntimeR0Drv_DEFS.win = IN_SUP_R0
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
# 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 \
# Find the best way to generate a symbol list and subject it to mangling.h.