Skip to content

Latest commit

 

History

History
39 lines (34 loc) · 702 Bytes

2023-12-15-make_list.md

File metadata and controls

39 lines (34 loc) · 702 Bytes
title date draft categories tags
makefile list
2023-12-15 00:00:00 -0500
false
daily
blog

Working with make commands can be tiresome. Especially when those makefiles are really long and you do not know what commands are in them or you cannot remember what the commands are named.
Here is a neat little trick to help with that.
make list

<Makefile>
test:
	echo "testing"

build:
	echo "building"

deploy:
	echo "deploying"

list:
	@grep '^[^#[:space:]].*:' Makefile | sort

just add the extra list command to a makefile like this

list:
	@grep '^[^#[:space:]].*:' Makefile | sort

and then when you run it you get

$ make list
test:
build:
deploy: