[ADD] Teach Makefile how to unlink stow packages

To ease the addition and removal of packages, some rules were added to
deal with those specially.

I still need to figure out how to stop repeating myself when linking and
unlinking unconventional packages (such as `scripts`).
This commit is contained in:
Bruno BELANYI 2019-10-29 16:30:30 +01:00
parent 8bedc06072
commit d79a86e8bd

View file

@ -82,13 +82,13 @@ all: install
# Install packages and their dependencies
.PHONY: install-cli
install-cli: install-cli-deps
install-cli: $(addprefix stow-,$(CLI_PACKAGES))
install-cli: link-cli
install-cli: rust
.PHONY: install
install: install-cli
install: install-visual-deps
install: $(addprefix stow-,$(VISUAL_PACKAGES))
install: link-visual
.PHONY: install-cli-deps
install-cli-deps:
@ -98,6 +98,13 @@ install-cli-deps:
install-visual-deps:
yay -S $(VISUAL_DEPENDENCIES)
# Linking packages
.PHONY: link-cli
link-cli: $(addprefix stow-,$(CLI_PACKAGES))
.PHONY: link-visual
link-visual: $(addprefix stow-,$(VISUAL_PACKAGES))
# Installing configuration packages
stow-%: %
$(STOW) $<
@ -111,6 +118,20 @@ stow-vim: vim
$(STOW) $<
vim +PlugInstall
# Removing packages
unlink: unlink-cli unlink-visual
unlink-cli: $(addprefix unstow-,$(CLI_PACKAGES))
unlink-visual: $(addprefix unstow-,$(VISUAL_PACKAGES))
unstow-%:
$(STOW) -D $*
unstow-scripts: STOW_TARGET=~/.scripts
unstow-scripts:
$(STOW) -D scripts
# Development related installations
.PHONY: rust
rust: