DEVP_ROOT := $(if $(DEVP_ROOT),$(DEVP_ROOT),${HOME}/.devp)
DEVP_TOOLS_ROOT := ${DEVP_ROOT}/tools

PWD_PATH = $(shell pwd)
BIN_PATH := $(if $(BIN_PATH),$(BIN_PATH),${PWD_PATH}/bin)
DEVP_BIN_PATH := ${BIN_PATH}/devp

DEVP_BIN_PATH_FOLDER := ${DEVP_BIN_PATH}/.check

${DEVP_BIN_PATH_FOLDER}:
	$(Q) mkdir -p ${DEVP_BIN_PATH}
	$(Q) touch $@

DEVP_BUILD ?= .devp

DEVP_SCRIPTS_ROOT := $(if $(DEVP_SCRIPTS_ROOT),$(DEVP_SCRIPTS_ROOT),.)
DEVP_SCRIPTS := $(if $(DEVP_SCRIPTS),$(DEVP_SCRIPTS),${DEVP_SCRIPTS_ROOT}/scripts/devp)

include ${DEVP_SCRIPTS}/print.mk
# Print adds $(Q) and colors, include other scripts after it.

include ${DEVP_SCRIPTS}/version.mk
include ${DEVP_SCRIPTS}/help.mk
include ${DEVP_SCRIPTS}/build.mk
include ${DEVP_SCRIPTS}/install.mk
include ${DEVP_SCRIPTS}/lint/lint.mk
include ${DEVP_SCRIPTS}/format.mk
include ${DEVP_SCRIPTS}/test/test.mk
include ${DEVP_SCRIPTS}/generate.mk
include ${DEVP_SCRIPTS}/update.mk
include ${DEVP_SCRIPTS}/check.mk
include ${DEVP_SCRIPTS}/protoc.mk
include ${DEVP_SCRIPTS}/gomod.mk
include ${DEVP_SCRIPTS}/godeviz.mk
include ${DEVP_SCRIPTS}/releaser.mk
include ${DEVP_SCRIPTS}/changes.mk

.PHONY: devp/version
devp/version:
	@# Print devp version
	@echo "v${DEVP_VERSION}"
