Adjust Makefile to better use installer scripts

This commit is contained in:
Evie Litherland-Smith 2023-03-05 22:16:16 +00:00
parent 10a19e26bc
commit 0324e46c1b

View file

@ -10,35 +10,33 @@ THEMES_ITEMS := $(wildcard themes/*)
THEMES_TARGETS := $(THEMES_ITEMS:themes/%=$(THEMES_DIR)/%) THEMES_TARGETS := $(THEMES_ITEMS:themes/%=$(THEMES_DIR)/%)
LAZY_REPO := https://github.com/folke/lazy.nvim.git LAZY_REPO := https://github.com/folke/lazy.nvim.git
LAZY_DIR := $(HOME)/.local/share/nvim/lazy/lazy.nvim
PYENV_DIR := $(if $(PYENV_ROOT), $(PYENV_ROOT), $(HOME)/.pyenv) PYENV_DIR := $(if $(PYENV_ROOT), $(PYENV_ROOT), $(HOME)/.pyenv)
POETRY_DIR := $(HOME)/.local/share/pypoetry
.PHONY: all clean check link unlink install uninstall pacman .PHONY: default all clean check install
all: link install config/git/user_email default: $(CONFIG_TARGETS) $(SSH_TARGETS) $(THEMES_TARGETS) $(LAZY_DIR) $(HOME)/.bashrc $(HOME)/.zshrc $(HOME)/.ssh/sockets config/nvim/.venv config/git/user_email
clean: unlink uninstall all: default install
clean:
for link in $(CONFIG_TARGETS); do rm "$$link"; done
for link in $(SSH_TARGETS); do rm "$$link"; done
for link in $(THEMES_TARGETS); do rm "$$link"; done
rm -rf $(LAZY_DIR)
rm $(HOME)/.bashrc
rm $(HOME)/.zshrc
rmdir $(HOME)/.ssh/sockets
rm -rf config/nvim/.venv
check: check:
echo "Placeholder" echo "Placeholder"
link: $(CONFIG_TARGETS) $(SSH_TARGETS) $(THEMES_TARGETS) $(HOME)/.bashrc $(HOME)/.zshrc $(HOME)/.ssh/sockets install:
command -v direnv > /dev/null || bash packages/direnv.sh
unlink: command -v pipx > /dev/null || bash packages/pipx.sh
for link in $(CONFIG_TARGETS); do rm "$$link"; done command -v poetry > /dev/null || python3 packages/poetry.py
for link in $(SSH_TARGETS); do rm "$$link"; done command -v pyenv > /dev/null || bash packages/pyenv.sh
for link in $(THEMES_TARGETS); do rm "$$link"; done command -v starship > /dev/null || bash packages/starship.sh
rmdir $(HOME)/.ssh/sockets
install: $(LAZY_DIR) $(PYENV_DIR) $(POETRY_DIR) config/nvim/.venv
uninstall:
rm -rf $(LAZY_DIR)
rm -rf $(PYENV_DIR)
rm -rf $(POETRY_DIR)
rm -rf config/nvim/.venv
config/git/user_email: config/git/user_email:
echo "Missing user_email; Add your email to $$(readlink -f config/git)/user_email" echo "Missing user_email; Add your email to $$(readlink -f config/git)/user_email"
@ -54,12 +52,6 @@ $(CONFIG_TARGETS) $(SSH_TARGETS) $(THEMES_TARGETS) $(HOME)/.bashrc $(HOME)/.zshr
$(LAZY_DIR): $(LAZY_DIR):
git clone --depth 1 $(LAZY_REPO) $@ git clone --depth 1 $(LAZY_REPO) $@
$(PYENV_DIR):
command -v pyenv > /dev/null || bash packages/pyenv.sh
$(POETRY_DIR):
command -v poetry > /dev/null || python3 packages/poetry.py
config/nvim/.venv: config/nvim/.venv:
python3 -m venv $@ python3 -m venv $@
$@/bin/python3 -m pip install -U pip wheel $@/bin/python3 -m pip install -U pip wheel