dotfiles/Makefile

28 lines
753 B
Makefile
Raw Normal View History

2018-08-17 13:55:18 +00:00
TOP_SOURCES := $(shell git ls-files | grep -vE 'README|Makefile|^config|^\.git|^\.travis' | grep -v /)
2017-12-16 02:56:55 +00:00
CONFIG_SOURCES := $(shell git ls-files config)
LOCAL_BIN_SOURCES := $(shell git ls-files local/bin)
2017-12-16 02:56:55 +00:00
TARGETS := \
$(patsubst %,$(HOME)/.%,$(TOP_SOURCES)) \
2019-01-03 15:59:01 +00:00
$(patsubst %,$(HOME)/.%,$(CONFIG_SOURCES)) \
$(patsubst %,$(HOME)/.%,$(LOCAL_BIN_SOURCES)) \
2019-01-03 15:59:01 +00:00
$(HOME)/.config/i3/config
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
all: $(HOME)/.config $(HOME)/.local/bin $(TARGETS)
2017-12-16 02:56:55 +00:00
$(HOME)/.config:
mkdir -p $@
$(HOME)/.local/bin:
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)
2019-01-03 15:59:01 +00:00
@echo CONFIG_SOURCES=$(CONFIG_SOURCES)
@echo LOCAL_BIN_SOURCES=$(LOCAL_BIN_SOURCES)
@echo TARGETS=$(TARGETS)