-- Leo's gemini proxy

-- Connecting to g.codelearn.me:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini

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

-- Response ended

-- Page fetched on Sat May 11 04:26:28 2024