DEVP_DLV_VERSION = v1.25.2
DEVP_DLV_DIR = ${DEVP_TOOLS_ROOT}/dlv/${DEVP_DLV_VERSION}
DEVP_DLV_EXE = ${DEVP_DLV_DIR}/dlv

${DEVP_DLV_EXE}:
ifdef DEVP_NO_INSTALL
ifneq ($(DEVP_VERSION),$(DEVP_CI_BUILDER_VERSION))
	$(call error_message,"Platform version is [${DEVP_VERSION}] image version is [${DEVP_CI_BUILDER_VERSION}]. Same version is expected. Updating with [make devp/update] might help. DEVP_NO_INSTALL == 1. See: https://mws.pages.mws-team.ru/devp/platform-go-tools/pgt/user/pages/platform-update.html")
	@exit 1
endif
	$(call error_message,"[dlv] is expected to be installed but it is not. Please contact /duty golang for support.")
	@exit 1
endif
	$(Q) mkdir -p ${DEVP_DLV_DIR}
	$(Q) CGO_ENABLED=0 GOBIN=${DEVP_DLV_DIR} go install github.com/go-delve/delve/cmd/dlv@${DEVP_DLV_VERSION}
	$(call green,"dlv installed as $@")

.PHONY: devp/install/dlv
devp/install/dlv: ${DEVP_DLV_EXE}
	@# Install dlv - v1.25.2
