From edd95910d459fffbc3da0431487790041caf51a7 Mon Sep 17 00:00:00 2001 From: Alex Karle Date: Mon, 21 Feb 2022 19:44:49 -0500 Subject: [PATCH] make: Add `install` recipe for easy setup It doesn't clear out any old symlinks, so it won't help migrate from old systems to new systems, but it'll help on purely new installs! --- Makefile | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 48e268d..30f49d4 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,24 @@ -# Makefile -- to compile binary config files +# Makefile -- to compile and install dotfiles +ALL = .cwmrc .exrc .gitconfig .mbsyncrc .shrc .tmux.conf .xsession \ + .mailcap .muttrc .config/nvim .mblaze + +# CURDIR is gmake, .CURDIR is bmake. One will exist! +DOTS = $(CURDIR)$(.CURDIR) + +.PHONY: build +build: .mblaze/mless + .mblaze/mless: .mblaze/mless.in lesskey -o $@ .mblaze/mless.in + +.PHONY: install +install: build + @mkdir -p $$HOME/.config + @for f in $(ALL); do \ + if [ -e "$$HOME/$$f" ]; then \ + echo "Up to date: $$f" 1>&2; \ + else \ + echo "Installed: $$HOME/$$f -> $(DOTS)/$$f"; \ + ln -s "$(DOTS)/$$f" "$$HOME/$$f"; \ + fi \ + done -- libgit2 1.1.1