Skip to content

Instantly share code, notes, and snippets.

@zonca
Created Jan 7, 2022
Embed
What would you like to do?
Make list target and pass argument
.PHONY: list
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment