dotfiles/Makefile

38 lines
1.1 KiB
Makefile
Raw Normal View History

2023-01-23 15:48:07 +00:00
SUDO ?= sudo
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)) \
2023-01-23 15:48:07 +00:00
$(HOME)/.config/i3/config \
/etc/udev/rules.d/90-trackman-marble.rules \
/usr/local/bin/handle-trackman-marble
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 $@
2023-01-23 15:48:07 +00:00
/etc/udev/rules.d/90-trackman-marble.rules: udev/rules.d/90-trackman-marble.rules
$(SUDO) install -m 0644 -v udev/rules.d/90-trackman-marble.rules $@
/usr/local/bin/handle-trackman-marble: udev/handle-trackman-marble
$(SUDO) install -m 0644 -v udev/handle-trackman-marble $@
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)