ifndef HOME $(error "$$HOME" must be defined) endif DOTFILES := $(shell find dot \( -type f -o -type l \) -not -name '.*') DESTINATIONS = $(DOTFILES:dot/%=${HOME}/.%) ${HOME}/.gitconfig: ./src/gitconfig.sh EXECUTABLES = $(filter dot/local/bin/%, $(DOTFILES)) $(HOME)/.%: dot/% install -D -m $(if $(filter $<, $(EXECUTABLES)), 0755, 0644) $< $@ install: $(DESTINATIONS)