aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorRobin Krahl <me@robin-krahl.de>2018-03-18 19:18:10 +0100
committerRobin Krahl <me@robin-krahl.de>2018-03-18 19:18:10 +0100
commit195b68d5df33ee76488479e44bef60a78f0ce9fc (patch)
tree94d1cc450f408f930e231e02db802faf88be2377 /Makefile
parentfa1a10278f0a157ee2d47c8fd8cc7fc7c9f9f752 (diff)
downloadmidbro-195b68d5df33ee76488479e44bef60a78f0ce9fc.tar.gz
midbro-195b68d5df33ee76488479e44bef60a78f0ce9fc.tar.bz2
Add install and uninstall target to Makefile
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile14
1 files changed, 14 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index d50fb9e..703d102 100644
--- a/Makefile
+++ b/Makefile
@@ -7,6 +7,10 @@ DEBUG =
SRC = midbro.c broevent.c fifoqueue.c
OBJ = $(patsubst %.c, build/%.o, $(SRC))
+PREFIX = $(DESTDIR)/usr/local
+
+.PHONY: all dirs clean install uninstall lib/midbro bin/tests
+
all: dirs lib/midbro
dirs:
@@ -29,3 +33,13 @@ build/tests.o: test/tests.c
clean:
rm build/* bin/*
+
+install: lib/midbro
+ mkdir -p "$(PREFIX)/include"
+ mkdir -p "$(PREFIX)/lib"
+ cp -p include/midbro.h "$(PREFIX)/include/"
+ cp -p lib/libmidbro.so "$(PREFIX)/lib/"
+
+uninstall:
+ rm -f "$(PREFIX)/include/midbro.h"
+ rm -f "$(PREFIX)/lib/libmidbro.so"