mirror of
https://github.com/rustfs/rustfs.git
synced 2026-07-26 16:28:15 +00:00
d26e06bf46
CONTRIBUTING.md and the Makefile HEADER advertised nonexistent targets (make clippy, make check) and claimed 'make pre-commit' runs format + clippy + check + test, while .config/make/pre-commit.mak actually runs fmt-check + guard scripts + quick-check with no clippy and no tests. CONTRIBUTING.md also claimed the repository ships an automated pre-commit git hook, but no hook is versioned. - Replace phantom targets with the real ones (clippy-check, quick-check, compilation-check) - Document exactly what pre-commit and pre-pr run, gate by gate, with an explicit note that pre-commit runs no clippy and no tests - Point contributors to 'make pre-pr' as the full pre-PR gate - Rewrite the git-hooks section to say hooks are optional and not versioned; setup-hooks only marks an existing hook executable No make targets were added or changed; docs/help truth only. Refs: rustfs/backlog#1153 (infra-9), rustfs/backlog#1155
83 lines
2.5 KiB
Makefile
83 lines
2.5 KiB
Makefile
###########
|
|
# Remote development requires VSCode with Dev Containers, Remote SSH, Remote Explorer
|
|
# https://code.visualstudio.com/docs/remote/containers
|
|
###########
|
|
|
|
.PHONY: SHELL
|
|
|
|
# Makefile global config
|
|
# Use config.mak to override any of the following variables.
|
|
# Do not make changes here.
|
|
|
|
.DEFAULT_GOAL := help
|
|
.EXPORT_ALL_VARIABLES:
|
|
.ONESHELL:
|
|
.SILENT:
|
|
|
|
NUM_CORES := $(shell nproc 2>/dev/null || sysctl -n hw.ncpu)
|
|
|
|
MAKEFLAGS += -j$(NUM_CORES) -l$(NUM_CORES)
|
|
MAKEFLAGS += --silent
|
|
|
|
SHELL := $(shell which bash)
|
|
.SHELLFLAGS = -eu -o pipefail -c
|
|
|
|
DOCKER_CLI ?= docker
|
|
IMAGE_NAME ?= rustfs:v1.0.0
|
|
CONTAINER_NAME ?= rustfs-dev
|
|
# Docker build configurations
|
|
DOCKERFILE_PRODUCTION = Dockerfile
|
|
DOCKERFILE_SOURCE = Dockerfile.source
|
|
BUILD_OS ?= rockylinux9.3
|
|
|
|
# Makefile colors config
|
|
bold := $(shell tput bold)
|
|
normal := $(shell tput sgr0)
|
|
errorTitle := $(shell tput setab 1 && tput bold && echo '\n')
|
|
recommendation := $(shell tput setab 4)
|
|
underline := $(shell tput smul)
|
|
reset := $(shell tput -Txterm sgr0)
|
|
black := $(shell tput setaf 0)
|
|
red := $(shell tput setaf 1)
|
|
green := $(shell tput setaf 2)
|
|
yellow := $(shell tput setaf 3)
|
|
blue := $(shell tput setaf 4)
|
|
magenta := $(shell tput setaf 5)
|
|
cyan := $(shell tput setaf 6)
|
|
white := $(shell tput setaf 7)
|
|
|
|
define HEADER
|
|
How to use me:
|
|
# To get help for each target
|
|
${bold}make help${reset}
|
|
|
|
# To run and execute a target
|
|
${bold}make ${cyan}<target>${reset}
|
|
|
|
💡 For more help use 'make help', 'make help-build' or 'make help-docker'
|
|
|
|
🦀 RustFS Makefile Help:
|
|
|
|
📋 Main Command Categories:
|
|
make help-build # Show build-related help
|
|
make help-docker # Show Docker-related help
|
|
|
|
🔧 Code Quality:
|
|
make fmt # Format code
|
|
make clippy-check # Run clippy (all targets, all features, -D warnings)
|
|
make quick-check # Fast workspace compile check (excludes e2e_test)
|
|
make test # Script tests + workspace tests + doc tests
|
|
make pre-commit # Fast gate: fmt-check + guard scripts + quick-check (NO clippy, NO tests)
|
|
make pre-pr # Full pre-PR gate: pre-commit gates + clippy-check + test
|
|
|
|
🚀 Quick Start:
|
|
make build # Build RustFS binary
|
|
make docker-dev-local # Build development Docker image (local)
|
|
make dev-env-start # Start development environment
|
|
|
|
|
|
endef
|
|
export HEADER
|
|
|
|
-include $(addsuffix /*.mak, $(shell find .config/make -type d))
|