summaryrefslogtreecommitdiffhomepage
path: root/Makefile
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2021-02-14 22:25:06 +0100
committerAki <please@ignore.pl>2021-02-14 22:25:06 +0100
commit63278799aad89e941daa2853bb6f57f6d13f055a (patch)
treecdf48d8d866adfdba81bea6a80c3f64285b9f484 /Makefile
parent3444dac786ad9c44b549765860fa76147d2be37d (diff)
downloadplop-63278799aad89e941daa2853bb6f57f6d13f055a.zip
plop-63278799aad89e941daa2853bb6f57f6d13f055a.tar.gz
plop-63278799aad89e941daa2853bb6f57f6d13f055a.tar.bz2
Separated share directory for installation purposes
Diffstat (limited to 'Makefile')
-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