summaryrefslogtreecommitdiff
path: root/21sh/autotools/src
diff options
context:
space:
mode:
Diffstat (limited to '21sh/autotools/src')
-rw-r--r--21sh/autotools/src/42sh.c7
-rw-r--r--21sh/autotools/src/Makefile.am7
-rw-r--r--21sh/autotools/src/ast/Makefile.am6
-rw-r--r--21sh/autotools/src/ast/ast.c11
-rw-r--r--21sh/autotools/src/ast/ast.h6
-rw-r--r--21sh/autotools/src/lexer/Makefile.am6
-rw-r--r--21sh/autotools/src/lexer/lexer.c8
-rw-r--r--21sh/autotools/src/lexer/lexer.h6
-rw-r--r--21sh/autotools/src/parser/Makefile.am6
-rw-r--r--21sh/autotools/src/parser/parser.c11
-rw-r--r--21sh/autotools/src/parser/parser.h6
11 files changed, 80 insertions, 0 deletions
diff --git a/21sh/autotools/src/42sh.c b/21sh/autotools/src/42sh.c
new file mode 100644
index 0000000..cb3f00b
--- /dev/null
+++ b/21sh/autotools/src/42sh.c
@@ -0,0 +1,7 @@
+#include "ast/ast.h"
+
+int main(void)
+{
+ print_ast();
+ return 0;
+}
diff --git a/21sh/autotools/src/Makefile.am b/21sh/autotools/src/Makefile.am
new file mode 100644
index 0000000..6a2c6ae
--- /dev/null
+++ b/21sh/autotools/src/Makefile.am
@@ -0,0 +1,7 @@
+SUBDIRS = ast lexer parser
+
+bin_PROGRAMS = 42sh
+42sh_SOURCES = 42sh.c
+42sh_CPPFLAGS = -I%D%
+42sh_CFLAGS = -std=c99 -Werror -Wall -Wextra -Wvla -pedantic
+42sh_LDADD = ast/libast.a lexer/liblexer.a parser/libparser.a
diff --git a/21sh/autotools/src/ast/Makefile.am b/21sh/autotools/src/ast/Makefile.am
new file mode 100644
index 0000000..d455958
--- /dev/null
+++ b/21sh/autotools/src/ast/Makefile.am
@@ -0,0 +1,6 @@
+lib_LIBRARIES = libast.a
+
+libast_a_SOURCES = ast.c ast.h
+libast_a_CPPFLAGS = -I$(top_srcdir)/src
+libast_a_CFLAGS = -std=c99 -Werror -Wall -Wextra -Wvla -pedantic
+noinst_LIBRARIES = libast.a
diff --git a/21sh/autotools/src/ast/ast.c b/21sh/autotools/src/ast/ast.c
new file mode 100644
index 0000000..084dbf9
--- /dev/null
+++ b/21sh/autotools/src/ast/ast.c
@@ -0,0 +1,11 @@
+#include "ast.h"
+
+#include <stdio.h>
+
+#include "parser/parser.h"
+
+void print_ast()
+{
+ printf("ast !!!\n");
+ print_parser();
+}
diff --git a/21sh/autotools/src/ast/ast.h b/21sh/autotools/src/ast/ast.h
new file mode 100644
index 0000000..83d52b3
--- /dev/null
+++ b/21sh/autotools/src/ast/ast.h
@@ -0,0 +1,6 @@
+#ifndef AST_H
+#define AST_H
+
+void print_ast();
+
+#endif /* ! AST_H */
diff --git a/21sh/autotools/src/lexer/Makefile.am b/21sh/autotools/src/lexer/Makefile.am
new file mode 100644
index 0000000..f5f78b2
--- /dev/null
+++ b/21sh/autotools/src/lexer/Makefile.am
@@ -0,0 +1,6 @@
+lib_LIBRARIES = liblexer.a
+
+liblexer_a_SOURCES = lexer.c lexer.h
+liblexer_a_CPPFLAGS = -I$(top_srcdir)/src
+liblexer_a_CFLAGS = -std=c99 -Werror -Wall -Wextra -Wvla -pedantic
+noinst_LIBRARIES = liblexer.a
diff --git a/21sh/autotools/src/lexer/lexer.c b/21sh/autotools/src/lexer/lexer.c
new file mode 100644
index 0000000..2e9d2f9
--- /dev/null
+++ b/21sh/autotools/src/lexer/lexer.c
@@ -0,0 +1,8 @@
+#include "lexer.h"
+
+#include <stdio.h>
+
+void print_lexer()
+{
+ puts("Vive les lexer");
+}
diff --git a/21sh/autotools/src/lexer/lexer.h b/21sh/autotools/src/lexer/lexer.h
new file mode 100644
index 0000000..0cc2c2e
--- /dev/null
+++ b/21sh/autotools/src/lexer/lexer.h
@@ -0,0 +1,6 @@
+#ifndef LEXER_H
+#define LEXER_H
+
+void print_lexer();
+
+#endif /* ! LEXER_H */
diff --git a/21sh/autotools/src/parser/Makefile.am b/21sh/autotools/src/parser/Makefile.am
new file mode 100644
index 0000000..c8fe590
--- /dev/null
+++ b/21sh/autotools/src/parser/Makefile.am
@@ -0,0 +1,6 @@
+lib_LIBRARIES = libparser.a
+
+libparser_a_SOURCES = parser.c parser.h $(top_srcdir)/src/lexer/lexer.c $(top_srcdir)/src/lexer/lexer.h
+libparser_a_CPPFLAGS = -I$(top_srcdir)/src
+libparser_a_CFLAGS = -std=c99 -Werror -Wall -Wextra -Wvla -pedantic
+noinst_LIBRARIES = libparser.a
diff --git a/21sh/autotools/src/parser/parser.c b/21sh/autotools/src/parser/parser.c
new file mode 100644
index 0000000..28f5824
--- /dev/null
+++ b/21sh/autotools/src/parser/parser.c
@@ -0,0 +1,11 @@
+#include "parser.h"
+
+#include <stdio.h>
+
+#include "lexer/lexer.h"
+
+void print_parser()
+{
+ print_lexer();
+ printf("parser !!!\n");
+}
diff --git a/21sh/autotools/src/parser/parser.h b/21sh/autotools/src/parser/parser.h
new file mode 100644
index 0000000..38d2ae3
--- /dev/null
+++ b/21sh/autotools/src/parser/parser.h
@@ -0,0 +1,6 @@
+#ifndef PARSER_H
+#define PARSER_H
+
+void print_parser();
+
+#endif /* ! PARSER_H */