diff options
author | frosty <passedgoandgot200@disroot.org> | 2025-07-04 07:07:12 -0400 |
---|---|---|
committer | frosty <passedgoandgot200@disroot.org> | 2025-07-04 07:07:12 -0400 |
commit | 439b660c58fe1b7c95abd481f49661f71e6d74e8 (patch) | |
tree | c83a53ca19340b414a006a67477c007bcf391c89 | |
parent | 0a70b07e4bb0d22d8762697ff863cf87179f9731 (diff) | |
download | dotfiles-439b660c58fe1b7c95abd481f49661f71e6d74e8.tar.gz dotfiles-439b660c58fe1b7c95abd481f49661f71e6d74e8.zip |
add Makefile
-rw-r--r-- | Makefile | 66 |
1 files changed, 66 insertions, 0 deletions
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 |