diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index fec55acf9353229bfcfbaa3160a10c896ab9a8ca..0000000000000000000000000000000000000000 --- a/Makefile.am +++ /dev/null @@ -1,92 +0,0 @@ -bin_PROGRAMS= 42sh - -42sh_SOURCES= src/ast/ast.h \ - src/ast/ast_and.c \ - src/ast/ast_bang.c \ - src/ast/ast_case.c \ - src/ast/ast_cmd.c \ - src/ast/ast_destruct.c \ - src/ast/ast_for.c \ - src/ast/ast_funcdec.c \ - src/ast/ast_if.c \ - src/ast/ast_or.c \ - src/ast/ast_pipe.c \ - src/ast/ast_print.c \ - src/ast/ast_red.c \ - src/ast/ast_sep.c \ - src/ast/ast_sepand.c \ - src/ast/ast_subshell.c \ - src/ast/ast_while.c \ - src/builtin/builtin.h \ - src/builtin/builtin.c \ - src/builtin/builtin_alias.c \ - src/builtin/builtin_cd.c \ - src/builtin/builtin_echo.c \ - src/builtin/builtin_exec.c \ - src/builtin/builtin_exit.c \ - src/builtin/builtin_export.c \ - src/builtin/builtin_unalias.c \ - src/builtin/builtin_unset.c \ - src/builtin/builtin_set.c \ - src/builtin/builtin_shopt.c \ - src/common/basename.c \ - src/common/constant.h \ - src/common/env.c \ - src/common/function.h \ - src/common/getcwd2.c \ - src/common/isdigitstr.c \ - src/common/macro.h \ - src/common/strmerge.c \ - src/common/strvectoradd.c \ - src/common/strvmerge.c \ - src/common/strndup.c \ - src/exec/exec.h \ - src/exec/exec_and.c \ - src/exec/exec_bang.c \ - src/exec/exec_case.c \ - src/exec/exec_cmd.c \ - src/exec/exec_for.c \ - src/exec/exec_funcdec.c \ - src/exec/exec_node.c \ - src/exec/exec_or.c \ - src/exec/exec_if.c \ - src/exec/exec_pipe.c \ - src/exec/exec_red.c \ - src/exec/exec_sep.c \ - src/exec/exec_sepand.c \ - src/exec/exec_subshell.c \ - src/exec/exec_while.c \ - src/parser/getline.c \ - src/parser/getline.h \ - src/parser/parser.c \ - src/parser/parser.h \ - src/parser/lexer.c \ - src/shell/alias.c \ - src/shell/alias.h \ - src/shell/func.c \ - src/shell/func.h \ - src/shell/getoptions.c \ - src/shell/option.c \ - src/shell/option.h \ - src/shell/shell.c \ - src/shell/shell.h \ - src/shell/prompt.c \ - src/shell/var.c \ - src/shell/var.h - - -CLEANFILES= *~ \#*\# - -EXTRA_DIST = AUTHORS README TODO doc - -.PHONY: tar doc man re - -tar: distcheck - -re: clean all - -doc: - cd $(srcdir)/doc && $(MAKE) doc - -man: - cd $(srcdir)/doc && $(MAKE) man diff --git a/README b/README index de54a03f5b533e0da6290475d6d3c8ada9aad303..124a9cffa52d218d3347fc6c9842f0bda7d176cd 100644 --- a/README +++ b/README @@ -1,3 +1,10 @@ 42sh +To build binary: +$ meson build +$ ninja -C build + +To build doxygen +$ ninja -C build html + This program was written by Sebastien Luttringer aka Seblu diff --git a/bootstrap b/bootstrap deleted file mode 100755 index f6c57402b67bd855cdd48d457d161580bbc3e1a8..0000000000000000000000000000000000000000 --- a/bootstrap +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -## bootstrap for 42sh -## -## Made by Seblu -## Login -## -## Started on Sun Jul 16 19:43:53 2006 Seblu -## Last update Thu Nov 23 14:44:19 2006 seblu -## - -# Failures do matter. -set -e - -# See what i'am doing -set -x - -# install the GNU Build System. -autoreconf -i -f -v diff --git a/configure.ac b/configure.ac deleted file mode 100644 index 3d8889e2679fe1a49aee06e68b96572e45144ced..0000000000000000000000000000000000000000 --- a/configure.ac +++ /dev/null @@ -1,134 +0,0 @@ -# Require a recent version of autotools -AC_PREREQ(2.59) - -# Auto conf init -AC_INIT([42sh],[1.0],[seblu@seblu.net], [42sh]) - -# Define configure generator directory -AC_CONFIG_AUX_DIR([build]) - -# Auto Make init -AM_INIT_AUTOMAKE([subdir-objects foreign dist-bzip2 no-dist-gzip]) - -echo "checking CFLAGS..." -# Check platform -AC_CANONICAL_HOST - -case $host_os in - *osf*) - CFLAGS='-Wall -W -ansi -pedantic -D_XOPEN_SOURCE=600' - ;; - *solaris*) - CFLAGS='-Wall -W -ansi -pedantic -D_XOPEN_SOURCE=600' - ;; - *linux*|*netbsd*) - CFLAGS='-Wall -Wextra -std=c99 -pedantic -D_XOPEN_SOURCE=600 -pipe' - ;; - *darwin*) - CFLAGS='-Wall -W -std=c99 -pedantic -D_XOPEN_SOURCE=600 -pipe' - ;; - *) - pl="`uname -s`" - AC_MSG_ERROR([Platform $pl not supported.]) - ;; -esac - -# Check for C compiler -AC_LANG([C]) -AC_PROG_CC - -# Check for Make -AC_PROG_MAKE_SET - -# check for ranlib -AC_PROG_RANLIB - -# Check for lib efence -AC_CHECK_LIB([efence], [malloc], [EFENCELIB=-lefence]) -AC_SUBST([EFENCELIB]) - -# Checks for library functions. -AC_FUNC_MALLOC -AC_FUNC_CLOSEDIR_VOID -AC_FUNC_REALLOC -AC_FUNC_FORK -AC_FUNC_STAT -AC_HEADER_DIRENT -AC_HEADER_SYS_WAIT -AC_CHECK_HEADERS([malloc.h]) -AC_CHECK_FUNCS([strtol]) -AC_CHECK_FUNCS([dup]) -AC_CHECK_FUNCS([dup2]) -AC_CHECK_FUNCS([strchr]) -AC_CHECK_FUNCS([strdup]) -AC_CHECK_FUNCS([getcwd]) -AC_CHECK_FUNCS([setenv]) -AC_CHECK_FUNCS([strdup]) -AC_CHECK_FUNCS([strstr]) -AC_CHECK_FUNCS([atexit]) -AC_CHECK_FUNCS([putenv]) -AC_CHECK_FUNCS([strtoul]) -AC_CHECK_FUNCS([strerror]) - -AC_TYPE_PID_T -AC_TYPE_SIZE_T - -# Checks for typedefs, structures, and compiler characteristics. -AC_C_CONST -AC_HEADER_STDBOOL -AC_STRUCT_TM - -# Check for headers -AC_CHECK_HEADERS([sys/param.h unistd.h]) -AC_CHECK_HEADERS([fcntl.h]) -AC_CHECK_HEADERS([libintl.h]) -AC_CHECK_HEADERS([stddef.h]) -AC_CHECK_HEADERS([limits.h]) - -dnl Memo: -dnl AC ARG WITH(package, help-string, [action-if-given], [action-if-not-given]) -AC_ARG_WITH([noerror], - [AS_HELP_STRING([--with-noerror], [Warning dont create compilation error])], - [dnl action-if-given - true - ], - [dnl action-if-not-given - CFLAGS="$CFLAGS -Werror" - ] -) - -AC_ARG_WITH([debug], - [AS_HELP_STRING([--with-debug], [use -g and don't use -DNDEBUG -O3])], - [dnl action-if-given - CFLAGS="$CFLAGS -g" - ], - [dnl action-if-not-given - CFLAGS="$CFLAGS -DNDEBUG -O3" - ] -) - -AC_ARG_WITH([efence], - [AS_HELP_STRING([--with-efence], [link with lib efence])], - [dnl action-if-given - LDFLAGS="$LDFLAGS -lefence" - test -r "/usr/include/efence.h" && - CFLAGS="$CFLAGS -include stdlib.h -include efence.h" - ], - [dnl action-if-not-given - true - ] -) - -AC_SUBST([CFLAGS]) -AC_SUBST([LDFLAGS]) - -# define Autoconf config header -AC_CONFIG_HEADERS([config.h]) - -# define Autoconf config files -AC_CONFIG_FILES([ - Makefile - doc/Makefile -]) - -AC_OUTPUT diff --git a/doc/42sh.man b/doc/42sh.1 similarity index 100% rename from doc/42sh.man rename to doc/42sh.1 diff --git a/doc/Makefile.am b/doc/Makefile.am deleted file mode 100644 index 439c3194d073ca21b6e6295ae5e556a058bc4831..0000000000000000000000000000000000000000 --- a/doc/Makefile.am +++ /dev/null @@ -1,12 +0,0 @@ - -EXTRA_DIST=doxyfile 42sh.man - -.PHONY: doc man - -doc: - doxygen doxyfile -man: - groff 42sh.man -man -T ascii > manual.txt - groff 42sh.man -man -T ps | ps2pdf - manual.pdf - -CLEANFILES=html *~ diff --git a/meson.build b/meson.build new file mode 100644 index 0000000000000000000000000000000000000000..672df147c394b68831451540f91a58260b1b073b --- /dev/null +++ b/meson.build @@ -0,0 +1,96 @@ +project('42sh', 'c', + version: '1', + license : 'GPL2', + default_options : ['c_std=c99']) + +add_project_arguments('-D_XOPEN_SOURCE=600', language : 'c') +add_project_arguments('-pipe', language : 'c') +add_project_arguments('-Wall', '-Wextra', '-pedantic', language : 'c') + +executable('42sh', [ + 'src/ast/ast.h', + 'src/ast/ast_and.c', + 'src/ast/ast_bang.c', + 'src/ast/ast_case.c', + 'src/ast/ast_cmd.c', + 'src/ast/ast_destruct.c', + 'src/ast/ast_for.c', + 'src/ast/ast_funcdec.c', + 'src/ast/ast_if.c', + 'src/ast/ast_or.c', + 'src/ast/ast_pipe.c', + 'src/ast/ast_print.c', + 'src/ast/ast_red.c', + 'src/ast/ast_sep.c', + 'src/ast/ast_sepand.c', + 'src/ast/ast_subshell.c', + 'src/ast/ast_while.c', + 'src/builtin/builtin.h', + 'src/builtin/builtin.c', + 'src/builtin/builtin_alias.c', + 'src/builtin/builtin_cd.c', + 'src/builtin/builtin_echo.c', + 'src/builtin/builtin_exec.c', + 'src/builtin/builtin_exit.c', + 'src/builtin/builtin_export.c', + 'src/builtin/builtin_unalias.c', + 'src/builtin/builtin_unset.c', + 'src/builtin/builtin_set.c', + 'src/builtin/builtin_shopt.c', + 'src/common/basename.c', + 'src/common/constant.h', + 'src/common/env.c', + 'src/common/function.h', + 'src/common/getcwd2.c', + 'src/common/isdigitstr.c', + 'src/common/macro.h', + 'src/common/strmerge.c', + 'src/common/strvectoradd.c', + 'src/common/strvmerge.c', + 'src/common/strndup.c', + 'src/exec/exec.h', + 'src/exec/exec_and.c', + 'src/exec/exec_bang.c', + 'src/exec/exec_case.c', + 'src/exec/exec_cmd.c', + 'src/exec/exec_for.c', + 'src/exec/exec_funcdec.c', + 'src/exec/exec_node.c', + 'src/exec/exec_or.c', + 'src/exec/exec_if.c', + 'src/exec/exec_pipe.c', + 'src/exec/exec_red.c', + 'src/exec/exec_sep.c', + 'src/exec/exec_sepand.c', + 'src/exec/exec_subshell.c', + 'src/exec/exec_while.c', + 'src/parser/getline.c', + 'src/parser/getline.h', + 'src/parser/parser.c', + 'src/parser/parser.h', + 'src/parser/lexer.c', + 'src/shell/alias.c', + 'src/shell/alias.h', + 'src/shell/func.c', + 'src/shell/func.h', + 'src/shell/getoptions.c', + 'src/shell/option.c', + 'src/shell/option.h', + 'src/shell/shell.c', + 'src/shell/shell.h', + 'src/shell/prompt.c', + 'src/shell/var.c', + 'src/shell/var.h'], + install : true) + +install_man('doc/42sh.1') + +# doxygen +doxygen = find_program('doxygen', required : false) + +if doxygen.found() +custom_target('Doxygen documentation', + input: 'doc/doxyfile', + output: 'html', + command: [doxygen, '@INPUT@']) +endif