Skip to content

Instantly share code, notes, and snippets.

@prwhite
Created September 29, 2011 05:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prwhite/1250016 to your computer and use it in GitHub Desktop.
Save prwhite/1250016 to your computer and use it in GitHub Desktop.
Complete Makefile targets in tcsh
# first grep finds lines with potential commands
# second grep throws away pure comment lines
# then sed throws away anything after initial target name (which should just be the : now)
# final uniq throws away dups
# could be more optimal :)
# could probably do something to generate completes from -f makefile name
alias makeCommands 'echo `egrep --only-matching "^.*?: " Makefile | egrep -v "^[[:space:]]*#" | sed "s/\(:.*\)//" | uniq`'
complete make 'n/*/`makeCommands`/'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment