2023-01-27 11:29:28 +00:00
|
|
|
CONFIG_DIR := $(if $(XDG_CONFIG_HOME), $(XDG_CONFIG_HOME), $(HOME)/.config)
|
2023-02-09 08:59:12 +00:00
|
|
|
SSH_DIR := $(HOME)/.ssh
|
2023-03-01 08:10:50 +00:00
|
|
|
THEMES_DIR := $(HOME)/.themes
|
2023-01-27 11:29:28 +00:00
|
|
|
|
|
|
|
CONFIG_ITEMS := $(wildcard config/*)
|
|
|
|
CONFIG_TARGETS := $(CONFIG_ITEMS:config/%=$(CONFIG_DIR)/%)
|
2023-02-09 08:59:12 +00:00
|
|
|
SSH_ITEMS := $(wildcard ssh/*)
|
|
|
|
SSH_TARGETS := $(SSH_ITEMS:ssh/%=$(SSH_DIR)/%)
|
2023-03-01 08:10:50 +00:00
|
|
|
THEMES_ITEMS := $(wildcard themes/*)
|
|
|
|
THEMES_TARGETS := $(THEMES_ITEMS:themes/%=$(THEMES_DIR)/%)
|
2023-01-27 11:29:28 +00:00
|
|
|
|
2023-02-17 09:00:12 +00:00
|
|
|
LAZY_REPO := https://github.com/folke/lazy.nvim.git
|
2023-02-27 10:39:04 +00:00
|
|
|
PYENV_DIR := $(if $(PYENV_ROOT), $(PYENV_ROOT), $(HOME)/.pyenv)
|
2023-02-08 23:54:40 +00:00
|
|
|
|
2023-03-15 07:47:37 +00:00
|
|
|
.PHONY: default all clean check directories link configure install
|
2023-02-09 16:05:24 +00:00
|
|
|
|
2023-03-15 07:47:37 +00:00
|
|
|
default: directories link configure
|
2023-03-01 17:46:07 +00:00
|
|
|
|
2023-03-05 22:16:16 +00:00
|
|
|
all: default install
|
2023-02-10 08:13:48 +00:00
|
|
|
|
2023-03-05 22:16:16 +00:00
|
|
|
clean:
|
2023-01-30 22:30:02 +00:00
|
|
|
for link in $(CONFIG_TARGETS); do rm "$$link"; done
|
2023-02-10 08:13:48 +00:00
|
|
|
for link in $(SSH_TARGETS); do rm "$$link"; done
|
2023-03-01 08:10:50 +00:00
|
|
|
for link in $(THEMES_TARGETS); do rm "$$link"; done
|
2023-03-05 22:16:16 +00:00
|
|
|
rm -rf $(LAZY_DIR)
|
2023-03-15 07:47:37 +00:00
|
|
|
rm $(HOME)/.profile
|
2023-03-18 10:01:46 +00:00
|
|
|
rm $(HOME)/.inputrc
|
2023-03-05 22:16:16 +00:00
|
|
|
rm $(HOME)/.bashrc
|
|
|
|
rm $(HOME)/.zshrc
|
2023-02-10 08:13:48 +00:00
|
|
|
rmdir $(HOME)/.ssh/sockets
|
2023-03-05 22:16:16 +00:00
|
|
|
rm -rf config/nvim/.venv
|
2023-02-09 08:53:40 +00:00
|
|
|
|
2023-03-05 22:16:16 +00:00
|
|
|
check:
|
|
|
|
echo "Placeholder"
|
2023-02-09 08:53:40 +00:00
|
|
|
|
2023-03-15 07:47:37 +00:00
|
|
|
directories: $(CONFIG_DIR) $(SSH_DIR) $(THEMES_DIR) $(HOME)/.ssh/sockets $(HOME)/.local/bin
|
2023-02-09 22:09:51 +00:00
|
|
|
|
2023-03-15 07:47:37 +00:00
|
|
|
$(CONFIG_DIR) $(SSH_DIR) $(THEMES_DIR) $(HOME)/.ssh/sockets $(HOME)/.local/bin:
|
|
|
|
mkdir -p $@
|
|
|
|
|
2023-03-18 10:01:46 +00:00
|
|
|
link: $(CONFIG_TARGETS) $(SSH_TARGETS) $(THEMES_TARGETS) $(HOME)/.profile $(HOME)/.inputrc $(HOME)/.bashrc $(HOME)/.zshrc
|
2023-03-04 09:08:14 +00:00
|
|
|
|
2023-01-27 11:29:28 +00:00
|
|
|
$(CONFIG_TARGETS): $(CONFIG_DIR)/%: config/%
|
2023-02-09 08:59:12 +00:00
|
|
|
$(SSH_TARGETS): $(SSH_DIR)/%: ssh/%
|
2023-03-01 08:10:50 +00:00
|
|
|
$(THEMES_TARGETS): $(THEMES_DIR)/%: themes/%
|
2023-03-15 07:47:37 +00:00
|
|
|
$(HOME)/.profile: $(HOME)/%: %
|
2023-03-18 10:01:46 +00:00
|
|
|
$(HOME)/.inputrc: $(HOME)/%: %
|
2023-03-01 17:18:35 +00:00
|
|
|
$(HOME)/.bashrc: $(HOME)/%: %
|
2023-03-04 09:08:14 +00:00
|
|
|
$(HOME)/.zshrc: $(HOME)/%: %
|
2023-03-18 10:01:46 +00:00
|
|
|
$(CONFIG_TARGETS) $(SSH_TARGETS) $(THEMES_TARGETS) $(HOME)/.profile $(HOME)/.inputrc $(HOME)/.bashrc $(HOME)/.zshrc:
|
2023-03-04 09:08:14 +00:00
|
|
|
ln -s $(PWD)/$? $@
|
2023-02-25 08:46:56 +00:00
|
|
|
|
2023-03-15 07:47:37 +00:00
|
|
|
configure: config/git/user_email config/nvim/.venv
|
|
|
|
|
|
|
|
config/git/user_email:
|
|
|
|
echo "Missing user_email; Add your email to $$(readlink -f config/git)/user_email"
|
2023-02-17 09:00:12 +00:00
|
|
|
|
2023-03-02 16:08:39 +00:00
|
|
|
config/nvim/.venv:
|
|
|
|
python3 -m venv $@
|
|
|
|
$@/bin/python3 -m pip install -U pip wheel
|
|
|
|
$@/bin/python3 -m pip install --use-pep517 pynvim
|
|
|
|
|
2023-03-15 07:47:37 +00:00
|
|
|
install: $(LAZY_DIR)
|
|
|
|
command -v direnv > /dev/null || bin_path=$(HOME)/.local/bin bash packages/direnv.sh
|
|
|
|
command -v pipx > /dev/null || bash packages/pipx.sh
|
|
|
|
command -v poetry > /dev/null || python3 packages/poetry.py
|
|
|
|
command -v pyenv > /dev/null || bash packages/pyenv.sh
|
2023-03-15 08:11:32 +00:00
|
|
|
command -v starship > /dev/null || sh packages/starship.sh -b $(HOME)/.local/bin
|
2023-03-02 16:08:39 +00:00
|
|
|
|
2023-03-15 07:47:37 +00:00
|
|
|
$(LAZY_DIR):
|
|
|
|
git clone --depth 1 $(LAZY_REPO) $@
|