From 7eec0e0730d5a00a1b7b043bd68694fc3647714c Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Tue, 25 Jul 2023 08:56:18 +0100 Subject: [PATCH] Add generating the table to the main build script --- compile | 27 ++++++++++++++++----------- mk_table_generator | 3 --- 2 files changed, 16 insertions(+), 14 deletions(-) delete mode 100755 mk_table_generator diff --git a/compile b/compile index 403e20a..5230824 100755 --- a/compile +++ b/compile @@ -1,24 +1,29 @@ #!/bin/bash +SCRIPT_DIR="$(dirname $0)" CC=clang -CFLAGS="-g -Wall -Werror -pedantic -Iinclude" -SRC="src/main.c" -OUT=main +CFLAGS="-g -Wall -Werror -pedantic -I$SCRIPT_DIR/include" +SRC="$SCRIPT_DIR/src/main.c" +OUT=$SCRIPT_DIR/main + +# STATE_TABLE +$CC $CFLAGS -I$SCRIPT_DIR/include/lexer $SCRIPT_DIR/generate_state_table.c -o $SCRIPT_DIR/gentable +$SCRIPT_DIR/gentable # DSTRING -CFLAGS+=" -Iinclude/dstring" -SRC+=" src/dstring/*.c" +CFLAGS+=" -I$SCRIPT_DIR/include/dstring" +SRC+=" $SCRIPT_DIR/src/dstring/*.c" # JSON_ENTITIES -CFLAGS+=" -Iinclude/json_entities" -SRC+=" src/json_entities/*.c" +CFLAGS+=" -I$SCRIPT_DIR/include/json_entities" +SRC+=" $SCRIPT_DIR/src/json_entities/*.c" # LEXER -CFLAGS+=" -Iinclude/lexer" -SRC+=" src/lexer/*.c" +CFLAGS+=" -I$SCRIPT_DIR/include/lexer" +SRC+=" $SCRIPT_DIR/src/lexer/*.c" # PARSER -CFLAGS+=" -Iinclude/parser" -SRC+=" src/parser/*.c" +CFLAGS+=" -I$SCRIPT_DIR/include/parser" +SRC+=" $SCRIPT_DIR/src/parser/*.c" $CC $CFLAGS $SRC -o $OUT diff --git a/mk_table_generator b/mk_table_generator deleted file mode 100755 index 344d345..0000000 --- a/mk_table_generator +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -clang -Iinclude -Iinclude/lexer generate_state_table.c -o gentable