SOURCES := $(shell ls | grep -E -v 'README|Makefile') TARGETS := $(patsubst %,$(HOME)/.%,$(SOURCES)) $(HOME)/.%: % if [[ ! -e '$@' ]] ; then ln -sv '$(PWD)/$^' '$@' ; fi .PHONY: all all: $(TARGETS) .PHONY: echo echo: @echo SOURCES=$(SOURCES) @echo TARGETS=$(TARGETS)