20 lines
477 B
Makefile
20 lines
477 B
Makefile
TOP_SOURCES := $(git ls-files | grep -vE 'README|Makefile|^config|^\.git|^\.travis' | grep -v /)
|
|
CONFIG_SOURCES := $(shell git ls-files config)
|
|
TARGETS := \
|
|
$(patsubst %,$(HOME)/.%,$(TOP_SOURCES)) \
|
|
$(patsubst %,$(HOME)/.%,$(CONFIG_SOURCES))
|
|
|
|
$(HOME)/.%: %
|
|
$(RM) '$@' && mkdir -p $(dir $@) && ln -svf '$(PWD)/$^' '$@'
|
|
|
|
.PHONY: all
|
|
all: $(HOME)/.config $(TARGETS)
|
|
|
|
$(HOME)/.config:
|
|
mkdir -p $@
|
|
|
|
.PHONY: echo
|
|
echo:
|
|
@echo TOP_SOURCES=$(TOP_SOURCES)
|
|
@echo TARGETS=$(TARGETS)
|