aboutsummaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
authorkartofen <mladenovnasko0@gmail.com>2025-06-30 00:26:51 +0300
committerkartofen <mladenovnasko0@gmail.com>2025-06-30 00:26:51 +0300
commit7f796bc571941a9c14eeb3a65d349d628f022275 (patch)
treefa38a0c2da26d6635f8306649caab2086a27a873 /build.sh
parent1cbaa39e3cc7e8948cbd5be5f2d18170fcdebfe0 (diff)
CLR yesss
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh33
1 files changed, 24 insertions, 9 deletions
diff --git a/build.sh b/build.sh
index d69fa83..855d574 100755
--- a/build.sh
+++ b/build.sh
@@ -2,12 +2,27 @@
set -xe
-# gcc -Wall -Wextra -g -D_LEXER_STANDALONE lexer.c -o lexer
-# gcc -Wall -Wextra -g recursive-ascent.c -o recursive-ascent
-# gcc -Wall -Wextra -g recursive-ascent-descent.c -o recursive-ascent-descent
-gcc -Wall -Wextra -g lr0-table.c -D_LR0_TABLE_STANDALONE -o lr0-table
-
-# valgrind --leak-check=full --show-leak-kinds=all -s ./lexer
-# valgrind --leak-check=full --show-leak-kinds=all -s ./recursive-ascent
-# valgrind --leak-check=full --show-leak-kinds=all -s ./recursive-ascent-descent
-valgrind --leak-check=full --show-leak-kinds=all -s ./lr0-table
+function cc
+{
+ mkdir -p bin
+ gcc -Wall -Wextra -Wpedantic -g $2 $1.c -o bin/$(basename $1)
+}
+
+function leak
+{
+ valgrind --leak-check=full --show-leak-kinds=all -s bin/$1
+}
+
+# cc lexer -D_LEXER_STANDALONE
+# cc recursive/recursive-ascent
+# cc recursive/recursive-ascent-descent
+# cc util-tables -D_UTIL_TABLES_STANDALONE
+# cc slr-table -D_SLR_TABLE_STANDALONE
+cc clr-table -D_CLR_TABLE_STANDALONE
+
+# leak lexer
+# leak recursive-ascent
+# leak recursive-ascent-descent
+# leak util-tables
+# leak slr-table
+leak clr-table