$ git clone https://socialnetwork.ion.nu/socialnetwork.git
commit d77f04ac6bee0812e3b5b158a7bda4f8b67bf4ff
Author: Alicia <...>
Date:   Sun Jan 22 13:46:03 2017 +0100

    Added an 'install' target.

diff --git a/Makefile b/Makefile
index d3f053f..62667e9 100644
--- a/Makefile
+++ b/Makefile
@@ -1,13 +1,35 @@
 LIBS=$(shell pkg-config --libs gnutls)
 CFLAGS=-g3 -Wall $(shell pkg-config --cflags gnutls)
+PREFIX=/usr
 
-socialtest: socialtest.o libsocial.so
- $(CC) $^ -Wl,-R. -o $@
+all: socialtest libsocial.so libsocial.pc
 
 libsocial.so: CFLAGS+=-fPIC
 libsocial.so: social.o peer.o update.o udpstream.o
  $(CC) -shared $^ $(LIBS) -o $@
 
+libsocial.pc:
+ echo 'prefix=$(PREFIX)' > libsocial.pc
+ echo 'libdir=$${prefix}/lib' >> libsocial.pc
+ echo 'includedir=$${prefix}/include' >> libsocial.pc
+ echo 'Name: libsocial (for now)' >> libsocial.pc
+ echo 'Version: 0.x' >> libsocial.pc
+ echo 'Description: peer-to-peer social network' >> libsocial.pc
+ echo 'Libs: -L$${libdir} -lsocial' >> libsocial.pc
+ echo 'Cflags: -I$${includedir}/libsocial' >> libsocial.pc
+
+install: libsocial.so libsocial.pc
+ install -D libsocial.so $(PREFIX)/lib/libsocial.so
+ install -D libsocial.pc $(PREFIX)/lib/pkgconfig/libsocial.pc
+ install -D udpstream.h $(PREFIX)/include/libsocial/udpstream.h
+ install -D peer.h $(PREFIX)/include/libsocial/peer.h
+ install -D buffer.h $(PREFIX)/include/libsocial/buffer.h
+ install -D update.h $(PREFIX)/include/libsocial/update.h
+ install -D social.h $(PREFIX)/include/libsocial/social.h
+
+socialtest: socialtest.o libsocial.so
+ $(CC) $^ -o $@
+
 peertest: peertest.o peer.o udpstream.o
  $(CC) $^ $(LIBS) -o $@
 
@@ -15,4 +37,4 @@ udptest: udptest.o udpstream.o
  $(CC) $^ -o $@
 
 clean:
- rm -f *.o *.so socialtest peertest udptest
+ rm -f *.o *.so socialtest peertest udptest *.pc