BUILD_ARGS?=--verbose --release --all-features --locked
CARGO_CLIPPY_ARGS?=-- -D warnings
CARGO_FMT_ARGS?=--all -- --check
CARGO_INSTALL_ARGS?=--path . --bin kickable --debug --force --locked
DOCKER_BUILD_ARGS?=-t $(DOCKER_REPOSITORY):latest
DOCKER_REPOSITORY?=defstream/kickable
.PHONY: clean format lint test docs build clippy test lint install earthly/build earthly/docker earthly/docker/services
default: help
all: clean lint test docs build docker earthly/docker/services
help:
@grep -E '^[a-zA-Z._-]+:.*?## .*$$' ${MAKEFILE_LIST} | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
clippy:
@rustup -q component add clippy
format:
@cargo fmt
check:
@cargo check ${BUILD_ARGS}
docs:
@cargo doc --no-deps
build:
@cargo build ${BUILD_ARGS} --all
test:
@cargo test ${BUILD_ARGS}
lint: clippy
@cargo fmt ${CARGO_FMT_ARGS}
@cargo clippy ${CARGO_CLIPPY_ARGS}
install:
@cargo install ${CARGO_INSTALL_ARGS}
clean:
@cargo clean
@rm -f *.profraw
@rm -rf dist
docker:
@docker build ${DOCKER_BUILD_ARGS} .
earthly/ci:
@earthly --ci +archive
earthly/build:
@earthly --ci --output +archive
earthly/docker:
@earthly --ci --push +kickable
earthly/docker/services:
@earthly --ci --push +services
@earthly --ci --push +gotham
@earthly --ci --push +graphul
@earthly --ci --push +poem
@earthly --ci --push +rocket
@earthly --ci --push +rouille
@earthly --ci --push +salvo
@earthly --ci --push +tonic-client
@earthly --ci --push +tonic-server
@earthly --ci --push +trillium
@earthly --ci --push +viz
@earthly --ci --push +warp
depot/builder:
@depot build --push -f docker/Dockerfile.builder -t defstream/builder . --platform linux/amd64,linux/arm64
depot/docker: depot/builder
@depot build -f docker/Dockerfile .
depot/docker/cross: depot/builder
@depot build -f docker/Dockerfile.cross .