aboutsummaryrefslogtreecommitdiffhomepage
path: root/source/Makefile
diff options
context:
space:
mode:
authorBen V. Brown <[email protected]>2021-01-17 10:57:24 +1100
committerBen V. Brown <[email protected]>2021-01-17 10:57:24 +1100
commit1b0b665072aae7f5df6bf19fc82559b852c6f7c3 (patch)
tree801e74ba92eb92509cadde704af20ba0c9edeaec /source/Makefile
parent7ecc7e4d12164575fcf4f1dbd1912285e18f8dde (diff)
downloadIronOS-1b0b665072aae7f5df6bf19fc82559b852c6f7c3.tar.gz
IronOS-1b0b665072aae7f5df6bf19fc82559b852c6f7c3.zip
Create style call in Makefile
Diffstat (limited to 'source/Makefile')
-rw-r--r--source/Makefile14
1 files changed, 14 insertions, 0 deletions
diff --git a/source/Makefile b/source/Makefile
index 26e596f8..ef3da370 100644
--- a/source/Makefile
+++ b/source/Makefile
@@ -31,7 +31,12 @@ SOURCE_CORE_DIR = ./Core/Src
SOURCE_DRIVERS_DIR = ./Core/Drivers
INC_PD_DRIVERS_DIR = ./Core/Drivers/FUSB302
SOURCE_MIDDLEWARES_DIR = ./Middlewares
+# Find-all's used for formatting
+ALL_INCLUDES = $(shell find ./ -type f -name '*.h') \
+ $(shell find ./ -type f -name '*.hpp')
+ALL_SOURCE = $(shell find ./ -type f -name '*.c') \
+ $(shell find ./ -type f -name '*.cpp')
# Device dependent settings
ifeq ($(model),$(filter $(model),TS100 TS80 TS80P))
$(info Building for Miniware )
@@ -316,6 +321,15 @@ clean :
rm -Rf $(OUTPUT_DIR_BASE)
rm -Rf $(HEXFILE_DIR)
+style:
+ @for src in $(ALL_SOURCE) $(ALL_INCLUDES); do \
+ echo "Formatting $$src..." ; \
+ clang-format -i "$$src" ; \
+ done
+ @echo "Done"
+
+.PHONY: style
+
# pull in dependency info for *existing* .o files
-include $(OUT_OBJS:.o=.d)
-include $(OUT_OBJS_CPP:.o=.d)