From 2b13efa7b78ab2bb08cba52e09b1f12af1701fd9 Mon Sep 17 00:00:00 2001 From: Johannes Stoelp Date: Sun, 7 Apr 2024 23:14:18 +0200 Subject: make: add make file and clang-{tidy,format} configs --- Makefile | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..16d98bb --- /dev/null +++ b/Makefile @@ -0,0 +1,26 @@ +SRC = $(shell git ls-files '*.cc') + +check: $(SRC:.cc=.x) +lint : $(SRC:.cc=.l) +fmt : $(SRC:.cc=.f) + +%.x: %.cc + bash $^ + +%.l: %.cc + clang-format -n --Werror $^ + clang-tidy $^ + +%.f: %.cc + clang-format -i $^ + +help: + @echo "Targets that apply to all .cc files under scm:" + @echo "* check execute build commands in each file" + @echo " lint clang-format & clang-tidy lint" + @echo " fmt re-format each file" + @echo "" + @echo "Targets that apply to a single .cc file (where is the file name w/o .cc suffix):" + @echo " .x only execute .cc" + @echo " .l only lint .cc" + @echo " .f only re-format .cc" -- cgit v1.2.3