dotfiles/Makefile

20 lines
477 B
Makefile
Raw Normal View History

2017-12-16 02:56:55 +00:00
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))
2012-04-10 04:02:46 +00:00
$(HOME)/.%: %
2017-12-16 02:56:55 +00:00
$(RM) '$@' && mkdir -p $(dir $@) && ln -svf '$(PWD)/$^' '$@'
2014-10-01 02:27:46 +00:00
.PHONY: all
2017-12-16 02:56:55 +00:00
all: $(HOME)/.config $(TARGETS)
$(HOME)/.config:
mkdir -p $@
2014-10-01 02:27:46 +00:00
.PHONY: echo
echo:
2017-12-16 02:56:55 +00:00
@echo TOP_SOURCES=$(TOP_SOURCES)
@echo TARGETS=$(TARGETS)