37 lines
1003 B
Makefile
37 lines
1003 B
Makefile
AM_CFLAGS = -Wall -Wextra -O2
|
|
|
|
bin_PROGRAMS = fastwc
|
|
fastwc_SOURCES = src/main.c
|
|
|
|
# Release build consumed by benchmarks/ (expects bin/release/fastwc).
|
|
release: all
|
|
$(MKDIR_P) bin/release
|
|
cp -f fastwc bin/release/fastwc
|
|
|
|
# Convenience: build the release binary, then run every benchmark suite.
|
|
bench: release
|
|
./benchmarks/test-all.sh
|
|
|
|
# --- developer conveniences ---
|
|
# compile_commands.json for clangd (bear if present, else Makefile-derived).
|
|
compile-commands:
|
|
./scripts/gen-compile-commands.sh
|
|
|
|
# Make the code confess to the style guide.
|
|
format:
|
|
clang-format -i $(fastwc_SOURCES)
|
|
|
|
# Verify the code already confesses, without touching it.
|
|
format-check:
|
|
clang-format --dry-run --Werror $(fastwc_SOURCES)
|
|
|
|
# Static analysis via clang-tidy (needs compile_commands.json).
|
|
# Warnings are errors: the style guide is the law.
|
|
lint: compile-commands
|
|
clang-tidy -p . --warnings-as-errors='*' $(fastwc_SOURCES)
|
|
|
|
clean-local:
|
|
rm -rf bin
|
|
|
|
.PHONY: release bench compile-commands format format-check lint
|