summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorLuke Bratch <luke@bratch.co.uk>2020-10-24 18:00:07 +0100
committerLuke Bratch <luke@bratch.co.uk>2020-10-24 18:00:07 +0100
commit8bb628f9022b9937543595a3009a4763ff05731f (patch)
treea97a92258b2a4815f6ae929524e0290b9c5068fc /Makefile
parent72ed376a969065f913401d1d0d0db0fd27877c75 (diff)
Add install and uninstall recipes to Makefile.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 12 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 4866dfc..391a278 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,16 @@
CC=gcc
+ifeq ($(PREFIX),)
+ PREFIX := /usr/local
+endif
blabouncer: blabouncer.c functions.c sockets.c config.c replay.c logging.c message.c
$(CC) -D_DEFAULT_SOURCE -D_BSD_SOURCE -std=gnu99 -Wall -Wextra -lssl -lcrypto -o blabouncer blabouncer.c functions.c sockets.c config.c replay.c logging.c message.c
+
+.PHONY: install
+install: blabouncer
+ install -d $(DESTDIR)$(PREFIX)/bin/
+ install -m 755 blabouncer $(DESTDIR)$(PREFIX)/bin/
+
+.PHONY: uninstall
+uninstall:
+ rm -f $(DESTDIR)$(PREFIX)/bin/blabouncer