summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick <Patrick.Murphy@multitech.com>2020-04-01 13:26:27 -0500
committerPatrick <Patrick.Murphy@multitech.com>2020-04-01 13:26:27 -0500
commita1558341bcbfbcb878726f5bd4b4dd6eda14d551 (patch)
tree0625cd8ded946d6fe675256d3056a1a685068428
parent78178d911f0ede1776390b360af2ee0235e4fa53 (diff)
downloadcommissioning-a1558341bcbfbcb878726f5bd4b4dd6eda14d551.tar.gz
commissioning-a1558341bcbfbcb878726f5bd4b4dd6eda14d551.tar.bz2
commissioning-a1558341bcbfbcb878726f5bd4b4dd6eda14d551.zip
modified makefile format
-rw-r--r--Makefile.am2
-rw-r--r--configure.am19
-rw-r--r--src/Makefile27
-rw-r--r--src/Makefile.am10
-rw-r--r--src/fcgi_commission.cc (renamed from src/fcgi_commission.cpp)0
5 files changed, 31 insertions, 27 deletions
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..f043be5
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,2 @@
+AUTOMAKE_OPTIONS = gnu
+SUBDIRS = src \ No newline at end of file
diff --git a/configure.am b/configure.am
new file mode 100644
index 0000000..255d0b4
--- /dev/null
+++ b/configure.am
@@ -0,0 +1,19 @@
+AC_INIT([commission.fcgi], [0.1])
+AC_CONFIG_SRCDIR([/src/fcgi_commission.cc])
+AC_INIT_AUTOMAKE
+
+AC_PROG_CC
+AC_PROG_CXX
+AC_PROG_INSTALL
+AC_PROG_MAKE_SET
+
+AC_HEADER_STDC
+
+AC_CHECK_HEADERS([ \
+stdio.h stdlib.h unistd.h getopt.h errno.h time.h \
+ctype.h sys/types.h sys/stat.h fcntl.h stdarg.h string.h printf.h \
+stdint.h sys/ioctrl.h fcgio.h \
+], [],AC_MSG_ERROR([
+required header missing]))
+
+AC_OUTPUT([Makefile src/Makefile]) \ No newline at end of file
diff --git a/src/Makefile b/src/Makefile
deleted file mode 100644
index a13fd64..0000000
--- a/src/Makefile
+++ /dev/null
@@ -1,27 +0,0 @@
-ARCH=$(shell uname -m)
-
-CC := g++
-SRCDIR := .
-BUILDDIR := $(ARCH)
-DEPLOYDIR := deploy
-# TARGET := $(DEPLOYDIR)/fcgi_commission_$(ARCH).fcgi
-
-SRCEXT := cpp
-SOURCES := $(shell find $(SRCDIR) -type f -name *.$(SRCEXT))
-OBJECTS := $(patsubst $(SRCDIR)/%,$(BUILDDIR)/%,$(SOURCES:.$(SRCEXT)=.o))
-CCFLAGS := -std=c++11 -g -Wall -Werror -pedantic -pedantic-errors
-LIB := -ljsoncpp -lfcgi++ -lfcgi -lcurl
-INC := -I
-
-S = "${WORKDIR}/git
-
-install:
- mkdir -p $(DESTDIR)/sbin
- cp fcgi_commission $(DESTDIR)/sbin
-
-fcgi_commission: $(OBJECTS)
- $(CC) $(CCFLAGS) $(LDFLAGS) -o $@ $(OBJECTS) /usr/sbin $(LIB)
-
-%.o: %.CC
- $(CC) $(CCFLAGS) -c
-
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644
index 0000000..8a3784f
--- /dev/null
+++ b/src/Makefile.am
@@ -0,0 +1,10 @@
+AUTOMAKE_OPTIONS = gnu
+AM_CFLAGS = -Wall
+
+sbin_PROGRAMS = commission.fcgi
+commission.fcgi_SOURCES = fcgi_commission.cc
+commission.fcgi_SOURCES = -ljsoncpp -lrt -lfcgi++ -lfcgi
+
+install-exec-hook:
+ cd $(DESTDIR)$(sbindir) ../../sbin/commission.fcgi
+ rmdir $(DESTDIR)$(sbindir) \ No newline at end of file
diff --git a/src/fcgi_commission.cpp b/src/fcgi_commission.cc
index bd082ff..bd082ff 100644
--- a/src/fcgi_commission.cpp
+++ b/src/fcgi_commission.cc