2023-01-27 11:29:28 +00:00
|
|
|
LOCAL_BIN := $(HOME)/.local/bin
|
|
|
|
CONFIG_DIR := $(if $(XDG_CONFIG_HOME), $(XDG_CONFIG_HOME), $(HOME)/.config)
|
|
|
|
FONT_DIR := $(HOME)/.local/share/fonts
|
|
|
|
ZSH_DIR := $(if $(ZSH), $(ZSH), $(HOME)/.oh-my-zsh)
|
2023-01-28 18:57:46 +00:00
|
|
|
ZSH_CUSTOM_DIR := $(if $(ZSH_CUSTOM), $(ZSH_CUSTOM), $(ZSH_DIR)/custom)
|
2023-02-09 08:59:12 +00:00
|
|
|
SSH_DIR := $(HOME)/.ssh
|
2023-01-27 11:29:28 +00:00
|
|
|
|
2023-02-09 08:53:40 +00:00
|
|
|
HOME_ITEMS := $(wildcard home/*)
|
|
|
|
HOME_TARGETS := $(HOME_ITEMS:home/%=$(HOME)/.%)
|
2023-01-27 11:29:28 +00:00
|
|
|
CONFIG_ITEMS := $(wildcard config/*)
|
|
|
|
CONFIG_TARGETS := $(CONFIG_ITEMS:config/%=$(CONFIG_DIR)/%)
|
2023-02-01 09:39:52 +00:00
|
|
|
ZSH_ITEMS := $(wildcard ohmyzsh/*.zsh)
|
|
|
|
ZSH_TARGETS := $(ZSH_ITEMS:ohmyzsh/%.zsh=$(ZSH_CUSTOM_DIR)/%.zsh)
|
2023-02-09 08:59:12 +00:00
|
|
|
SSH_ITEMS := $(wildcard ssh/*)
|
|
|
|
SSH_TARGETS := $(SSH_ITEMS:ssh/%=$(SSH_DIR)/%)
|
2023-01-27 11:29:28 +00:00
|
|
|
|
|
|
|
PACKER_REPO := https://github.com/wbthomason/packer.nvim
|
|
|
|
PACKER_DIR := $(HOME)/.local/share/nvim/site/pack/packer/start/packer.nvim
|
|
|
|
POWERLEVEL_REPO := https://github.com/romkatv/powerlevel10k.git
|
|
|
|
POWERLEVEL_DIR := $(ZSH_CUSTOM_DIR)/themes/powerlevel10k
|
|
|
|
|
2023-02-09 08:53:40 +00:00
|
|
|
.PHONY := install clean home packages config zsh ssh nvim
|
2023-02-08 23:54:40 +00:00
|
|
|
|
2023-02-09 08:53:40 +00:00
|
|
|
install: home packages config zsh ssh nvim
|
2023-02-08 23:54:40 +00:00
|
|
|
|
2023-01-27 11:29:28 +00:00
|
|
|
clean:
|
2023-02-09 08:53:40 +00:00
|
|
|
for link in $(HOME_TARGETS); do rm "$$link"; done
|
2023-01-30 22:30:02 +00:00
|
|
|
for link in $(CONFIG_TARGETS); do rm "$$link"; done
|
2023-01-31 16:13:07 +00:00
|
|
|
rm $(HOME)/.ssh/config
|
2023-01-31 16:16:51 +00:00
|
|
|
rm -rf $(PACKER_DIR)
|
2023-02-09 08:53:40 +00:00
|
|
|
rm -rf $(ZSH_DIR)
|
|
|
|
|
|
|
|
home: $(HOME_TARGETS)
|
2023-01-27 11:29:28 +00:00
|
|
|
|
2023-02-09 08:53:40 +00:00
|
|
|
packages:
|
|
|
|
pacman -T - < pkglist.txt || sudo pacman --needed -S - < pkglist.txt
|
|
|
|
|
|
|
|
config: $(CONFIG_TARGETS)
|
|
|
|
|
|
|
|
zsh: $(ZSH_DIR) $(POWERLEVEL_DIR) $(ZSH_TARGETS)
|
2023-01-27 19:36:54 +00:00
|
|
|
|
2023-02-09 08:59:12 +00:00
|
|
|
ssh: $(SSH_TARGETS) $(HOME)/.ssh/sockets
|
2023-01-30 10:31:06 +00:00
|
|
|
|
2023-02-02 10:20:40 +00:00
|
|
|
nvim: $(PACKER_DIR)
|
2023-02-01 07:49:12 +00:00
|
|
|
|
2023-02-09 08:53:40 +00:00
|
|
|
$(HOME_TARGETS): $(HOME)/.%: home/%
|
2023-01-27 11:29:28 +00:00
|
|
|
$(CONFIG_TARGETS): $(CONFIG_DIR)/%: config/%
|
2023-02-01 09:39:52 +00:00
|
|
|
$(ZSH_TARGETS): $(ZSH_CUSTOM_DIR)/%.zsh: ohmyzsh/%.zsh
|
2023-02-09 08:59:12 +00:00
|
|
|
$(SSH_TARGETS): $(SSH_DIR)/%: ssh/%
|
|
|
|
$(HOME_TARGETS) $(CONFIG_TARGETS) $(ZSH_TARGETS) $(SSH_TARGETS):
|
|
|
|
ln -s $(PWD)/$? $$(dirname $@)
|
2023-01-27 11:29:28 +00:00
|
|
|
|
2023-02-02 10:20:40 +00:00
|
|
|
$(PACKER_DIR):
|
|
|
|
git clone --depth 1 $(PACKER_REPO) $@
|
|
|
|
|
2023-01-27 11:29:28 +00:00
|
|
|
$(ZSH_DIR):
|
2023-01-28 18:57:46 +00:00
|
|
|
sh -c "$$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
|
2023-01-27 11:29:28 +00:00
|
|
|
|
2023-02-09 08:53:40 +00:00
|
|
|
$(POWERLEVEL_DIR): $(ZSH_DIR)
|
2023-01-27 11:29:28 +00:00
|
|
|
git clone --depth 1 $(POWERLEVEL_REPO) $@
|
|
|
|
|
2023-02-09 08:59:12 +00:00
|
|
|
$(LOCAL_BIN) $(CONFIG_DIR) $(FONT_DIR) $(SSH_DIR) $(HOME)/.ssh/sockets:
|
2023-01-27 11:29:28 +00:00
|
|
|
mkdir -p $@
|