From 12e571ba1948429060052427efc00f767a8f51a8 Mon Sep 17 00:00:00 2001 From: Emil Pedersen Date: Mon, 17 Jul 2023 22:28:15 +0200 Subject: [PATCH 1/3] fix: compilation for most days of the C pool Day 9 and 10 will not compile as they require autograder-specific headers --- check.sh | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/check.sh b/check.sh index 65ca758..3492398 100755 --- a/check.sh +++ b/check.sh @@ -35,12 +35,15 @@ if [ ! -d "$COPY_DEST" ]; then exit 84 fi +# In build directory cd "$COPY_DEST" +# Copy from delivery directory to build directory if [ "$DELIVERY_DIR" != "$COPY_DEST" ]; then cp -a "$DELIVERY_DIR"/. . fi +# Back to root directory cd - >/dev/null find "$COPY_DEST" \ @@ -49,14 +52,25 @@ find "$COPY_DEST" \ -o \( -name '*.c' -o -name '*.h' \) -print0 \ > "$COPY_DEST/coding-style-files.log" +# Back to build directory cd - >/dev/null -if [ -d rush-1-1 ]; then - bear -- gcc rush-1-*/*.c >/dev/null 2>&1 -else +# If the student has compile flags, ignore them +rm -f compile_commands.json +rm -f compile_flags.txt + +# If Makefile exists +if [ -f Makefile || -f makefile || -f GNUmakefile ]; then bear -- make re >/dev/null 2>&1 +else + # Start of C pool + if [ -d lib/my ]; then + bear -- lib/my/build.sh >/dev/null 2>&1 + fi + bear -- gcc *.c -Iinclude >/dev/null 2>&1 fi +# Back to root directory cd - >/dev/null REPORT="$REPORTS_DIR"/coding-style-reports.log.unsorted From c54b16d9b85aea95445381ab9af15109585565ab Mon Sep 17 00:00:00 2001 From: Emil Pedersen Date: Sat, 7 Oct 2023 13:17:01 +0200 Subject: [PATCH 2/3] fix: support rush1 --- check.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/check.sh b/check.sh index 3492398..c868bf2 100755 --- a/check.sh +++ b/check.sh @@ -59,15 +59,18 @@ cd - >/dev/null rm -f compile_commands.json rm -f compile_flags.txt -# If Makefile exists -if [ -f Makefile || -f makefile || -f GNUmakefile ]; then +if [ -d rush-1-1 ]; then + # Rush1 is a special case + bear -- gcc rush-1-*/*.c >/dev/null 2>&1 +elif [ -f Makefile || -f makefile || -f GNUmakefile ]; then + # Normal case, with a Makefile at the root bear -- make re >/dev/null 2>&1 else - # Start of C pool + # Most days of the CPool if [ -d lib/my ]; then - bear -- lib/my/build.sh >/dev/null 2>&1 + (cd lib/my && bear -- ./build.sh) >/dev/null 2>&1 fi - bear -- gcc *.c -Iinclude >/dev/null 2>&1 + bear -- gcc *.c -I./include >/dev/null 2>&1 fi # Back to root directory From 5ac8bd3b1709d3357af139e6f9d26b0a1ac66e7c Mon Sep 17 00:00:00 2001 From: Emil Pedersen Date: Sat, 7 Oct 2023 17:35:19 +0200 Subject: [PATCH 3/3] fix: syntax error in check.sh --- check.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check.sh b/check.sh index c868bf2..3b9a8a2 100755 --- a/check.sh +++ b/check.sh @@ -62,7 +62,7 @@ rm -f compile_flags.txt if [ -d rush-1-1 ]; then # Rush1 is a special case bear -- gcc rush-1-*/*.c >/dev/null 2>&1 -elif [ -f Makefile || -f makefile || -f GNUmakefile ]; then +elif [[ -f Makefile || -f makefile || -f GNUmakefile ]]; then # Normal case, with a Makefile at the root bear -- make re >/dev/null 2>&1 else