commit b08dacf3c06d4bf5a31dd7d289e60fd988edf022 Author: Bruno BELANYI Date: Sun Sep 27 21:18:23 2020 +0200 build: add inital autotools setup diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..1ab298e --- /dev/null +++ b/Makefile.am @@ -0,0 +1,15 @@ +NULL = +# Program and sources +bin_PROGRAMS = jitters +jitters_SOURCES = \ + src/jitters.c \ + $(NULL) + +# Add warnings +jitters_CFLAGS = $(WARN_CFLAGS) +jitters_LDFLAGS = $(WARN_LDFLAGS) + +# Extra files to include in 'make dist' +EXTRA_DIST = \ + bootstrap \ + $(NULL) diff --git a/bootstrap b/bootstrap new file mode 100755 index 0000000..d9f4eaa --- /dev/null +++ b/bootstrap @@ -0,0 +1,19 @@ +#! /bin/sh + +# Stop on errors +set -e + +# Find where the sources are +src_dir="$(dirname "$0")" +test -z "$src_dir" && src_dir=. + +# Bootstrap in a subshell +( + cd "$src_dir" + autoreconf -fvi +) + +# Call configure, unless NOCONFIGURE is set +if test -z "$NOCONFIGURE"; then + "$src_dir"/configure "$@" +fi diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..5673346 --- /dev/null +++ b/configure.ac @@ -0,0 +1,35 @@ +# Disallow unexpanded macros +m4_pattern_forbid([^(AM|AC|AX|LT)_]) + +# Initialize the project name, version, and maitainer address +AC_INIT([jitters], [0.1-dev], [bruno@belanyi.fr]) +# Only use C for this project +AC_LANG([C]) + +# Auxiliary files +AC_CONFIG_AUX_DIR([build-aux]) +AC_CONFIG_MACRO_DIR([build-aux/m4]) + +# Non-recursive Make build system +AM_INIT_AUTOMAKE([foreign subdir-objects + dist-bzip2 no-dist-gzip + silent-rules + -Wall -Werror]) +# Use silent rules unless `make V=1` is used +AM_SILENT_RULES([yes]) +AC_CONFIG_SRCDIR([src/jitters.c]) +AC_CONFIG_FILES([Makefile]) + +# Activate release-mode when there is no dash in version +AX_IS_RELEASE([dash-version]) +# Build in debug-mode by default, except when in release +AX_CHECK_ENABLE_DEBUG([yes]) + +# Standard C99 setup +AC_PROG_CC_C99 +AC_PROG_CC_STDC + +# Warnings +AX_COMPILER_FLAGS([], [], [], [-Wall -Wextra -pedantic]) + +AC_OUTPUT diff --git a/src/jitters.c b/src/jitters.c new file mode 100644 index 0000000..32295be --- /dev/null +++ b/src/jitters.c @@ -0,0 +1,8 @@ +#include + +int main(void) +{ + puts("Hello World!"); + + return 0; +}