diff --git a/tools/check-formatting.sh b/tools/check-formatting.sh index 31fe22b7..0d55a420 100755 --- a/tools/check-formatting.sh +++ b/tools/check-formatting.sh @@ -4,11 +4,7 @@ source $(dirname $0)/env.sh cd $LUNA_ROOT -SOURCES=($(find kernel/src -type f | grep -v "\.asm")) -SOURCES+=($(find libluna/src -type f)) -SOURCES+=($(find libluna/include/luna -type f)) -SOURCES+=($(find libos/src -type f)) -SOURCES+=($(find libos/include/os -type f)) +source tools/sources.sh ALL_OK=1 diff --git a/tools/check-stdint.sh b/tools/check-stdint.sh index 855fece7..30791a8b 100755 --- a/tools/check-stdint.sh +++ b/tools/check-stdint.sh @@ -1,15 +1,12 @@ #!/usr/bin/env bash -set -e source $(dirname $0)/env.sh cd $LUNA_ROOT -SOURCES=($(find kernel/src -type f | grep -v "\.asm" | grep -v "bootboot.h")) -SOURCES+=($(find libluna/src -type f)) -SOURCES+=($(find libluna/include/luna -type f | grep -v "Types.h")) -SOURCES+=($(find libos/src -type f)) -SOURCES+=($(find libos/include/os -type f)) +source tools/sources.sh + +SOURCES=($(printf -- '%s\n' "${SOURCES[@]}" | grep -v libc | grep -v "Types.h" | grep -v "bootboot.h")) SUCCESS=1 diff --git a/tools/replace-stdint.sh b/tools/replace-stdint.sh index 00a9f954..6ef9bb2b 100755 --- a/tools/replace-stdint.sh +++ b/tools/replace-stdint.sh @@ -5,11 +5,9 @@ source $(dirname $0)/env.sh cd $LUNA_ROOT -SOURCES=($(find kernel/src -type f | grep -v "\.asm" | grep -v "bootboot.h")) -SOURCES+=($(find libluna/src -type f)) -SOURCES+=($(find libluna/include/luna -type f | grep -v "Types.h")) -SOURCES+=($(find libos/src -type f)) -SOURCES+=($(find libos/include/os -type f)) +source tools/sources.sh + +SOURCES=($(printf -- '%s\n' "${SOURCES[@]}" | grep -v libc | grep -v "Types.h" | grep -v "bootboot.h")) for f in ${SOURCES[@]} do diff --git a/tools/run-clang-format.sh b/tools/run-clang-format.sh index 1c154302..3b4dba80 100755 --- a/tools/run-clang-format.sh +++ b/tools/run-clang-format.sh @@ -5,11 +5,7 @@ source $(dirname $0)/env.sh cd $LUNA_ROOT -SOURCES=($(find kernel/src -type f | grep -v "\.asm")) -SOURCES+=($(find libluna/src -type f)) -SOURCES+=($(find libluna/include/luna -type f)) -SOURCES+=($(find libos/src -type f)) -SOURCES+=($(find libos/include/os -type f)) +source tools/sources.sh for f in ${SOURCES[@]} do diff --git a/tools/sources.sh b/tools/sources.sh new file mode 100755 index 00000000..ecfe3b70 --- /dev/null +++ b/tools/sources.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +source $(dirname $0)/env.sh + +cd $LUNA_ROOT + +FOLDERS=(kernel libc libos libluna apps) + +SOURCES=($(find ${FOLDERS[@]} -type f -name "*.cpp")) +SOURCES+=($(find ${FOLDERS[@]} -type f -name "*.h")) + +export SOURCES