Last active
March 5, 2022 14:16
-
-
Save dspinellis/dfaf99c73a3a2f7bed34b3c32cbb7118 to your computer and use it in GitHub Desktop.
Add a help target for any Makefile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
URL=https://www.spinellis.gr/unix | |
love: # Help: Create a file name love | |
touch love | |
money: # Help: Hit the jackpot | |
yes $$ | fmt | head | |
me a wizard: MOOC # Help: Become a Unix command-line wizard | |
MOOC: | |
@echo "Visit $(URL); Other than that ..." | |
@(open $(URL) || cygstart $(URL) || kde-open $(URL) || gnome-open $(URL) || :) 2>/dev/null | |
help: # Help: Show this help message | |
@echo 'The following make targets are available.' | |
@sed -n 's/^\([^:]*:\).*# [H]elp: \(.*\)/"%-20s %s\\n" "\1" "\2"/p' Makefile | xargs -n 3 printf | sort |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment