Skip to content

Instantly share code, notes, and snippets.

Created January 7, 2022 16:56
What would you like to do?
Make list target and pass argument
.PHONY: list
@LC_ALL=C $(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 '^$@$$'
echo_arg: # call with i=aaaa
echo $(i)
Copy link

zonca commented Jan 7, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment