Create project skeleton

This commit is contained in:
Camden Dixie O'Brien 2024-10-24 11:37:33 +01:00
commit 64c3aaf077
7 changed files with 46 additions and 0 deletions

21
.clang-format Normal file
View File

@ -0,0 +1,21 @@
---
BasedOnStyle: WebKit
AlignAfterOpenBracket: AlwaysBreak
AlignConsecutiveMacros: false
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: DontAlign
AlignOperands: false
AlignTrailingComments: false
TabWidth: 4
UseTab: ForIndentation
DerivePointerAlignment: false
PointerAlignment: Right
BinPackArguments: true
BinPackParameters: true
ExperimentalAutoDetectBinPacking: false
AllowAllArgumentsOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortFunctionsOnASingleLine: None
ColumnLimit: 77
...

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
build/

1
README Normal file
View File

@ -0,0 +1 @@
INFIX CALCULATOR

7
app/main.c Normal file
View File

@ -0,0 +1,7 @@
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
return EXIT_SUCCESS;
}

10
scripts/build.sh Normal file
View File

@ -0,0 +1,10 @@
cd "$(git rev-parse --show-toplevel)"
CFLAGS="$CFLAGS -std=c11 -pedantic -Wall -Wextra"
CFLAGS="$CFLAGS -Og -ggdb"
mkdir -p build
# Build application
clang $CFLAGS -c -o build/main.o app/main.c
clang $CFLAGS -o build/infix-calculator build/main.o

3
scripts/entr.sh Normal file
View File

@ -0,0 +1,3 @@
cd "$(git rev-parse --show-toplevel)"
find . -not \( -path build -prune \) \
| entr -s 'clear && sh scripts/build.sh'

3
scripts/format.sh Normal file
View File

@ -0,0 +1,3 @@
cd "$(git rev-parse --show-toplevel)"
find . -not \( -path build -prune \) -name '*.c' -o -name '*.h' \
| xargs -n 1 clang-format -i