blob: 33e1cac1e1b372812c702cabc3e915531c5148df (
plain) (
blame)
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
|
.POSIX:
pod2man = \
share/man/man1/x.1 \
share/man/man1/z.1 \
lisp-images = \
$(XDG_DATA_HOME)/lisp-cli/clozure.image \
$(XDG_DATA_HOME)/lisp-cli/clisp.image \
$(XDG_DATA_HOME)/lisp-cli/sbcl.image \
derived-assets = \
$(pod2man) \
$(XDG_CONFIG_HOME)/ssh/id_rsa.pub \
$(XDG_CONFIG_HOME)/git/config-extra \
$(XDG_CONFIG_HOME)/gnupg/gpg-agent.conf \
$(XDG_CONFIG_HOME)/remhind/config \
$(XDG_CONFIG_HOME)/ssh/config \
$(XDG_CONFIG_HOME)/alot/config \
$(XDG_CONFIG_HOME)/mbsync/config \
$(XDG_CONFIG_HOME)/msmtp/config \
$(XDG_CONFIG_HOME)/notmuch/default/config \
$(XDG_CONFIG_HOME)/notmuch/default/hooks/post-new \
$(XDG_DATA_HOME)/common-lisp/source \
$(XDG_DATA_HOME)/euandreh/e.list.txt \
$(lisp-images)
all: $(derived-assets)
share/man/man1/x.1: bin/x
pod2man bin/x > $@
share/man/man1/z.1: bin/z
pod2man bin/z > $@
$(XDG_DATA_HOME)/common-lisp/source:
ln -s $(SRC)/libre $@
$(XDG_CONFIG_HOME)/alot/config: bin/mailcfg
mailcfg alot > $@
$(XDG_CONFIG_HOME)/mbsync/config: bin/mailcfg
mailcfg mbsync > $@
$(XDG_CONFIG_HOME)/msmtp/config: bin/mailcfg
mailcfg msmtp > $@
$(XDG_CONFIG_HOME)/notmuch/default/config: bin/mailcfg
mailcfg notmuchcfg > $@
$(XDG_CONFIG_HOME)/notmuch/default/hooks/post-new: bin/mailcfg
mailcfg notmuchhook > $@
chmod +x $@
$(XDG_CONFIG_HOME)/ssh/id_rsa.pub:
gpg --export-ssh-key eu@euandre.org > $@
chmod 600 $@
$(XDG_CONFIG_HOME)/remhind/config: $(XDG_CONFIG_HOME)/remhind/config.tmpl
envsubst < $(XDG_CONFIG_HOME)/remhind/config.tmpl > $@
$(XDG_CONFIG_HOME)/ssh/config: $(XDG_CONFIG_HOME)/ssh/config.tmpl
envsubst < $(XDG_CONFIG_HOME)/ssh/config.tmpl > $@
$(XDG_CONFIG_HOME)/git/config-extra:
printf '[sendemail]\n smtpserver = ' > $@
command -v msmtpq >> $@
$(XDG_CONFIG_HOME)/gnupg/gpg-agent.conf: $(XDG_CONFIG_HOME)/gnupg/gpg-agent.conf.tmpl
cp $(XDG_CONFIG_HOME)/gnupg/gpg-agent.conf.tmpl $@
printf 'pinentry-program ' >> $@
command -v pinentry-gtk-2 >> $@
$(XDG_DATA_HOME)/euandreh/e.list.txt: ~/Documents/txt/ opt/aux/gen-e-list.sh
sh opt/aux/gen-e-list.sh > $@
$(lisp-images): $(XDG_CONFIG_HOME)/lisp-cli/init.lisp bin/cl bin/li
I=`echo $@ | awk -F/ '$$0=$$(NF)' | cut -d. -f1` && \
li -vI $$I -E "(format t \"Image for \\\"$$I\\\" created.~%\")"
check-shellcheck:
git ls-files | \
xargs awk '/^#!\/bin\/sh$$/ { print FILENAME } { nextfile }' | \
xargs shellcheck -x
check-perlcritic:
git ls-files | \
xargs awk '/^#!\/usr\/bin\/env perl$$/ { print FILENAME } { nextfile }' | \
xargs perlcritic --exclude=subroutine
FIXME-excludes = \
':(exclude)Makefile' \
':(exclude)etc/git/ignore' \
':(exclude)opt/aux/gen-e-list.sh'
check-fixme:
if git grep FIXME -- $(FIXME-excludes); then \
printf 'Leftover FIXME markers.\n' >&2; \
exit 1; \
fi
check-dirty-public:
if ! git diff --quiet || ! git diff --quiet --staged; then \
printf 'Dirty tilde repository.\n' >&2; \
exit 1; \
fi
check-dirty-private:
if ! git -C $(PRIV_CONFIG) diff --quiet || \
! git -C $(PRIV_CONFIG) diff --quiet --staged; then \
printf 'Dirty private tilde repository.\n' >&2; \
exit 1; \
fi
check-opt:
find opt/tests/ -name '*.sh' -exec {} +
check-pod:
podchecker bin/z
check-sync:
if git status --short --branch --porcelain | head -n1 | grep -E '(ahead|behind)'; then \
printf 'Out of sync with origin.\n' >&2; \
exit 1; \
fi
check: check-shellcheck check-perlcritic check-fixme check-dirty-public \
check-dirty-private check-opt check-pod check-sync
clean:
rm -f $(derived-assets)
|