Adjust Makefile to better use installer scripts
This commit is contained in:
parent
10a19e26bc
commit
0324e46c1b
46
Makefile
46
Makefile
|
@ -10,35 +10,33 @@ THEMES_ITEMS := $(wildcard themes/*)
|
|||
THEMES_TARGETS := $(THEMES_ITEMS:themes/%=$(THEMES_DIR)/%)
|
||||
|
||||
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)
|
||||
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:
|
||||
echo "Placeholder"
|
||||
|
||||
link: $(CONFIG_TARGETS) $(SSH_TARGETS) $(THEMES_TARGETS) $(HOME)/.bashrc $(HOME)/.zshrc $(HOME)/.ssh/sockets
|
||||
|
||||
unlink:
|
||||
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
|
||||
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
|
||||
install:
|
||||
command -v direnv > /dev/null || 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
|
||||
command -v starship > /dev/null || bash packages/starship.sh
|
||||
|
||||
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):
|
||||
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:
|
||||
python3 -m venv $@
|
||||
$@/bin/python3 -m pip install -U pip wheel
|
||||
|
|
Loading…
Reference in a new issue