Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Autocomplete Makefile targets. Add this to your shell config file.
complete -W "\`grep -oE '^[a-zA-Z0-9_-]+:([^=]|$)' Makefile | sed 's/[^a-zA-Z0-9_-]*$//'\`" make
Copy link

perenecabuto commented Jun 6, 2012

complete -W "test -e Makefile && grep -oE '^[a-zA-Z0-9_-]+:([^=]|$)' Makefile | sed 's/[^a-zA-Z0-9_-]*$//'" make

To avoid errors on folder without Makefile

Copy link

hxgdzyuyi commented May 24, 2013

it's broken when Makefile include other makefile

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