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