diff --git a/README.md b/README.md index 87fe6e2..bbab8c7 100644 --- a/README.md +++ b/README.md @@ -7,12 +7,20 @@ TODO ### Build - -TODO +run this command: + autoreconf --force --verbose --install ### Test +run this command: + ./configure CFLAGS='-std=c99 -Werror -Wall -Wextra -Wvla' +then: + make -TODO +#### asan +run this command: + ./configure CFLAGS='-std=c99 -Werror -Wall -Wextra -Wvla -g -fsanitize=address' +then: + make check ## Authors diff --git a/configure.ac b/configure.ac index 4a89a36..f9684ed 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,9 @@ # Init the 42sh project AC_INIT([42sh], [1.0], [matteo.flebus@epita.fr]) +# FLAGS="-std=c99 -pedantic -Werror -Wall -Wextra -Wvla" +# AC_SUBST([FLAGS]) + # Setup Automake AM_INIT_AUTOMAKE([subdir-objects] [foreign]) @@ -21,10 +24,17 @@ AC_PROG_CC # List Makefiles in subdirectories AC_CONFIG_FILES([ - Makefile src/Makefile src/ast/Makefile src/parser/Makefile src/lexer/Makefile + src/io_backend/Makefile + src/execution/Makefile + src/expansion/Makefile + src/utils/Makefile ]) + # TODO add tests Makefile here + # tests/Makefile + # tests/unit/Makefile + # tests/unit/utils/Makefile AC_OUTPUT diff --git a/src/Makefile.am b/src/Makefile.am index 8ecd21f..411f4cb 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,11 +1,10 @@ # define the subdirectories SUBDIRS = \ - ast \ parser \ lexer \ io_backend \ execution \ - expansin \ + expansion \ utils bin_PROGRAMS = 42sh @@ -14,10 +13,7 @@ bin_PROGRAMS = 42sh 42sh_CPPFLAGS = -I%D% -42sh_CFLAGS = -std=c99 -pedantic -Werror -Wall -Wextra -Wvla - 42sh_LDADD = \ - ast/libast.a \ parser/libparser.a \ lexer/liblexer.a \ io_backend/libio_backend.a \ @@ -27,20 +23,16 @@ bin_PROGRAMS = 42sh ################################################# Test - -bin_PROGRAMS = 42sh_asan - -42sh_asan_SOURCES = main.c - -42sh_asan_CPPFLAGS = -I%D% - -42sh_asan_CFLAGS = -std=c99 -pedantic -Werror -Wall -Wextra -Wvla -g -fsanitize=address - -42sh_asan_LDADD = \ - ast/libast.a \ - parser/libparser.a \ - lexer/liblexer.a \ - io_backend/libio_backend.a \ - expansion/libexpansion.a \ - execution/libexecution.a \ - utils/libutils.a +# +#42sh_asan_SOURCES = main.c +# +#42sh_asan_CPPFLAGS = -I%D% +# +#42sh_asan_LDADD = \ +# ast/lib_asan_ast.a \ +# parser/lib_asan_parser.a \ +# lexer/lib_asan_lexer.a \ +# io_backend/lib_asan_io_backend.a \ +# expansion/lib_asan_expansion.a \ +# execution/lib_asan_execution.a \ +# utils/lib_asan_utils.a diff --git a/src/ast/Makefile.am b/src/ast/Makefile.am index 9df484e..fa41e3d 100644 --- a/src/ast/Makefile.am +++ b/src/ast/Makefile.am @@ -6,6 +6,4 @@ libast_a_SOURCES = \ libast_a_CPPFLAGS = -I$(top_srcdir)/src -libast_a_CFLAGS = -std=c99 -pedantic -Werror -Wall -Wextra -Wvla - noinst_LIBRARIES = libast.a diff --git a/src/execution/Makefile.am b/src/execution/Makefile.am index f83e3ba..5a71cbb 100644 --- a/src/execution/Makefile.am +++ b/src/execution/Makefile.am @@ -6,6 +6,4 @@ libexecution_a_SOURCES = \ libexecution_a_CPPFLAGS = -I$(top_srcdir)/src -libexecution_a_CFLAGS = -std=c99 -pedantic -Werror -Wall -Wextra -Wvla - noinst_LIBRARIES = libexecution.a diff --git a/src/expansion/Makefile.am b/src/expansion/Makefile.am index 5074622..065f225 100644 --- a/src/expansion/Makefile.am +++ b/src/expansion/Makefile.am @@ -6,6 +6,4 @@ libexpansion_a_SOURCES = \ libexpansion_a_CPPFLAGS = -I$(top_srcdir)/src -libexpansion_a_CFLAGS = -std=c99 -pedantic -Werror -Wall -Wextra -Wvla - noinst_LIBRARIES = libexpansion.a diff --git a/src/io_backend/Makefile.am b/src/io_backend/Makefile.am index 7f056b2..0cfadff 100644 --- a/src/io_backend/Makefile.am +++ b/src/io_backend/Makefile.am @@ -6,6 +6,4 @@ libio_backend_a_SOURCES = \ libio_backend_a_CPPFLAGS = -I$(top_srcdir)/src -libio_backend_a_CFLAGS = -std=c99 -pedantic -Werror -Wall -Wextra -Wvla - noinst_LIBRARIES = libio_backend.a diff --git a/src/lexer/Makefile.am b/src/lexer/Makefile.am index a113221..dd11411 100644 --- a/src/lexer/Makefile.am +++ b/src/lexer/Makefile.am @@ -6,6 +6,4 @@ liblexer_a_SOURCES = \ liblexer_a_CPPFLAGS = -I$(top_srcdir)/src -liblexer_a_CFLAGS = -std=c99 -pedantic -Werror -Wall -Wextra -Wvla - noinst_LIBRARIES = liblexer.a diff --git a/src/parser/Makefile.am b/src/parser/Makefile.am index 51c8cb6..dd13901 100644 --- a/src/parser/Makefile.am +++ b/src/parser/Makefile.am @@ -6,6 +6,4 @@ libparser_a_SOURCES = \ libparser_a_CPPFLAGS = -I$(top_srcdir)/src -libparser_a_CFLAGS = -std=c99 -pedantic -Werror -Wall -Wextra -Wvla - noinst_LIBRARIES = libparser.a diff --git a/src/utils/Makefile.am b/src/utils/Makefile.am index dba2e51..5b72df3 100644 --- a/src/utils/Makefile.am +++ b/src/utils/Makefile.am @@ -1,11 +1,8 @@ lib_LIBRARIES = libutils.a -# libutils_a_SOURCES = \ -# utils.c \ -# utils.h +libutils_a_SOURCES = \ + string_utils.c -# libutils_a_CPPFLAGS = -I$(top_srcdir)/src +libutils_a_CPPFLAGS = -I$(top_srcdir)/src -# libutils_a_CFLAGS = -std=c99 -pedantic -Werror -Wall -Wextra -Wvla - -# noinst_LIBRARIES = libutils.a +noinst_LIBRARIES = libutils.a