.POSIX: DEST ?= $(HOME) DEST := $(abspath $(DEST)) LN = ln -vs #--- all: help ## Display this message help: printhelp ### TEMPLATES ## Install base configurations for any machine base: bash lf nvim scripts tmux wget ## Install configurations for any desktop desktop-base: base mpd ncmpcpp user-dirs xdg-desktop-portal ## Install configurations for a Sway desktop desktop-sway: Xresources desktop-base fontconfig foot fuzzel kanshi lf mako nsxiv ### CONFIGURATIONS ##: Xresources: $(DEST)/.config/Xresources bash: $(DEST)/.bash_profile $(DEST)/.bashrc fontconfig: $(DEST)/.config/fontconfig foot: $(DEST)/.config/foot fuzzel: $(DEST)/.config/fuzzel kanshi: $(DEST)/.config/kanshi lf: $(DEST)/.config/lf mako: $(DEST)/.config/mako mpd: $(DEST)/.config/mpd ncmpcpp: $(DEST)/.config/ncmpcpp nsxiv: $(DEST)/.config/nsxiv nvim: $(DEST)/.config/nvim scripts: $(DEST)/.local/bin $(DEST)/.config/fzy-bookmark $(DEST)/.config/fzy-tmux-project sway: $(DEST)/.config/sway tmux: $(DEST)/.config/tmux user-dirs: $(DEST)/.config/user-dirs.dirs wget: $(DEST)/.config/wget xdg-desktop-portal: $(DEST)/.config/xdg-desktop-portal #--- $(DEST)/%: $(LN) `realpath --relative-to=$(dir $@) $(subst $(DEST)/,,$@)` $@ printhelp: @awk ' \ /^### / \ { printf "%s:\n", substr($$0, 5); next } \ /^##:/ \ { c=" "; next } \ /^$$/ \ { c=0; next } \ /^## / \ { if (c) { print c }; c=substr($$0, 4); next } \ c && /(^[[:alpha:]][[:alnum:]_-]+: .*$$)/ \ { printf "%s", $$1; if (c == " ") { $$1=""; printf "%s", gensub("[$$].DEST./", "", "g", substr($$0, 2)) } else { printf "%s", c }; printf "\n" } \ ' $(MAKEFILE_LIST) | column -ts: .PHONY: all help printhelp