created project files

main
Sara 2023-09-11 18:44:29 +02:00
commit 9fb43f8ae9
6 changed files with 93 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
.cache/clangd/index
bin

3
.nvimrc Normal file
View File

@ -0,0 +1,3 @@
noremap <F4> :!./build.sh<CR>
noremap <F5> :!./run.sh<CR>
noremap <F6> :!./test.sh<CR>

4
build.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
echo "Beginning build"
bear -- \
gcc -o bin/kwil src/**.c -g -Itest_include -Wall

62
compile_commands.json Normal file
View File

@ -0,0 +1,62 @@
[
{
"arguments": [
"/usr/lib64/ccache/gcc",
"-c",
"-g",
"-Itest_include",
"-Wall",
"-o",
"bin/kwil",
"src/args.c"
],
"directory": "/home/sara/Documents/c-projects/kwil",
"file": "/home/sara/Documents/c-projects/kwil/src/args.c",
"output": "/home/sara/Documents/c-projects/kwil/bin/kwil"
},
{
"arguments": [
"/usr/lib64/ccache/gcc",
"-c",
"-g",
"-Itest_include",
"-Wall",
"-o",
"bin/kwil",
"src/kwil.c"
],
"directory": "/home/sara/Documents/c-projects/kwil",
"file": "/home/sara/Documents/c-projects/kwil/src/kwil.c",
"output": "/home/sara/Documents/c-projects/kwil/bin/kwil"
},
{
"arguments": [
"/usr/lib64/ccache/gcc",
"-c",
"-g",
"-Itest_include",
"-Wall",
"-o",
"bin/kwil",
"src/kwil_generate.c"
],
"directory": "/home/sara/Documents/c-projects/kwil",
"file": "/home/sara/Documents/c-projects/kwil/src/kwil_generate.c",
"output": "/home/sara/Documents/c-projects/kwil/bin/kwil"
},
{
"arguments": [
"/usr/lib64/ccache/gcc",
"-c",
"-g",
"-Itest_include",
"-Wall",
"-o",
"bin/kwil",
"src/kwil_parse.c"
],
"directory": "/home/sara/Documents/c-projects/kwil",
"file": "/home/sara/Documents/c-projects/kwil/src/kwil_parse.c",
"output": "/home/sara/Documents/c-projects/kwil/bin/kwil"
}
]

3
run.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash
bin/kwil test_files/*.h

19
test.sh Executable file
View File

@ -0,0 +1,19 @@
#!/bin/bash
echo ""
echo "Beginning test"
echo ""
echo "" && echo "---- Running kwil ----" && \
./run.sh && \
echo "" && echo "---- Compiling test program ----" && \
gcc -g -o bin/test test_files/*.c -Itest_include -Wall && \
echo "" && echo "---- Running test program ----" && \
bin/test
if [[ $? == 0 ]]; then
echo ""
echo "Test succeeded"
else
echo ""
echo "Test failed"
fi