Skip to content

Instantly share code, notes, and snippets.

@jpbochi
Created August 18, 2022 16:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jpbochi/7e6fa7903791d94981d7e33cfdffa572 to your computer and use it in GitHub Desktop.
Save jpbochi/7e6fa7903791d94981d7e33cfdffa572 to your computer and use it in GitHub Desktop.
Makefile - list all available commands
.PHONY: default list
default: list
list:
@echo Available make targets:
@LC_ALL=C $(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null \
| sed -e '0,/^# Files/ d' -e '/^# Not a target:/,+1 d' \
| grep '^[[:alnum:]]' \
| sed 's/:.*//'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment