aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2022-04-17 22:26:33 +0200
committerPatrick Spek <p.spek@tyil.nl>2022-04-17 22:26:33 +0200
commitad62d1da67831c6de287835a1188cead7c3f4ff1 (patch)
tree11531f877529fb2306808d3437d7306df4b21f56 /Makefile
parent97ea86450b3619cca8a0d562a669f5678d5df168 (diff)
Add a Makefile for easy installation
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile28
1 files changed, 28 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..ef22cd4
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,28 @@
+#!/usr/bin/env make
+
+DESTDIR=/usr
+
+install: bin lib share
+
+uninstall:
+ rm -fv -- "$(DESTDIR)/bin/bashtard"
+ rm -rfv -- "$(DESTDIR)/lib/bashtard"
+ rm -rfv -- "$(DESTDIR)/share/bashtard"
+
+bin:
+ mkdir -pv -- "$(DESTDIR)/bin"
+ sed \
+ -e 's@BASHTARD_LIBDIR=.*@BASHTARD_LIBDIR="$(DESTDIR)/lib/bashtard"@' \
+ -e 's@BASHTARD_SHAREDIR=.*@BASHTARD_SHAREDIR="$(DESTDIR)/share/bashtard"@' \
+ bin/bashtard > "$(DESTDIR)/bin/bashtard"
+ chmod +x -- "$(DESTDIR)/bin/bashtard"
+
+lib:
+ mkdir -pv -- "$(DESTDIR)/lib/bashtard"
+ cp -rv -- lib/* "$(DESTDIR)/lib/bashtard"
+
+share:
+ mkdir -pv -- "$(DESTDIR)/share/bashtard"
+ cp -rv -- share/* "$(DESTDIR)/share/bashtard"
+
+.PHONY: install uninstall bin lib share