Make list targets [memo]

Here is small note about the target I put in every Makefile I have.

The target is called list and looks like this:

.PHONY: list
list:
    @$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$'

It prints list of all targets defined in your Makefile.

Took it from

=> this brilliant stackoverflow answer

Proxy Information
Original URL
gemini://g.codelearn.me/2018-01-08-make-list-targets.gmi
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
504.105812 milliseconds
Gemini-to-HTML Time
0.197844 milliseconds

This content has been proxied by September (3851b).