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 docker help all check
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
docker:
@docker build -f docker/Dockerfile ${DOCKER_BUILD_ARGS} .
earthly/ci:
@earthly --ci +archive
earthly/build:
@earthly --ci --output +archive
earthly/docker:
@earthly --ci --push --output +kickable
earthly/docker/services:
@earthly --ci --push +services
depot/builder:
@depot build --platform linux/amd64,linux/arm64 -f docker/Dockerfile.builder -t kickable/builder .
depot/docker: depot/builder
@depot build -f docker/Dockerfile .
depot/docker/cross: depot/builder
@depot build -f docker/Dockerfile.cross .
score/build:
@score-compose run -f ./score/axum.yaml -o ./score/axum.compose.yaml
@score-compose run -f ./score/gotham.yaml -o ./score/gotham.compose.yaml
@score-compose run -f ./score/graphul.yaml -o ./score/graphul.compose.yaml
@score-compose run -f ./score/poem.yaml -o ./score/poem.compose.yaml
@score-compose run -f ./score/rocket.yaml -o ./score/rocket.compose.yaml
@score-compose run -f ./score/rouille.yaml -o ./score/rouille.compose.yaml
@score-compose run -f ./score/tonic.yaml -o ./score/tonic.compose.yaml
@score-compose run -f ./score/viz.yaml -o ./score/viz.compose.yaml
@score-compose run -f ./score/warp.yaml -o ./score/warp.compose.yaml
score/up:
@docker compose \
-f score/axum.compose.yaml \
-f score/gotham.compose.yaml \
-f score/graphul.compose.yaml \
-f score/poem.compose.yaml \
-f score/rocket.compose.yaml \
-f score/rouille.compose.yaml \
-f score/tonic.compose.yaml \
-f score/viz.compose.yaml \
-f score/warp.compose.yaml \
up
cross/build:
@cargo build --release --all-features --locked --target aarch64-apple-darwin
@cargo build --release --all-features --locked --target aarch64-unknown-linux-musl
@cargo build --release --all-features --locked --target x86_64-apple-darwin
@RUSTFLAGS='-C linker=x86_64-w64-mingw32-gcc' cargo build --release --all-features --locked --target x86_64-pc-windows-gnu
@RUSTFLAGS='-C linker=x86_64-linux-gnu-gcc' cargo build --release --all-features --locked --target x86_64-unknown-linux-musl