summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Holland <samuel@sholland.org>2018-01-14 18:21:13 -0600
committerSamuel Holland <samuel@sholland.org>2018-01-14 18:21:13 -0600
commit28748009c0dc553e2fe5e6253e7615cf89d2b7ef (patch)
tree313ef8b2f9a7cbebac7a986b538e441aac8c5454
parent5d9f7e14bf5c68736fd4395caac45416796fed3d (diff)
downloadgcompat-28748009c0dc553e2fe5e6253e7615cf89d2b7ef.tar.gz
gcompat-28748009c0dc553e2fe5e6253e7615cf89d2b7ef.tar.bz2
gcompat-28748009c0dc553e2fe5e6253e7615cf89d2b7ef.tar.xz
gcompat-28748009c0dc553e2fe5e6253e7615cf89d2b7ef.zip
Add clang-format configuration and Makefile rule
The settings here are based on the current code style documentation. Signed-off-by: Samuel Holland <samuel@sholland.org>
-rw-r--r--.clang-format52
-rw-r--r--Makefile5
2 files changed, 57 insertions, 0 deletions
diff --git a/.clang-format b/.clang-format
new file mode 100644
index 0000000..05db5a1
--- /dev/null
+++ b/.clang-format
@@ -0,0 +1,52 @@
+---
+# for clang-format 4.0.0
+AlignAfterOpenBracket: Align
+AlignConsecutiveAssignments: false
+AlignConsecutiveDeclarations: false
+AlignEscapedNewlinesLeft: false
+AlignOperands: false
+AlignTrailingComments: true
+AllowAllParametersOfDeclarationOnNextLine: false
+AllowShortBlocksOnASingleLine: false
+AllowShortCaseLabelsOnASingleLine: false
+AllowShortFunctionsOnASingleLine: None
+AllowShortIfStatementsOnASingleLine: false
+AllowShortLoopsOnASingleLine: false
+AlwaysBreakAfterReturnType: None
+AlwaysBreakBeforeMultilineStrings: true
+BinPackArguments: true
+BinPackParameters: true
+BreakBeforeBinaryOperators: NonAssignment
+BreakBeforeBraces: WebKit
+BreakBeforeTernaryOperators: true
+BreakStringLiterals: true
+ColumnLimit: 80
+Cpp11BracedListStyle: false
+IncludeCategories:
+ - Priority: 1
+ Regex: '^<'
+ - Priority: 2
+ Regex: '^"'
+IndentCaseLabels: false
+IndentWidth: 8
+IndentWrappedFunctionNames: false
+KeepEmptyLinesAtTheStartOfBlocks: false
+Language: Cpp
+MaxEmptyLinesToKeep: 1
+NamespaceIndentation: None
+PointerAlignment: Right
+ReflowComments: true
+SortIncludes: true
+SpaceAfterCStyleCast: true
+SpaceBeforeAssignmentOperators: true
+SpaceBeforeParens: ControlStatements
+SpaceInEmptyParentheses: false
+SpacesBeforeTrailingComments: 1
+SpacesInCStyleCastParentheses: false
+SpacesInContainerLiterals: true
+SpacesInParentheses: false
+SpacesInSquareBrackets: false
+Standard: Cpp11
+TabWidth: 8
+UseTab: ForIndentation
+...
diff --git a/Makefile b/Makefile
index c595290..6c532fd 100644
--- a/Makefile
+++ b/Makefile
@@ -44,6 +44,11 @@ ${LOADER_NAME}: ${LOADER_OBJ}
clean:
rm -f libgcompat/*.o loader/*.o ${LIBGCOMPAT_NAME} ${LOADER_NAME}
+format:
+ clang-format -i ${LIBGCOMPAT_SRC} ${LOADER_SRC}
+
install: all
install -D -m755 ${LIBGCOMPAT_NAME} ${DESTDIR}/${LIBGCOMPAT_PATH}
install -D -m755 ${LOADER_NAME} ${DESTDIR}/${LOADER_PATH}
+
+.PHONY: all clean format install