From 195b68d5df33ee76488479e44bef60a78f0ce9fc Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Sun, 18 Mar 2018 19:18:10 +0100 Subject: Add install and uninstall target to Makefile --- Makefile | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'Makefile') 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" -- cgit v1.2.3