blob: 62c639e5c8bfc3d65b6458df4654d590a85d188f (
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
|
#!/usr/bin/make -f
ifeq ($(XDG_CACHE_HOME),)
default: all; @:
%:
. ~/.profile && $(MAKE) '$@'
else
SHELL = /bin/bash -o pipefail
GIT_DIR = ${HOME}/.git
STATEDIR = ${XDG_CACHE_HOME}/config
targets = \
${GIT_DIR}/info/exclude \
${STATEDIR}/symlinks.stamp \
$(if $(shell crontab -l),${STATEDIR}/crontab.stamp) \
$(if $(wildcard ${HOME}/Maildir),${HOME}/.folders) \
$(if $(wildcard ${XDG_CONFIG_HOME}/dconf/user),${XDG_CONFIG_HOME}/dconf/user.txt)
all: $(targets)
clean:
rm -f -- $(targets)
.PHONY: all clean
ifneq ($(wildcard ${HOME}/Maildir),)
MAILDIRS = .
-include ${STATEDIR}/maildirs.mk
${HOME}/.folders: $(addprefix ${HOME}/Maildir/,${MAILDIRS})
find -L $< \( -false \
-o -type f -name maildirfolder \
-o -type d -name new \
-o -type d -name tmp \
-o -type d -name cur \
\) -printf '%P\0' | xargs -r0 dirname -z -- | sort -zu | xargs -0 printf -- '.%s\n' > '$@'
${STATEDIR}/maildirs.mk: ${HOME}/.folders
< $< sed -n 's/^\.//p' | xargs -d $$'\n' -r dirname -- | sort -u | xargs -d $$'\n' -r printf 'MAILDIRS += %s\n' > $@
endif
${GIT_DIR}/info/exclude: ${HOME}/.git.info.exclude.in $(shell echo .??*/)
( cat $<; find $^ -type f -name 'CACHEDIR.TAG' -printf '%h\n'|sed 's@^\./@/@' ) > $@
${XDG_CONFIG_HOME}/dconf/user.txt: ${XDG_CONFIG_HOME}/dconf/user
dconf dump / > $@
${STATEDIR}/crontab.stamp: ${XDG_CONFIG_HOME}/cron
-(cat $^/*; echo) | crontab - 2>/dev/null
mkdir -p '$(@D)'
date > '$@'
${STATEDIR}/symlinks.stamp: ${XDG_CONFIG_HOME}/symlinks
config-symlinks
mkdir -p '$(@D)'
date > '$@'
${HOME}/Maildir/%: | ${HOME}/Maildir
mkdir -p '$@'/{cur,new,tmp}
touch '$@'/maildirfolder
.DELETE_ON_ERROR:
.SECONDARY:
endif
|