Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
54 lines (40 loc) · 1.51 KB
/
Copy pathMakefile
File metadata and controls
54 lines (40 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
CARGO ?= cargo
INSTALL ?= install
PREFIX ?= /usr/local
BINDIR ?= $(PREFIX)/bin
DESTDIR ?=
RELEASE_BINARY ?= target/release/flywheel
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
LLVM_PREFIX ?= $(shell brew --prefix llvm 2>/dev/null)
ifneq ($(strip $(LLVM_PREFIX)),)
LIBCLANG_PATH ?= $(LLVM_PREFIX)/lib
DYLD_FALLBACK_LIBRARY_PATH ?= $(LLVM_PREFIX)/lib
export LIBCLANG_PATH
export DYLD_FALLBACK_LIBRARY_PATH
endif
endif
.DEFAULT_GOAL := build
.PHONY: build release install check fmt fmt-check lint test ci clean help
build: ## Build the development binary.
$(CARGO) build
release: ## Build the optimized production binary from the locked dependency graph.
$(CARGO) build --release --locked
install: release ## Install the production binary (PREFIX=/usr/local by default).
$(INSTALL) -d "$(DESTDIR)$(BINDIR)"
$(INSTALL) -m 0755 "$(RELEASE_BINARY)" "$(DESTDIR)$(BINDIR)/flywheel"
check: ## Type-check all targets without producing binaries.
$(CARGO) check --all-targets
fmt: ## Format Rust sources.
$(CARGO) fmt --all
fmt-check: ## Verify Rust formatting without changing files.
$(CARGO) fmt --all -- --check
lint: ## Run Clippy and reject every warning.
$(CARGO) clippy --all-targets -- -D warnings
test: ## Run the hermetic test suite.
$(CARGO) test
ci: fmt-check lint test ## Run every CI quality gate.
clean: ## Remove Cargo build output.
$(CARGO) clean
help: ## List available targets.
@awk 'BEGIN {FS = ":.*## "; print "Flywheel targets:"} /^[a-zA-Z_-]+:.*## / {printf " %-12s %s\n", $$1, $$2}' $(MAKEFILE_LIST)