Switched to autotools
authorTom Balzer <niebieskitrociny@gmail.com>
Mon, 11 Mar 2019 04:07:29 +0000 (23:07 -0500)
committerTom Balzer <niebieskitrociny@gmail.com>
Mon, 11 Mar 2019 04:07:29 +0000 (23:07 -0500)
14 files changed:
.gitignore
Makefile [deleted file]
Makefile.am [new file with mode: 0644]
configure.ac [new file with mode: 0644]
src/Makefile.am [new file with mode: 0644]
src/PROTOCOL_DESIGN [moved from src/common/PROTOCOL_DESIGN with 100% similarity]
src/dumb-client/main.c [deleted file]
src/guile_helpers.c [moved from src/common/guile_helpers.c with 98% similarity]
src/protocol.c [moved from src/common/protocol.c with 100% similarity]
src/socketio.c [moved from src/common/socketio.c with 100% similarity]
src/tomc.c [moved from src/tomc/main.c with 98% similarity]
src/tomd.c [moved from src/tomd/main.c with 98% similarity]
src/tomd/init.c [deleted file]
src/tomd/manifest.c [deleted file]

index 01d7463..7daaf60 100644 (file)
@@ -3,3 +3,18 @@
 /client
 /tomc
 /tests/find_lines/a.out
+/src/tomc
+*.o
+/src/tomd
+Makefile
+*.in
+/aclocal.m4
+/compile
+*.log
+/config.status
+/configure
+/depcomp
+/install-sh
+/missing
+.deps
+autom4te.cache
diff --git a/Makefile b/Makefile
deleted file mode 100644 (file)
index 3affb96..0000000
--- a/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# TODO > Use GNU automake tools
-
-all:tomd tomc
-
-tomd:./src/tomd/main.c ./src/common/guile_helpers.c
-       gcc -static -o tomd \
-       -I/usr/local/include/guile/2.2 \
-       ./src/tomd/main.c ./src/common/guile_helpers.c
-
-tomc:./src/tomc/main.c ./src/common/socketio.c
-       gcc -o tomc ./src/tomc/main.c ./src/common/socketio.c -static
diff --git a/Makefile.am b/Makefile.am
new file mode 100644 (file)
index 0000000..bc39d20
--- /dev/null
@@ -0,0 +1,2 @@
+SUBDIRS=src
+# dis_doc_DATA = README, CONTRIBUTING, COPYING
diff --git a/configure.ac b/configure.ac
new file mode 100644 (file)
index 0000000..779cb8a
--- /dev/null
@@ -0,0 +1,9 @@
+AC_INIT([tomd], [0.0.1], [tbalzer2012@gmail.com])
+AM_INIT_AUTOMAKE([-Wall -Werror foreign])
+AC_PROG_CC
+dnl AC_CONFIG_HEADERS([])
+AC_CONFIG_FILES([
+    Makefile
+    src/Makefile
+])
+AC_OUTPUT
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644 (file)
index 0000000..6bea2c6
--- /dev/null
@@ -0,0 +1,3 @@
+bin_PROGRAMS=tomc tomd
+tomc_SOURCES=tomc.c guile_helpers.c socketio.c
+tomd_SOURCES=tomd.c guile_helpers.c socketio.c
diff --git a/src/dumb-client/main.c b/src/dumb-client/main.c
deleted file mode 100644 (file)
index 9a61a23..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/* Copyright (C) 2018 Thomas Balzer */
-
-/* This file is part of tomd. */
-
-/* tomd is free software: you can redistribute it and/or modify */
-/* it under the terms of the GNU General Public License as published by */
-/* the Free Software Foundation, either version 3 of the License, or */
-/* (at your option) any later version. */
-
-/* tomd is distributed in the hope that it will be useful, */
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the */
-/* GNU General Public License for more details. */
-
-/* You should have received a copy of the GNU General Public License */
-/* along with tomd.  If not, see <http://www.gnu.org/licenses/>. */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <sys/un.h>
-#include <sys/socket.h>
-#include <unistd.h>
-
-static int sfd;
-
-static void init(void)
-{
-  /* init socket connection */
-  sfd =
-    socket(PF_LOCAL,
-           SOCK_STREAM,
-           0);
-  if(sfd < 0){
-    perror("socket");
-    exit(EXIT_FAILURE);
-  }
-
-  struct sockaddr_un addr;
-  addr.sun_family = AF_LOCAL;
-  sprintf(addr.sun_path, "/run/user/1000/tomd/socket");
-  
-  if(connect(sfd, (struct sockaddr *) &addr, SUN_LEN(&addr)) != 0){
-    perror("connect");
-    exit(EXIT_FAILURE);
-  }
-}
-
-#define HALLO "hallo there from dumb-client"
-
-void write_hallo(void)
-{
-  printf("writing hallo\n");
-  ssize_t wrote =
-    write(sfd, HALLO, sizeof HALLO);
-  printf("wrote %d bytes.\n", wrote);
-}
-
-int main(int argc, char **argv)
-{
-  printf("dumb client startup.\n");
-
-  init();
-  write_hallo();
-  
-  return EXIT_SUCCESS;
-}
similarity index 98%
rename from src/common/guile_helpers.c
rename to src/guile_helpers.c
index 416a790..b68a769 100644 (file)
 /* You should have received a copy of the GNU General Public License */
 /* along with tomd.  If not, see <http://www.gnu.org/licenses/>. */
 
-#include <libguile.h>
 #include <pwd.h>
 #include <fcntl.h>
 #include <string.h>
+#include <stdio.h>
 #include <sys/wait.h>
 
-#include "../../include/job.h"
-#include "../../include/macros.h"
+#include "../include/job.h"
+#include "../include/macros.h"
 
 #ifdef GUILE_CAPABLE
-#include "../../include/scm_interface.h"
+#include <libguile.h>
+#include "../include/scm_interface.h"
 #endif
 
 #define MANIFEST_LOC "/.config/tomd/init/manifest.scm"
similarity index 100%
rename from src/common/protocol.c
rename to src/protocol.c
similarity index 100%
rename from src/common/socketio.c
rename to src/socketio.c
similarity index 98%
rename from src/tomc/main.c
rename to src/tomc.c
index 46f44a7..7c2044d 100644 (file)
@@ -21,8 +21,8 @@
 #include <sys/socket.h>
 #include <unistd.h>
 
-#include "../../include/macros.h"
-#include "../../include/manifest.h"
+#include "../include/macros.h"
+#include "../include/manifest.h"
 
 static int sfd;
 
similarity index 98%
rename from src/tomd/main.c
rename to src/tomd.c
index f4bf04b..0467a23 100644 (file)
@@ -27,9 +27,9 @@
 #include <sys/socket.h>
 #include <sys/wait.h>
 
-#include "../../include/macros.h"
-#include "../../include/manifest.h"
-#include "../../include/job.h"
+#include "../include/macros.h"
+#include "../include/manifest.h"
+#include "../include/job.h"
 
 static void header(void)
 {
diff --git a/src/tomd/init.c b/src/tomd/init.c
deleted file mode 100644 (file)
index 9e12975..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Copyright (C) 2018 Thomas Balzer */
-
-/* This file is part of tomd. */
-
-/* tomd is free software: you can redistribute it and/or modify */
-/* it under the terms of the GNU General Public License as published by */
-/* the Free Software Foundation, either version 3 of the License, or */
-/* (at your option) any later version. */
-
-/* tomd is distributed in the hope that it will be useful, */
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the */
-/* GNU General Public License for more details. */
-
-/* You should have received a copy of the GNU General Public License */
-/* along with tomd.  If not, see <http://www.gnu.org/licenses/>. */
-
-#define DEFAULT_INIT_DIR "~/.config/tomd/init
-
-static void run_init(void)
-{
-  /* load all recognized files in the init directory */
-  /* check for a manifest (defines run order) */
-  /* loop through the manifest */
-}
diff --git a/src/tomd/manifest.c b/src/tomd/manifest.c
deleted file mode 100644 (file)
index 2c6c2f0..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Copyright (C) 2018 Thomas Balzer */
-
-/* This file is part of tomd. */
-
-/* tomd is free software: you can redistribute it and/or modify */
-/* it under the terms of the GNU General Public License as published by */
-/* the Free Software Foundation, either version 3 of the License, or */
-/* (at your option) any later version. */
-
-/* tomd is distributed in the hope that it will be useful, */
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the */
-/* GNU General Public License for more details. */
-
-/* You should have received a copy of the GNU General Public License */
-/* along with tomd.  If not, see <http://www.gnu.org/licenses/>. */
-
-
-
-static void load_manifest(const char const *manifest_path)
-{
-  
-}