commit d67ea5250899e8722bf319798ba8d9d1b66dacda
parent 8c786236c25d5ff294d39ace7378ccfe172b1ce9
Author: Louis Burda <quent.burda@gmail.com>
Date: Tue, 11 Oct 2022 01:29:33 +0200
Added install and uninstall targets
Diffstat:
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
@@ -1,10 +1,11 @@
+PREFIX ?= /usr/local
+BINDIR ?= /bin
+
CFLAGS = --std=gnu99 -Wmissing-prototypes -Wunused-variable -g
LIB_FLAGS = $(CFLAGS) -nostartfiles -fPIC -shared -Wl,-soname,xwrap.so
LOADER_FLAGS = $(CFLAGS)
LDLIBS = -ldl -lX11 -lXinerama
-.PHONY: all clean
-
all: winpl
clean:
@@ -20,4 +21,10 @@ winpl.so.o: winpl.so
objcopy --input binary --output elf64-x86-64 \
--binary-architecture i386:x86-64 $< $@
+install: winpl
+ install -m755 winpl -t "$(DESTDIR)$(PREFIX)$(BINDIR)"
+
+uninstall:
+ rm -f "$(DESTDIR)$(PREFIX)$(BINDIR)/winpl"
+.PHONY: all clean install uninstall