From f31095e65d8fcbd4465d4b43ce2e7e95888c3796 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Sun, 19 Jun 2022 01:17:43 -0700 Subject: [PATCH] Add documentation to the make file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thanks to this excellent article[1] I can now type in ‘make’ to be reminded of what commands I have available. [1]: https://victoria.dev/blog/how-to-create-a-self-documenting-makefile/ --- GNUmakefile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 4e875f2..c9bf608 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -1,8 +1,11 @@ -.PHONY: publish deploy html css +.PHONY: publish deploy html css help -publish: html css +help: ## Show this help + @egrep -h '\s##\s' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' -deploy: +publish: html css ## Build the site and copy it to the staging directory + +deploy: ## Deploy the site to live @[[ -e public/index.html ]] || (echo "Run make publish before deploy" && exit 1) rsync --rsh="ssh -p 4511" --verbose --checksum --recursive --delete \ --exclude '*~' --exclude '.eldev' --delete-excluded \ @@ -22,7 +25,7 @@ public/assets/css/main.css public/assets/css/tekuti.css public/assets/css/cgit.c public/assets/css/%.css: src/less/%.less lessc $< $@ -clean: +clean: ## Remove all of the build files @echo "Cleaning up..." @rm -rvf *.elc @rm -rvf public