_shared_consumer_default_goal := $(.DEFAULT_GOAL)
_shared_consumer_make_dir := $(dir $(lastword $(MAKEFILE_LIST)))
TOKO_TOOLING_ROOT ?= $(abspath $(_shared_consumer_make_dir)..)
TOKO_TOOLING_RUST ?= 1
ifneq ($(TOKO_TOOLING_RUST),0)
ifneq ($(TOKO_TOOLING_RUST),1)
$(error TOKO_TOOLING_RUST must be 0 or 1)
endif
endif
TOKO_TOOLING_MANIFEST ?= .toko-tooling.snapshot
TOKO_TOOLING_SOURCE ?=
TOKO_TOOLING_VERSION ?=
TOKO_TOOLING_INSTALL_TOOLS ?= 1
ifneq ($(TOKO_TOOLING_INSTALL_TOOLS),0)
ifneq ($(TOKO_TOOLING_INSTALL_TOOLS),1)
$(error TOKO_TOOLING_INSTALL_TOOLS must be 0 or 1)
endif
endif
.PHONY: toko-tooling-status toko-tooling-update toko-tooling-install
toko-tooling-status toko-tooling-update toko-tooling-install:
@bash "$(TOKO_TOOLING_ROOT)/scripts/dev/toko-tooling.sh" $(patsubst toko-tooling-%,%,$@) \
--consumer "$(CURDIR)" --manifest "$(TOKO_TOOLING_MANIFEST)" \
$(if $(strip $(TOKO_TOOLING_SOURCE)),--source "$(TOKO_TOOLING_SOURCE)",) \
$(if $(strip $(TOKO_TOOLING_VERSION)),--version "$(TOKO_TOOLING_VERSION)") \
$(if $(and $(filter toko-tooling-install toko-tooling-update,$@),$(filter 0,$(TOKO_TOOLING_INSTALL_TOOLS))),--snapshot-only)
.PHONY: toko-tooling-preview
toko-tooling-preview:
@bash "$(TOKO_TOOLING_ROOT)/scripts/dev/toko-tooling.sh" update --preview \
--consumer "$(CURDIR)" --manifest "$(TOKO_TOOLING_MANIFEST)" \
$(if $(strip $(TOKO_TOOLING_SOURCE)),--source "$(TOKO_TOOLING_SOURCE)")
include $(_shared_consumer_make_dir)tools.mk
TOKO_TOOLING_RELEASE ?= 0
ifneq ($(TOKO_TOOLING_RELEASE),0)
ifneq ($(TOKO_TOOLING_RELEASE),1)
$(error TOKO_TOOLING_RELEASE must be 0 or 1)
endif
endif
ifeq ($(TOKO_TOOLING_RELEASE),1)
include $(_shared_consumer_make_dir)release.mk
endif
toko-tooling-install toko-tooling-update: | toko-execution-check
.PHONY: toko-tooling-check
toko-tooling-check:
@bash "$(TOKO_TOOLING_ROOT)/scripts/dev/toko-tooling.sh" check \
--consumer "$(CURDIR)" --manifest "$(TOKO_TOOLING_MANIFEST)"
ifeq ($(TOKO_TOOLING_RUST),1)
include $(_shared_consumer_make_dir)rust-format.mk
.PHONY: install-hooks
install-hooks: | toko-execution-check
install-hooks:
@bash "$(TOKO_TOOLING_ROOT)/scripts/dev/install-git-hooks.sh" --consumer "$(CURDIR)"
endif
.PHONY: ci
ifneq ($(TOKO_TOOLING_PRODUCER),1)
ci: toko-tooling-check
ifeq ($(TOKO_TOOLING_RELEASE),1)
release-patch release-minor release-major release-resume release-preflight: toko-tooling-check
endif
endif
.DEFAULT_GOAL := $(_shared_consumer_default_goal)
ifneq ($(strip $(CARGO_PUBLISH_PACKAGES)),)
include $(_shared_consumer_make_dir)cargo-publication.mk
endif