diff options
Diffstat (limited to 'C')
-rw-r--r-- | C/.gitignore | 52 | ||||
-rw-r--r-- | C/README.md | 1 | ||||
-rwxr-xr-x | C/setup.sh | 37 |
3 files changed, 89 insertions, 1 deletions
diff --git a/C/.gitignore b/C/.gitignore new file mode 100644 index 0000000..c6127b3 --- /dev/null +++ b/C/.gitignore @@ -0,0 +1,52 @@ +# Prerequisites +*.d + +# Object files +*.o +*.ko +*.obj +*.elf + +# Linker output +*.ilk +*.map +*.exp + +# Precompiled Headers +*.gch +*.pch + +# Libraries +*.lib +*.a +*.la +*.lo + +# Shared objects (inc. Windows DLLs) +*.dll +*.so +*.so.* +*.dylib + +# Executables +*.exe +*.out +*.app +*.i*86 +*.x86_64 +*.hex + +# Debug files +*.dSYM/ +*.su +*.idb +*.pdb + +# Kernel Module Compile Results +*.mod* +*.cmd +.tmp_versions/ +modules.order +Module.symvers +Mkfile.old +dkms.conf diff --git a/C/README.md b/C/README.md index 0cd1d57..3a38e07 100644 --- a/C/README.md +++ b/C/README.md @@ -74,4 +74,3 @@ So once the Makefile is made, just run `make all; bear -- make` ## Folder and filename -Folder name MUST start with an uppercase, and filename diff --git a/C/setup.sh b/C/setup.sh new file mode 100755 index 0000000..d53c8f5 --- /dev/null +++ b/C/setup.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env sh +# Setup a C environment using ArKa coding style + +vcs=true +project_name="$1" +script_dir="$(cd "$(dirname "$0")" && pwd)" + +# Parsing args +for arg in "$@"; do + if [ "$arg" = "--no-vcs" ]; then + vcs=false + else + project_name="$arg" + fi +done + +if [ -n "$project_name" ]; then + printf "Installing your environment...\n" + mkdir -p "$project_name" || exit + cd "$project_name" + + # If vcs is true, init git in the project + if [ "$vcs" = true ]; then + printf "Setting up git in %s\n" "$project_name" + git init + cp "$script_dir"/.gitignore .gitignore + fi + + printf "Setting up C environment + clangd config\n" + cp "$script_dir"/.clang-format .clang-format + # copy linters, formatters config + printf "Your C environment is now ready, enjoy :)\n" +else + printf "Usage:\n\t%s [--no-vcs] {dirname}\n\n\t--no-vcs: git vcs not added to the project\n" "$0" +fi + + |