feat(autotools): basic usage

This commit is contained in:
Matteo Flebus 2026-01-07 17:38:54 +01:00
parent ec9a168764
commit 269f50a367
24 changed files with 133 additions and 1 deletions

6
src/42sh.c Normal file
View file

@ -0,0 +1,6 @@
// all includes
int main(int argc, char **argv)
{
return 0;
}

25
src/Makefile.am Normal file
View file

@ -0,0 +1,25 @@
# define the subdirectories
SUBDIRS = \
ast \
parser \
lexer \
io_backend \
execution \
expansion
# + utils if needed
bin_PROGRAMS = 42sh
42sh_SOURCES = 42sh.c
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 \
expansion/libexpansion.a \
execution/libexecution.a

11
src/ast/Makefile.am Normal file
View file

@ -0,0 +1,11 @@
lib_LIBRARIES = libast.a
libast_a_SOURCES = \
ast.c \
ast.h
libast_a_CPPFLAGS = -I$(top_srcdir)/src
libast_a_CFLAGS = -std=c99 -pedantic -Werror -Wall -Wextra -Wvla
noinst_LIBRARIES = libast.a

0
src/ast/ast.c Normal file
View file

0
src/ast/ast.h Normal file
View file

11
src/execution/Makefile.am Normal file
View file

@ -0,0 +1,11 @@
lib_LIBRARIES = libexecution.a
libexecution_a_SOURCES = \
execution.c \
execution.h
libexecution_a_CPPFLAGS = -I$(top_srcdir)/src
libexecution_a_CFLAGS = -std=c99 -pedantic -Werror -Wall -Wextra -Wvla
noinst_LIBRARIES = libexecution.a

View file

View file

11
src/expansion/Makefile.am Normal file
View file

@ -0,0 +1,11 @@
lib_LIBRARIES = libexpansion.a
libexpansion_a_SOURCES = \
expansion.c \
expansion.h
libexpansion_a_CPPFLAGS = -I$(top_srcdir)/src
libexpansion_a_CFLAGS = -std=c99 -pedantic -Werror -Wall -Wextra -Wvla
noinst_LIBRARIES = libexpansion.a

View file

View file

View file

@ -0,0 +1,11 @@
lib_LIBRARIES = libio_backend.a
libio_backend_a_SOURCES = \
io_backend.c \
io_backend.h
libio_backend_a_CPPFLAGS = -I$(top_srcdir)/src
libio_backend_a_CFLAGS = -std=c99 -pedantic -Werror -Wall -Wextra -Wvla
noinst_LIBRARIES = libio_backend.a

View file

View file

11
src/lexer/Makefile.am Normal file
View file

@ -0,0 +1,11 @@
lib_LIBRARIES = liblexer.a
liblexer_a_SOURCES = \
lexer.c \
lexer.h
liblexer_a_CPPFLAGS = -I$(top_srcdir)/src
liblexer_a_CFLAGS = -std=c99 -pedantic -Werror -Wall -Wextra -Wvla
noinst_LIBRARIES = liblexer.a

0
src/lexer/lexer.c Normal file
View file

0
src/lexer/lexer.h Normal file
View file

11
src/parser/Makefile.am Normal file
View file

@ -0,0 +1,11 @@
lib_LIBRARIES = libparser.a
libparser_a_SOURCES = \
parser.c \
parser.h
libparser_a_CPPFLAGS = -I$(top_srcdir)/src
libparser_a_CFLAGS = -std=c99 -pedantic -Werror -Wall -Wextra -Wvla
noinst_LIBRARIES = libparser.a

0
src/parser/parser.c Normal file
View file

0
src/parser/parser.h Normal file
View file