From 3a02fdea9d9cf1edd148cb69a213e47c92ed1196 Mon Sep 17 00:00:00 2001 From: dragonmux Date: Sun, 26 Jun 2022 03:11:47 -0400 Subject: [PATCH] misc: Added a clang-tidy Makefile target so enforcing the formatting is easier --- Makefile | 5 ++++- src/Makefile | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index e5056ff..517649d 100644 --- a/Makefile +++ b/Makefile @@ -33,4 +33,7 @@ endif clang-tidy: $(Q)scripts/run-clang-tidy.py -s "$(PWD)" -.PHONY: clean all_platforms clang-tidy +clang-format: + $(Q)$(MAKE) $(MFLAGS) -C src $@ + +.PHONY: clean all_platforms clang-tidy clang-format diff --git a/src/Makefile b/src/Makefile index b618bfc..b8e7921 100644 --- a/src/Makefile +++ b/src/Makefile @@ -128,7 +128,7 @@ ifndef PC_HOSTED $(Q)$(OBJCOPY) -O ihex $^ $@ endif -.PHONY: clean host_clean all_platforms FORCE +.PHONY: clean host_clean all_platforms clang-format FORCE clean: host_clean $(Q)echo " CLEAN" @@ -191,4 +191,7 @@ else fi endif +clang-format: + $(Q)clang-format -i *.c */*.c */*/*.c *.h */*.h */*/*.h + -include *.d