From 439b660c58fe1b7c95abd481f49661f71e6d74e8 Mon Sep 17 00:00:00 2001 From: frosty Date: Fri, 4 Jul 2025 07:07:12 -0400 Subject: add Makefile --- Makefile | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..e6dd641 --- /dev/null +++ b/Makefile @@ -0,0 +1,66 @@ +.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 -- cgit v1.2.3