summarylogtreecommitdiffstats
path: root/add-makefile.diff
blob: 3b159b73552edc750e039676b5c53cc142e4d606 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..d99234d
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,20 @@
+.POSIX:
+
+DESTDIR =
+PREFIX = /usr/local
+BASEDIR = $(DESTDIR)$(PREFIX)
+
+install: __phony
+	mkdir -m 0755 -p "$(BASEDIR)/share/nadeshiko" "$(BASEDIR)/bin"
+	cp -r lib modules exampleconf nadeshiko.sh nadeshiko-mpv.sh nadeshiko-do-postponed.sh "$(BASEDIR)/share/nadeshiko"
+	ln -sf "$(PREFIX)/share/nadeshiko/nadeshiko.sh" "$(BASEDIR)/bin/nadeshiko"
+	ln -sf "$(PREFIX)/share/nadeshiko/nadeshiko-mpv.sh" "$(BASEDIR)/bin/nadeshiko-mpv"
+	ln -sf "$(PREFIX)/share/nadeshiko/nadeshiko-do-postponed.sh" "$(BASEDIR)/bin/nadeshiko-do-postponed"
+
+uninstall: __phony
+	rm -rf "$(BASEDIR)/share/nadeshiko"
+	rm -f "$(BASEDIR)/bin/nadeshiko"
+	rm -f "$(BASEDIR)/bin/nadeshiko-mpv"
+	rm -f "$(BASEDIR)/bin/nadeshiko-do-postponed"
+
+__phony:
diff --git a/nadeshiko-do-postponed.sh b/nadeshiko-do-postponed.sh
index c7110f4..92d93de 100755
--- a/nadeshiko-do-postponed.sh
+++ b/nadeshiko-do-postponed.sh
@@ -8,7 +8,7 @@
 
 
 set -feEuT
-. "$(dirname "$0")/lib/bahelite/bahelite.sh"
+. "$(dirname "$(realpath "$0")")/lib/bahelite/bahelite.sh"
 prepare_cachedir 'nadeshiko'
 start_log
 set_libdir 'nadeshiko'
diff --git a/nadeshiko-mpv.sh b/nadeshiko-mpv.sh
index 5c7547c..7ba5ff0 100755
--- a/nadeshiko-mpv.sh
+++ b/nadeshiko-mpv.sh
@@ -8,7 +8,7 @@
 
 set -feEuT
 shopt -s extglob
-. "$(dirname "$0")/lib/bahelite/bahelite.sh"
+. "$(dirname "$(realpath "$0")")/lib/bahelite/bahelite.sh"
 prepare_cachedir 'nadeshiko'
 start_log
 set_libdir 'nadeshiko'
diff --git a/nadeshiko.sh b/nadeshiko.sh
index ad83025..6e759dd 100755
--- a/nadeshiko.sh
+++ b/nadeshiko.sh
@@ -17,7 +17,7 @@
 set -feEuT
 shopt -s extglob
 #  Logging, error handling, messages to console and desktop.
-. "$(dirname "$0")/lib/bahelite/bahelite.sh"
+. "$(dirname "$(realpath "$0")")/lib/bahelite/bahelite.sh"
 prepare_cachedir
 start_log
 set +f