From 585b651f28c3bdf8e12e49fcfba2d0f1c21038d1 Mon Sep 17 00:00:00 2001 From: alex Date: Mon, 9 May 2022 23:10:37 -0700 Subject: [PATCH] ... --- .gitignore | 31 +++++++++++++++++++++++++++++++ Makefile.am | 11 +++++++++++ configure.ac | 26 ++++++++++++++++++++++++++ inc/main.h | 10 ++++++++++ src/main.c | 12 ++++++++++++ 5 files changed, 90 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile.am create mode 100644 configure.ac create mode 100644 inc/main.h create mode 100644 src/main.c diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0baa996 --- /dev/null +++ b/.gitignore @@ -0,0 +1,31 @@ +# autoconf/make +autom4te.cache/ +autoscan.log +aclocal.m4 +build-aux/ +config.h.in +config.h +config.h.in~ +config.log +config.status +configure +configure.scan +*.in +*.in~ +**/.deps +**/.dirstamp +**/Makefile +**/Makefile.in +stamp-h1 + +# tags +tags + +# build objects +*.o +*.log +*.trs +*.tests + +# binaries +cold diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..c69add9 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,11 @@ +AM_CPPFLAGS = \ + -Wall \ + -Werror + +bin_PROGRAMS = cold + +cold_SOURCES = \ + src/main.c + +cold_SOURCES += \ + inc/main.h diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..c486633 --- /dev/null +++ b/configure.ac @@ -0,0 +1,26 @@ +AC_PREREQ([2.69]) +AC_INIT([cold], [0.0.0]) + +# Store build files not in main directory +AC_CONFIG_AUX_DIR([build-aux]) + +AM_INIT_AUTOMAKE([foreign subdir-objects -Wall -Werror]) + +AC_CONFIG_SRCDIR([src/main.c]) +AC_CONFIG_HEADERS([inc/config.h]) + +# Checks for programs. +AC_PROG_CC + +# Checks for libraries. +AC_CHECK_LIB([udev],[udev_new]) + +# Checks for header files. +AC_CHECK_HEADERS([stdlib.h]) + +# Checks for typedefs, structures, and compiler characteristics. + +# Checks for library functions. + +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT diff --git a/inc/main.h b/inc/main.h new file mode 100644 index 0000000..b073e2d --- /dev/null +++ b/inc/main.h @@ -0,0 +1,10 @@ +#ifndef __MAIN_H_ +#define __MAIN_H_ + +#include + +#include + +int main(int,char**); + +#endif diff --git a/src/main.c b/src/main.c new file mode 100644 index 0000000..c38e52a --- /dev/null +++ b/src/main.c @@ -0,0 +1,12 @@ +#include + +int main(int argc, char **argv) { + struct udev *monitor; + + monitor = udev_new(); + if(NULL==monitor) { return EXIT_FAILURE; } + + udev_unref(monitor); + + return EXIT_SUCCESS; +} -- 2.39.5