summaryrefslogtreecommitdiff
path: root/.config/Makefile
blob: dd4c37f1cddda4527d35035211e2dcc1b6c5206b (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
#!/usr/bin/make -f

SHELL = /bin/bash

GITDIR = ${HOME}/.git

targets = \
	${GITDIR}/info/exclude \
	${HOME}/.folders \
	${XDG_CACHE_HOME}/config-symlinks/cookie \
	${XDG_CACHE_HOME}/cron/cookie

all: $(targets)
clean:
	rm -f $(targets)

${HOME}/.folders: ${HOME}/Maildir $(MAKEFILE_LIST)
	find $< -mindepth 2 -maxdepth 2 \( -type f -name "maildirfolder" -o -type d -name new -o -type d -name tmp -o -type d -name cur \) -printf '%P\0' | xargs -0 dirname -z -- | sort -zu | xargs -0 printf '.%s\n' >'$@'
${GITDIR}/info/exclude: ${HOME}/.git.info.exclude.in $(shell echo .??*/)
	( cat $<; find $^ -type f -name 'CACHEDIR.TAG' -printf '%h\n'|sed 's@^\./@/@' ) > $@

${XDG_CACHE_HOME}/cron/cookie: ${XDG_CONFIG_HOME}/cron
	-(cat $^/*; echo) | crontab - 2>/dev/null
	mkdir -p '$(@D)'
	date > '$@'

${XDG_CACHE_HOME}/config-symlinks/cookie: ${XDG_CONFIG_HOME}/symlinks
	config-symlinks
	mkdir -p '$(@D)'
	date > '$@'

${HOME}/Maildir:
	mkdir -p '$@'/{cur,new,tmp}
${HOME}/Maildir/%: | ${HOME}/Maildir
	mkdir -p '$@'/{cur,new,tmp}
	touch '$@'/maildirfolder

.PHONY: FORCE PHONY
FORCE: ; 
PHONY: ;