Add install-headers target
Install the libopenbmc_intf includes in prep for a devel
package.
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/libopenbmc_intf/Makefile b/libopenbmc_intf/Makefile
index 8853318..54bef57 100644
--- a/libopenbmc_intf/Makefile
+++ b/libopenbmc_intf/Makefile
@@ -1,14 +1,19 @@
PACKAGE_DEPS=gio-unix-2.0 glib-2.0
-INSTALLDEPS=install-lib
+INSTALLDEPS=install-lib install-headers
CLEANDEPS=clean-lib
DEFAULT_ALL=$(LIBOBMC)
ALL_CFLAGS+=-iquote ../gdbus
LIBOBMC=openbmc_intf
+INCLUDES=openbmc_intf.h openbmc.h gpio.h
$(LIBOBMC): %: %.o gpio.o
$(CC) -shared $(CFLAGS) $(LDFLAGS) -Wl,-soname,lib$(LIBOBMC).so \
-o lib$@.so.1 $^ $(LDLIBS)
+install-headers:
+ @mkdir -p $(DESTDIR)$(includedir)
+ install $(INCLUDES) $(DESTDIR)$(includedir)
+
install-lib:
@mkdir -p $(DESTDIR)$(libdir)
install lib$(LIBOBMC).so.1 $(DESTDIR)$(libdir)
diff --git a/rules.mk b/rules.mk
index fb6c000..c7075c1 100644
--- a/rules.mk
+++ b/rules.mk
@@ -3,6 +3,7 @@
.DEFAULT_GOAL := all
sbindir=/usr/sbin
libdir=/usr/lib
+includedir=/usr/include
LDLIBS+=$(shell pkg-config --libs $(PACKAGE_DEPS))
ALL_CFLAGS+=$(shell pkg-config --cflags $(PACKAGE_DEPS)) -fPIC -Werror $(CFLAGS)