diff --git a/extra/utils.mk b/extra/utils.mk new file mode 100644 index 0000000..7f10c6e --- /dev/null +++ b/extra/utils.mk @@ -0,0 +1,9 @@ +.PHONY: format + +all: + +format: + # Convert tabs to spaces + find ./source -type f -iname '*.[cpp\|c\|h]' -exec bash -c 'expand -t 4 "$$0" | sponge "$$0"' {} \; + # Remove trailing whitespaces + find ./source -type f -iname '*.[cpp\|c\|h]' -exec sed -i 's/ *$$//' {} \;