I use the following code to get a makefile targets list which works OK for most cases, however when you use makefile like this you get only two targets and not all.
cat Makefile
command: ## Command description
@echo "Execution log"
another-command: ## Command description
@echo "Execution log"
command2: ## Command description
@echo "Execution log"
The output is:
command
command2
I don't understand why I don't getting the command another-command
,
This is the code
`make -qp | awk -F':' '/^[a-zA-Z0-9][^$#\\\/t=]*:([^=]|$)/ {split($1,A,/ /);for(i in A)print A[i]}' `;
What could be the problem ?
I tried with the solution purposed but it provide an error:
make -qp | grep '^[a-z0-9-]\+:'