summaryrefslogtreecommitdiff
path: root/.config/Makefile
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2017-11-08 14:10:38 -0500
committerLuke Shumaker <lukeshu@lukeshu.com>2017-11-08 14:19:12 -0500
commit65a5662ffb11e76b68f81ee24c37d74e49bd0d98 (patch)
tree30328ca34c875f595a33f6d94065327c15e311de /.config/Makefile
parentc5c39eb8c02c040f077b8a43999e88af40790a42 (diff)
Revamp mail filtering and organization
Diffstat (limited to '.config/Makefile')
-rw-r--r--.config/Makefile16
1 files changed, 14 insertions, 2 deletions
diff --git a/.config/Makefile b/.config/Makefile
index 4e8166e..62c639e 100644
--- a/.config/Makefile
+++ b/.config/Makefile
@@ -21,8 +21,20 @@ clean:
rm -f -- $(targets)
.PHONY: all clean
-${HOME}/.folders: ${HOME}/Maildir $(MAKEFILE_LIST)
- find -L $< -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 -r0 dirname -z -- | sort -zu | xargs -0 printf -- '.%s\n' > '$@'
+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@^\./@/@' ) > $@