summaryrefslogtreecommitdiff
path: root/21sh/autotools
diff options
context:
space:
mode:
Diffstat (limited to '21sh/autotools')
-rw-r--r--21sh/autotools/.gitignore54
-rw-r--r--21sh/autotools/Makefile.am1
-rw-r--r--21sh/autotools/configure.ac14
-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
14 files changed, 149 insertions, 0 deletions
diff --git a/21sh/autotools/.gitignore b/21sh/autotools/.gitignore
new file mode 100644
index 0000000..89511ec
--- /dev/null
+++ b/21sh/autotools/.gitignore
@@ -0,0 +1,54 @@
+# http://www.gnu.org/software/automake
+
+Makefile.in
+COPYING
+INSTALL
+/ar-lib
+/mdate-sh
+/py-compile
+/test-driver
+/ylwrap
+.deps/
+.dirstamp
+
+# http://www.gnu.org/software/autoconf
+
+autom4te.cache
+/autoscan.log
+/autoscan-*.log
+/aclocal.m4
+/compile
+/config.cache
+/config.guess
+/config.h.in
+/config.log
+/config.status
+/config.sub
+/configure
+/configure.scan
+/depcomp
+/install-sh
+/missing
+/stamp-h1
+
+# https://www.gnu.org/software/libtool/
+
+/ltmain.sh
+
+# http://www.gnu.org/software/texinfo
+
+/texinfo.tex
+
+# http://www.gnu.org/software/m4/
+
+m4/libtool.m4
+m4/ltoptions.m4
+m4/ltsugar.m4
+m4/ltversion.m4
+m4/lt~obsolete.m4
+
+# Generated Makefile
+# (meta build system like autotools,
+# can automatically generate from config.status script
+# (which is called by configure script))
+Makefile
diff --git a/21sh/autotools/Makefile.am b/21sh/autotools/Makefile.am
new file mode 100644
index 0000000..af437a6
--- /dev/null
+++ b/21sh/autotools/Makefile.am
@@ -0,0 +1 @@
+SUBDIRS = src
diff --git a/21sh/autotools/configure.ac b/21sh/autotools/configure.ac
new file mode 100644
index 0000000..e3a60b6
--- /dev/null
+++ b/21sh/autotools/configure.ac
@@ -0,0 +1,14 @@
+AC_INIT([autotools], [0.1], [martial.simon@epita.fr])
+AM_INIT_AUTOMAKE([subdir-objects] [foreign])
+AC_PROG_RANLIB
+AM_PROG_AR
+AC_PROG_CC
+AX_COMPILER_FLAGS([], [], [], [-Wall -Wextra -Werror -Wvla -pedantic -std=c99])
+AC_CONFIG_FILES([
+ Makefile
+ src/Makefile
+ src/ast/Makefile
+ src/lexer/Makefile
+ src/parser/Makefile
+ ])
+AC_OUTPUT
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 */