summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorxengineering <mail2xengineering@protonmail.com>2021-01-30 14:30:45 +0100
committerxengineering <mail2xengineering@protonmail.com>2021-01-30 14:30:45 +0100
commitb1918078d913193544e0fdc933457d2a71836447 (patch)
treed7fc36387a4c6777388fd08b282e81faf1532c43 /Makefile
parent67d373164190404fe0995bdadb81715cb32fe15b (diff)
downloadxbot-b1918078d913193544e0fdc933457d2a71836447.tar
xbot-b1918078d913193544e0fdc933457d2a71836447.tar.zst
xbot-b1918078d913193544e0fdc933457d2a71836447.zip
Enable Installation via Make
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile14
1 files changed, 12 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index f1f8622..cd8b97d 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,10 @@
-
+# vim: tabstop=4 shiftwidth=4 noexpandtab
TARGET_EXEC := build/xbot
+PREFIX=/usr
+INSTALL=install
+INSTALL_PROGRAM=$(INSTALL) -m 755
+bindir=$(DESTDIR)$(PREFIX)/bin
SRCS := $(wildcard src/*.c)
OBJS := $(patsubst src/%.c, build/%.o, $(SRCS))
@@ -16,7 +20,13 @@ build/%.o: src/%.c
mkdir -p build
$(CC) -c $< -o $@
-.PHONY: clean
+install: all
+ $(INSTALL_PROGRAM) $(TARGET_EXEC) $(bindir)/xbot
+
+uninstall:
+ rm -f $(bindir)/xbot
+
+.PHONY: clean uninstall
clean:
rm -r build