Makefile.kmk revision fa9c140952e57a8fc216bbf357adac75a409eee0
a0f8619bc2bbe3614578c21b5b50a88d2841e7aavboxsync# Sub-Makefile for the support library and the drivers/modules/kexts it uses.
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync# Copyright (C) 2006 InnoTek Systemberatung GmbH
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync# This file is part of VirtualBox Open Source Edition (OSE), as
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync# available from http://www.virtualbox.org. This file is free software;
a0f8619bc2bbe3614578c21b5b50a88d2841e7aavboxsync# you can redistribute it and/or modify it under the terms of the GNU
e64031e20c39650a7bc902a3e1aba613b9415deevboxsync# General Public License as published by the Free Software Foundation,
a0f8619bc2bbe3614578c21b5b50a88d2841e7aavboxsync# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
a0f8619bc2bbe3614578c21b5b50a88d2841e7aavboxsync# distribution. VirtualBox OSE is distributed in the hope that it will
a0f8619bc2bbe3614578c21b5b50a88d2841e7aavboxsync# be useful, but WITHOUT ANY WARRANTY of any kind.
a0f8619bc2bbe3614578c21b5b50a88d2841e7aavboxsync# If you received this file as part of a commercial VirtualBox
a0f8619bc2bbe3614578c21b5b50a88d2841e7aavboxsync# distribution, then only the terms of your commercial VirtualBox
a0f8619bc2bbe3614578c21b5b50a88d2841e7aavboxsync# license agreement apply instead of the previous paragraph.
a0f8619bc2bbe3614578c21b5b50a88d2841e7aavboxsyncDEPTH ?= ../../../..
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsyncSUB_DEPTH = ..
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsyncinclude $(PATH_KBUILD)/subheader.kmk
43747b1f0bc8302a238fb35e55857a5e9aa1933dvboxsyncLIBRARIES += SUPR3
43747b1f0bc8302a238fb35e55857a5e9aa1933dvboxsyncifneq ($(filter-out darwin,$(BUILD_TARGET)),)
43747b1f0bc8302a238fb35e55857a5e9aa1933dvboxsyncLIBRARIES += SUPR0
43747b1f0bc8302a238fb35e55857a5e9aa1933dvboxsyncifdef VBOX_WITH_VBOXDRV
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsyncINSTALLS.linux = vboxmod-bin vboxmod-sh
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync# Include sub-makefile(s).
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsyncinclude $(PATH_SUB_CURRENT)/testcase/Makefile.kmk
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsyncvboxmod-bin_INST = bin/src/
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsyncvboxmod-bin_MODE = a+r,u+w
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsyncvboxmod-bin_SOURCES = \
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync $(PATH_ROOT)/include/iprt/alloc.h=>include/iprt/alloc.h \
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync $(PATH_ROOT)/include/iprt/asm.h=>include/iprt/asm.h \
0493c79a1867f7760af6bc330c8c42a09da852abvboxsync $(PATH_ROOT)/include/iprt/assert.h=>include/iprt/assert.h \
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync $(PATH_ROOT)/include/iprt/cdefs.h=>include/iprt/cdefs.h \
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync $(PATH_ROOT)/include/iprt/err.h=>include/iprt/err.h \
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync $(PATH_ROOT)/include/iprt/heap.h=>include/iprt/heap.h \
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync $(PATH_ROOT)/include/iprt/initterm.h=>include/iprt/initterm.h \
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync $(PATH_ROOT)/include/iprt/log.h=>include/iprt/log.h \
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync $(PATH_ROOT)/include/iprt/mem.h=>include/iprt/mem.h \
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync $(PATH_ROOT)/include/iprt/param.h=>include/iprt/param.h \
22ec733a5e041fcdfe02fce2eafc9faf8b0077ddvboxsync $(PATH_ROOT)/include/iprt/process.h=>include/iprt/process.h \
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync $(PATH_ROOT)/include/iprt/semaphore.h=>include/iprt/semaphore.h \
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync $(PATH_ROOT)/include/iprt/spinlock.h=>include/iprt/spinlock.h \
54211a0f33e1613ca0f749141ee8ec6fc0ea5c68vboxsync $(PATH_ROOT)/include/iprt/stdarg.h=>include/iprt/stdarg.h \
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync $(PATH_ROOT)/include/iprt/stdint.h=>include/iprt/stdint.h \
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync $(PATH_ROOT)/include/iprt/string.h=>include/iprt/string.h \
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync $(PATH_ROOT)/include/iprt/thread.h=>include/iprt/thread.h \
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync $(PATH_ROOT)/include/iprt/types.h=>include/iprt/types.h \
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync $(PATH_ROOT)/include/iprt/avl.h=>include/iprt/avl.h \
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync $(PATH_ROOT)/include/VBox/cdefs.h=>include/VBox/cdefs.h \
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync $(PATH_ROOT)/include/VBox/log.h=>include/VBox/log.h \
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync $(PATH_ROOT)/include/VBox/sup.h=>include/VBox/sup.h \
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync $(PATH_ROOT)/include/VBox/types.h=>include/VBox/types.h \
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync $(PATH_ROOT)/src/VBox/Runtime/include/internal/initterm.h=>include/internal/initterm.h \
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync $(PATH_ROOT)/src/VBox/Runtime/include/internal/thread.h=>include/internal/thread.h \
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync $(PATH_ROOT)/src/VBox/Runtime/include/internal/magics.h=>include/internal/magics.h \
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync $(PATH_SUB_CURRENT)/linux/SUPDrv-linux.c=>linux/SUPDrv-linux.c \
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync $(PATH_SUB_CURRENT)/linux/Makefile=>Makefile \
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync $(PATH_ROOT)/src/VBox/Runtime/alloc/heapsimple.cpp=>alloc/heapsimple.c \
230bd8589bba39933ac5ec21482d6186d675e604vboxsync $(PATH_ROOT)/src/VBox/Runtime/r0drv/alloc-r0drv.cpp=>r0drv/alloc-r0drv.c \
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync $(PATH_ROOT)/src/VBox/Runtime/r0drv/alloc-r0drv.h=>r0drv/alloc-r0drv.h \
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync $(PATH_ROOT)/src/VBox/Runtime/r0drv/initterm-r0drv.cpp=>r0drv/initterm-r0drv.c \
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync $(PATH_ROOT)/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c=>r0drv/linux/alloc-r0drv-linux.c \
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync $(PATH_ROOT)/src/VBox/Runtime/r0drv/linux/initterm-r0drv-linux.c=>r0drv/linux/initterm-r0drv-linux.c \
a0f8619bc2bbe3614578c21b5b50a88d2841e7aavboxsync $(PATH_ROOT)/src/VBox/Runtime/r0drv/linux/process-r0drv-linux.c=>r0drv/linux/process-r0drv-linux.c \
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync $(PATH_ROOT)/src/VBox/Runtime/r0drv/linux/semaphore-r0drv-linux.c=>r0drv/linux/semaphore-r0drv-linux.c \
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync $(PATH_ROOT)/src/VBox/Runtime/r0drv/linux/spinlock-r0drv-linux.c=>r0drv/linux/spinlock-r0drv-linux.c \
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync $(PATH_ROOT)/src/VBox/Runtime/r0drv/linux/string.h=>r0drv/linux/string.h \
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsync $(PATH_ROOT)/src/VBox/Runtime/r0drv/linux/thread-r0drv-linux.c=>r0drv/linux/thread-r0drv-linux.c \
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsync $(PATH_ROOT)/src/VBox/Runtime/r0drv/linux/the-linux-kernel.h=>r0drv/linux/the-linux-kernel.h \
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync $(PATH_OUT)/version-generated.h=>version-generated.h \
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsyncvboxmod-sh_INST = bin/src
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsyncvboxmod-sh_MODE = a+rx,u+w
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsyncvboxmod-sh_SOURCES = \
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync $(PATH_SUB_CURRENT)/linux/build_in_tmp=>build_in_tmp
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync# The Ring-3 Support Library (this is linked into the IPRT dll, VBoxRT).
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsyncifneq ($(filter l4%,$(BUILD_TARGET) $(BUILD_TARGET_SUB)),)
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync# L4 has trouble with -pedantic. It also make trouble when inlining is not enabled.
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsyncSUPR3_TEMPLATE = VBOXR3NP
a0f8619bc2bbe3614578c21b5b50a88d2841e7aavboxsyncSUPR3_TEMPLATE = VBOXR3
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsyncSUPR3_DEFS = IN_SUP_R3 IN_RT_R3
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsyncSUPR3_INCS := $(PATH_SUB_CURRENT)
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsyncifneq ($(BUILD_TARGET),win) ## @todo rename win32 -> win!
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsyncSUPR3_SOURCES = \
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync $(BUILD_TARGET)/SUPLib-$(BUILD_TARGET).cpp
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsyncSUPR3_SOURCES = \
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync# SUPR0 - The Ring-0 Import / Thunk library.
b4fc07ae3f394595370fc5ed6ab1c353a87259dbvboxsyncSUPR0_TEMPLATE = VBOXR0
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsyncifeq ($(VBOX_LDR_FMT),pe)
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsyncSUPR0_SOURCES += SUPR0.def
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsyncifeq ($(VBOX_LDR_FMT),lx)
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsyncSUPR0_SOURCES += $(PATH_TARGET)/SUPR0.def
8bed792bc65abd39393889351f22263ce6c289bfvboxsync$(PATH_TARGET)/SUPR0.def: $(PATH_SUB_CURRENT)/SUPR0.def | $(call DIRDEP,$(PATH_TARGET))
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync $(SED) -e 's/^[ \t][ \t]*\([gA-Z]\)/ _\1/' -e 's/[ \t]DATA[ \t]*/ /' $< > $@.tmp
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync $(MV) -f $@.tmp $@
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync# VBoxDrv.sys - The Windows driver.
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsyncifeq ($(BUILD_TARGET),win)
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsyncVBoxDrv_TEMPLATE = VBOXR0DRV
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsyncVBoxDrv_DEFS = IN_RT_R0 IN_SUP_R0
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsyncVBoxDrv_SDKS = W2K3DDK WINPSDKINCS
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsyncVBoxDrv_INCS := $(PATH_SUB_CURRENT)
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsyncVBoxDrv_SOURCES = \
a0f8619bc2bbe3614578c21b5b50a88d2841e7aavboxsyncVBoxDrv_LDFLAGS.x86 = -Entry:DriverEntry@8
a0f8619bc2bbe3614578c21b5b50a88d2841e7aavboxsyncVBoxDrv_LDFLAGS.amd64 = -Entry:DriverEntry
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsyncVBoxDrv_LIBS = \
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync $(PATH_SDK_W2K3DDK_LIB)/ntoskrnl.lib \
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync $(PATH_SDK_W2K3DDK_LIB)/hal.lib \
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync $(PATH_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB)
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync# vboxdrv.ko - The Linux Kernel Module.
a0f8619bc2bbe3614578c21b5b50a88d2841e7aavboxsyncifeq ($(BUILD_TARGET),linux)
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsyncvboxdrv_TEMPLATE = VBOXR0DRV
a0f8619bc2bbe3614578c21b5b50a88d2841e7aavboxsyncvboxdrv_DEFS = KBUILD_MODNAME=KBUILD_STR\(vboxdrv\) KBUILD_BASENAME=KBUILD_STR\(vboxdrv\) MODULE IN_RT_R0 IN_SUP_R0 CONFIG_VBOXDRV_AS_MISC
a0f8619bc2bbe3614578c21b5b50a88d2841e7aavboxsyncvboxdrv_INCS := $(PATH_SUB_CURRENT)
a0f8619bc2bbe3614578c21b5b50a88d2841e7aavboxsyncvboxdrv_LIBS = $(PATH_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB)
a0f8619bc2bbe3614578c21b5b50a88d2841e7aavboxsyncvboxdrv_LIBS.debug = $(vboxdrv_LIBS) $(VBOX_GCC_LIBGCC)
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsyncvboxdrv_SOURCES = \
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync $(BUILD_TARGET)/SUPDrv-$(BUILD_TARGET).c \
a0f8619bc2bbe3614578c21b5b50a88d2841e7aavboxsyncifndef VBOX_LINUX_VERSION_2_4
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsyncvboxdrv_SOURCES += \
a0f8619bc2bbe3614578c21b5b50a88d2841e7aavboxsync $(BUILD_TARGET)/SUPDrv-$(BUILD_TARGET).mod.c
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsyncendif # real linux
a0f8619bc2bbe3614578c21b5b50a88d2841e7aavboxsync# VBoxDrv.kext - The Darwin Kernel Extension.
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsyncifeq ($(BUILD_TARGET),darwin)
a0f8619bc2bbe3614578c21b5b50a88d2841e7aavboxsyncVBoxDrv_TEMPLATE = VBOXR0DRV
a0f8619bc2bbe3614578c21b5b50a88d2841e7aavboxsyncVBoxDrv_DEFS = IN_RT_R0 IN_SUP_R0 USE_NEW_OS_INTERFACE
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsyncVBoxDrv_DEFS += DEBUG_DARWIN_GIP
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsyncVBoxDrv_INCS := $(PATH_SUB_CURRENT)
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsyncVBoxDrv_LIBS = $(PATH_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB)
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsyncVBoxDrv_LDFLAGS = -v -Wl,-whyload -Wl,-v -Wl,-whatsloaded
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsyncVBoxDrv_INST = $(INST_VBOXDRV)Contents/MacOS/
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsyncVBoxDrv_SOURCES = \
a0f8619bc2bbe3614578c21b5b50a88d2841e7aavboxsync $(BUILD_TARGET)/SUPDrv-$(BUILD_TARGET).cpp
a9f41cb889f53e8407561a6155052c441eb0fc5fvboxsyncVBoxDrv.kext_INST = $(INST_VBOXDRV)Contents/
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync $(PATH_TARGET)/Info.plist
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync$(PATH_TARGET)/Info.plist: $(PATH_SUB_CURRENT)/darwin/Info.plist $(VBOX_VERSION_MK) | $(call DIRDEP,$(PATH_TARGET))
a0f8619bc2bbe3614578c21b5b50a88d2841e7aavboxsync $(call MSG_GENERATE,VBoxDrv,$@,$<)
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync $(xQUIET)$(RM) -f $@
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync $(xQUIET)$(SED) \
a0f8619bc2bbe3614578c21b5b50a88d2841e7aavboxsync -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
a0f8619bc2bbe3614578c21b5b50a88d2841e7aavboxsync -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsyncINSTALLS += Scripts
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsyncScripts_INST = $(INST_DIST)
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsyncScripts_SOURCES = \
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync# VBoxDrv.sys - The OS/2 driver.
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsyncifeq ($(BUILD_TARGET),os2)
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsyncVBoxDrv_TEMPLATE = VBOXR0DRV
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsyncVBoxDrv_DEFS = IN_RT_R0 IN_SUP_R0 USE_NEW_OS_INTERFACE
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsyncVBoxDrv_INCS := $(PATH_SUB_CURRENT)
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync#VBoxDrv_LDFLAGS = -s -t -v
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsyncVBoxDrv_SOURCES = \
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsyncVBoxDrv_LIBS = \
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync $(TARGET_VBoxDrvLib) \
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync $(PATH_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB) \
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync $(VBOX_GCC_LIBGCC) \
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync# temp hack to ensure that SUPDrvA-os2.asm is first in the link.
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsyncLIBRARIES += VBoxDrvLib
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsyncVBoxDrvLib_TEMPLATE = VBOXR0DRV
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsyncVBoxDrvLib_NOINST = 1
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsyncVBoxDrvLib_DEFS = IN_RT_R0 IN_SUP_R0 USE_NEW_OS_INTERFACE
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsyncVBoxDrvLib_INCS := \
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync $(PATH_SUB_CURRENT) \
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync $(PATH_TARGET) \
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsyncVBoxDrvLib_SOURCES = \
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync# symlinked??
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsyncinclude $(PATH_KBUILD)/subfooter.kmk