SHELL = /bin/bash NANO_BIN_PREFIX = $(patsubst %/bin/nano,%,$(shell which nano)) NANO_CHECK = $(HOME)/.prefix:$(HOME):/usr/local:/usr:$(NANO_BIN_PREFIX) NANO_SHARE = $(firstword $(wildcard $(addsuffix /share/nano,$(subst :, ,$(NANO_CHECK))))) targets=.nanorc .folders .crontab.cookie .git.info.exclude all: $(targets) clean: rm -f $(targets) .nanorc: .nanorc.in $(NANO_SHARE) cat '$<' > '$@' for file in $(NANO_SHARE)/*.nanorc; do echo "include \"$$file\""; done >> '$@' .folders: Maildir ( echo '..'; find ~/Maildir -maxdepth 2 -type f -name "maildirfolder" -printf '%h\n'|sed -r 's@.*/(.*\.)(.*)@.\1\2@' )|sort>'$@' .git.info.exclude: .git.info.exclude.in . ( cat $<; find . -type f -name 'CACHEDIR.TAG' -printf '%h\n'|sed 's@^\./@/@' ) > $@ .crontab.cookie: .crontab .crontab.local -(cat $^; echo) | crontab - 2>/dev/null date > '$@' # don't do anything, just create these if they doesn't exist .crontab.local: touch '$@' Maildir: mkdir -p '$@'/{cur,new,tmp} Maildir/%: | Maildir mkdir -p '$@'/{cur,new,tmp} touch '$@'/maildirfolder .PHONY: FORCE PHONY FORCE: ; PHONY: ;