Recently Written · git

prompt-mail

Ask mail-related questions and filter mail-related files with dmenu

git clone https://github.com/equwal/prompt-mail

Log | Files | Refs


commit 54986b8f5d8851f663f89ae33d1de0b0978f654f
Spenser Truex <truex@equwal.com>
2020-09-23 20:54:25 -0700

Simplify and improve makefile

Don't overwrite the user's config.
Don't make the user edit the config here before compiling.
Don't overspecify things make can do for you automagically.

 Makefile         | 26 +++++++++++---------------
 README           |  6 ++++--
 prompt-mail.conf |  4 ----
 3 files changed, 15 insertions(+), 21 deletions(-)
diff --git a/Makefile b/Makefile
index 1537bda..294f6e5 100644
--- a/Makefile
+++ b/Makefile
@@ -1,20 +1,16 @@
-BIN_PATH := /usr/local/bin
+CFG_PATH = ~/.config/prompt-mail.conf
+BIN_PATH = /usr/local/bin/prompt-mail
 
-default: all
+# Empty recipes, only install if there isn't already one.
+config: ${CFG_PATH}
 
-all:
-	@echo "Putting prompt-mail.conf in ~/.config"
-	@mkdir -p ~/.config
-	@cp prompt-mail.conf ~/.config
-	@echo "Done"
 install:
-	@echo "Putting prompt-mail in ${BIN_PATH}"
+	@echo "Putting prompt-mail in ${BIN_PATH}."
 	@cp prompt-mail ${BIN_PATH}
-	@echo "Done"
 
-uninstall:
-	@echo "Deleting ${BIN_PATH}/prompt-mail"
-	@rm -f ${BIN_PATH}/prompt-mail
-	@echo "Deleting ~/.config/prompt-mail.conf"
-	@rm -f ~/.config/prompt-mail.conf
-	@echo "Done"
+${CFG_PATH}:
+	@echo -e "I have setup your toiling space ${CFG_PATH}\nEdit it, slave!"
+	@echo "#Comments must be at the beginning of the line." > ${CFG_PATH}
+	@echo "# No ~ expansion allowed." >> ${CFG_PATH}
+	@echo -e "# Example line:\n" >> ${CFG_PATH}
+	@echo "#${HOME}/.config/neomutt/aliases" >> ${CFG_PATH}
diff --git a/README b/README
index 43fdc28..467d43a 100644
--- a/README
+++ b/README
@@ -6,8 +6,10 @@ Requires:
 
 Installation
 ------------
-Edit prompt-mail.conf to point at any mail alias files.
-make && sudo make install
+$ make config
+$ sudo make install
+# Edit config to point at your mail aliases file
+$ microsoft-word-97 ${CFG_PATH}/prompt-mail.conf
 
 
 Mail alias files are generated by mail programs like mutt. The format is:
diff --git a/prompt-mail.conf b/prompt-mail.conf
deleted file mode 100644
index baed0b0..0000000
--- a/prompt-mail.conf
+++ /dev/null
@@ -1,4 +0,0 @@
-# Comments have # at the beginning of the line.
-# No ~ expansion allowed.
-# Example line:
-#/home/username/.config/neomutt/aliases