CONFIG_UK_NAME ?= $(notdir $(APP_DIR))
endif
+# Option to overwrite file name of generated images by supported platforms. The
+# target platform has to support this feature. When unset or unsupported by the
+# platform, the default semantic of the target platform (typically
+# `$(UK_NAME)_$(PLAT)_$(ARCH)`) will be used.
+#
+# NOTE: Please note that multi-platform builds do not work anymore when this
+# option is used. The reason is that the build system will generate the
+# same file by each selected platform. Make won't be able to proceed
+# building.
+# NOTE: This feature is currently used by kraftkit.
+ifneq ($(call qstrip,$(UK_IMAGE_NAME_OVERWRITE)),)
+UK_IMAGE_NAME_OVERWRITE := $(call qstrip,$(UK_IMAGE_NAME_OVERWRITE))
+endif
+
# remove quotes from CONFIG_UK_NAME
CONFIG_UK_NAME := $(call qstrip,$(CONFIG_UK_NAME))
export CONFIG_UK_NAME
KVM_VMM := kvm
endif
+ifneq ($(UK_IMAGE_NAME_OVERWRITE),)
+KVM_IMAGE := $(BUILD_DIR)/$(UK_IMAGE_NAME_OVERWRITE)
+else
KVM_IMAGE := $(BUILD_DIR)/$(CONFIG_UK_NAME)_$(KVM_VMM)-$(CONFIG_UK_ARCH)
+endif
KVM_DEBUG_IMAGE := $(KVM_IMAGE).dbg
KVM_LD_SCRIPT_FLAGS := $(addprefix -Wl$(comma)-dT$(comma),\
##
## Link image
##
+ifneq ($(UK_IMAGE_NAME_OVERWRITE),)
+LINUXU_IMAGE := $(BUILD_DIR)/$(UK_IMAGE_NAME_OVERWRITE)
+else
LINUXU_IMAGE := $(BUILD_DIR)/$(CONFIG_UK_NAME)_linuxu-$(CONFIG_UK_ARCH)
+endif
LINUXU_DEBUG_IMAGE := $(LINUXU_IMAGE).dbg
LINUXU_LD_SCRIPT_FLAGS := $(addprefix -Wl$(comma)-T$(comma),\
$(LINUXU_LD_SCRIPT-y) $(EXTRA_LD_SCRIPT-y))
##
## Link image
##
-ifeq (arm,$(CONFIG_UK_ARCH))
+ifneq ($(UK_IMAGE_NAME_OVERWRITE),)
+XEN_RAW_IMAGE := $(BUILD_DIR)/$(UK_IMAGE_NAME_OVERWRITE)
+else
XEN_RAW_IMAGE := $(BUILD_DIR)/$(CONFIG_UK_NAME)_xen-$(CONFIG_UK_ARCH)
+endif
+ifeq (arm,$(CONFIG_UK_ARCH))
XEN_IMAGE := $(XEN_RAW_IMAGE).elf
else
-XEN_IMAGE := $(BUILD_DIR)/$(CONFIG_UK_NAME)_xen-$(CONFIG_UK_ARCH)
+XEN_IMAGE := $(XEN_RAW_IMAGE)
endif
XEN_DEBUG_IMAGE := $(XEN_IMAGE).dbg