Skip to content

Instantly share code, notes, and snippets.

@spudtrooper
Created May 23, 2011 15:56
Show Gist options
  • Save spudtrooper/986932 to your computer and use it in GitHub Desktop.
Save spudtrooper/986932 to your computer and use it in GitHub Desktop.
maketargets
#!/bin/sh
#
# Prints out the targets available to make.
#
# Usage: maketargets file?
#
# On windows probably pipe into sort and uniq, e.g.
#
# maketargets | sort | uniq
#
files="$@ GNUMakefile Makefile makefile"
for f in $files; do
test -f $f && {
grep "^[A-Za-z0-9_\-\.\/\\]*:" $f | cut -d: -f1
}
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment