diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..13096ef --- /dev/null +++ b/.clang-format @@ -0,0 +1,19 @@ +BasedOnStyle: LLVM +IndentWidth: 4 +TabWidth: 4 +UseTab: Never +ColumnLimit: 120 +AllowShortLoopsOnASingleLine: true +AllowShortFunctionsOnASingleLine: false +AlwaysBreakTemplateDeclarations: true +BreakConstructorInitializers: BeforeComma +AlignConsecutiveDeclarations: + Enabled: true + AcrossEmptyLines: false + AcrossComments: false + AlignCompound: false + AlignFunctionPointers: false + PadOperators: false +AlignConsecutiveMacros: true +AllowShortCaseLabelsOnASingleLine: true +SeparateDefinitionBlocks: Always diff --git a/Makefile b/Makefile index 9e20a43..0b69827 100644 --- a/Makefile +++ b/Makefile @@ -102,5 +102,10 @@ disasm: main.elf cpp: $(COMPILE) -E $(SOURCEDIR)/main.c +format: + find . -type f \( -name '*.c' -o -name '*.h' \) -exec clang-format -i {} + + # include generated header dependencies -include $(BUILDDIR)/$(OBJECTS:.o=.d) + +.PHONY: format