Created
May 23, 2011 15:56
-
-
Save spudtrooper/986932 to your computer and use it in GitHub Desktop.
maketargets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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