Convert build process to autotools
Replaced the use of a manual Makefile with the use of autotools to
automatically verify and generate the necessary build files. Follow the
steps outlined within the README.md file to build the package.
Change-Id: Id7be6220d32e457b1171d5d98123c6d8f317b380
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..3aa8cf8
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,36 @@
+sbin_PROGRAMS = mapper
+
+mapper_SOURCES = libmapper/app.c
+mapper_LDFLAGS = $(SYSTEMD_LIBS)
+mapper_CFLAGS = $(SYSTEMD_CFLAGS)
+mapper_LDADD = libmapper.la
+
+libmapperdir = ${libdir}
+libmapper_LTLIBRARIES = libmapper.la
+libmapper_la_SOURCES = libmapper/mapper.c
+libmapper_la_LDFLAGS = $(SYSTEMD_LIBS) -version-info 1:0:0 -shared
+libmapper_la_CFLAGS = $(SYSTEMD_CFLAGS)
+
+oldinclude_HEADERS = libmapper/mapper.h
+
+if HAVE_PYTHON
+
+all-local:
+ $(AM_V_at)$(PYTHON) ${top_builddir}/setup.py build
+
+clean-local:
+ rm -rfv ${top_builddir}/build
+
+install-exec-hook:
+ $(AM_V_at)$(PYTHON) ${top_builddir}/setup.py install \
+ --prefix=$(DESTDIR)${prefix} \
+ --install-data=$(DESTDIR)${datadir} \
+ --install-lib=$(DESTDIR)$(PYTHONDIR) \
+ --install-scripts=$(DESTDIR)${sbindir} \
+ --record=${top_builddir}/python_install.log
+
+uninstall-hook:
+ cat ${top_builddir}/python_install.log \
+ | awk '{print "$(DESTDIR)"$$1}' | xargs rm -fv
+
+endif