summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--Makefile20
1 files changed, 11 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index d28dc6d..c1e137f 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,9 @@
CFLAGS+=-std=c11 -Wall -Wextra -Wpedantic -D_POSIX_C_SOURCE=200809L
CFLAGS+=-I/usr/include/lua5.3
LDLIBS+=-llua5.3
+
PREFIX?=/usr/local
+SHARE?=$(PREFIX)/share
plop: connection.o main.o plop.o response.o request.o
@@ -16,19 +18,19 @@ clean:
install: plop
mkdir -p $(PREFIX)/bin
- mkdir -p $(PREFIX)/share/man/man1
- mkdir -p $(PREFIX)/share/plop
+ mkdir -p $(SHARE)/man/man1
+ mkdir -p $(SHARE)/plop
cp -f plop $(PREFIX)/bin
- cp -f plop.1 $(PREFIX)/share/man/man1
- cp -f default.lua $(PREFIX)/share/plop
+ cp -f plop.1 $(SHARE)/man/man1
+ cp -f default.lua $(SHARE)/plop
chmod 755 $(PREFIX)/bin/plop
- chmod 644 $(PREFIX)/share/man/man1/plop.1
- chmod 644 $(PREFIX)/share/plop/default.lua
+ chmod 644 $(SHARE)/man/man1/plop.1
+ chmod 644 $(SHARE)/plop/default.lua
uninstall:
rm -f $(PREFIX)/bin/plop
- rm -f $(PREFIX)/share/man/man1/plop.1
- rm -f $(PREFIX)/share/plop/default.lua
- rmdir --ignore-fail-on-non-empty $(PREFIX)/share/plop
+ rm -f $(SHARE)/man/man1/plop.1
+ rm -f $(SHARE)/plop/default.lua
+ rmdir $(SHARE)/plop
.PHONY: clean install uninstall