Reorganize directory structure

Moving to directory per-application layout.  This facilitates
building single applications which is useful in the Yocto build
environment since different applications satisfy different OpenBMC
build requirements.

A number of issues are also addressed:
 - All applications were pulling in libsystemd and the gdbus libs
    irrespective of whether or not they were needed.
 - gpio.o duplicated in every application - moved to libopenbmc_intf
 - Added install target

Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/libopenbmc_intf/Makefile b/libopenbmc_intf/Makefile
new file mode 100644
index 0000000..9cd7be6
--- /dev/null
+++ b/libopenbmc_intf/Makefile
@@ -0,0 +1,20 @@
+PACKAGE_DEPS=gio-unix-2.0 glib-2.0
+INSTALLDEPS=install-lib
+CLEANDEPS=clean-lib
+DEFAULT_ALL=$(LIBOBMC)
+CFLAGS+=-iquote ../gdbus
+LIBOBMC=openbmc_intf
+
+$(LIBOBMC): %: %.o gpio.o
+	$(CC) -shared $(LDFLAGS) -Wl,-soname,lib$(LIBOBMC).so \
+		-o lib$@.so.1 $^ $(LDLIBS)
+
+install-lib:
+	@mkdir -p $(DESTDIR)$(libdir)
+	install lib$(LIBOBMC).so.1 $(DESTDIR)$(libdir)
+	ln -s lib$(LIBOBMC).so.1 $(DESTDIR)$(libdir)/lib$(LIBOBMC).so
+
+clean-lib:
+	rm -f lib$(LIBOBMC).so.1
+
+include ../rules.mk