Created
January 7, 2022 16:56
-
-
Save zonca/fd1980c1aeac394bfc854fce24b9b0df to your computer and use it in GitHub Desktop.
Make list target and pass argument
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.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
Credit: