dotfiles/Makefile

43 lines
1.3 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)
LOCAL_BG_SOURCES := $(shell git ls-files local/share/backgrounds)
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)) \
$(patsubst %,$(HOME)/.%,$(LOCAL_BG_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 $(HOME)/.local/share/backgrounds $(TARGETS)
2017-12-16 02:56:55 +00:00
$(HOME)/.config:
mkdir -p $@
$(HOME)/.local/bin:
mkdir -p $@
$(HOME)/.local/share/backgrounds:
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
2023-02-28 21:45:37 +00:00
$(SUDO) install -m 0755 -v udev/handle-trackman-marble $@
2023-01-23 15:48:07 +00:00
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)