From b1918078d913193544e0fdc933457d2a71836447 Mon Sep 17 00:00:00 2001 From: xengineering Date: Sat, 30 Jan 2021 14:30:45 +0100 Subject: Enable Installation via Make --- Makefile | 14 ++++++++++++-- 1 file 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 -- cgit v1.2.3-70-g09d2