Richards-MacBook-Pro:test2 richard$ cat makefile .PHONY: help help: $(MAKE) --print-data-base --question | \ awk '/^[^.%][-A-Za-z0-9_]*:/ \ { print substr($$1, 1, length($$1)-1) }' | \ sort # My version of GNU make (3.8.1) doesn't have builtin variables $(AWK) and # $(SORT), but awk and sort do exist on my system # I have omitted the pr command because my system (OS X 10.7) # doesn't understand one of the options given .PHONY: test test: @echo "This is a test" Richards-MacBook-Pro:test2 richard$ make help make --print-data-base --question | \ awk '/^[^.%][-A-Za-z0-9_]*:/ \ { print substr($1, 1, length($1)-1) }' | \ sort /bin/sh: fork: Resource temporarily unavailable make[55]: *** [help] Error 128 help makefile test Richards-MacBook-Pro:test2 richard$ make test This is a test Richards-MacBook-Pro:test2 richard$ make --version GNU Make 3.81 Copyright (C) 2006 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This program built for i386-apple-darwin11.3.0 Richards-MacBook-Pro:test2 richard$ awk --version awk version 20070501 Richards-MacBook-Pro:test2 richard$ make --print-data-base -n | grep AWK /bin/sh: fork: Resource temporarily unavailable make[54]: *** [help] Error 128 /bin/sh: fork: Resource temporarily unavailable make[57]: *** [help] Error 128 Richards-MacBook-Pro:test2 richard$ make --print-data-base -n | grep SORT /bin/sh: fork: Resource temporarily unavailable make[54]: *** [help] Error 128 Richards-MacBook-Pro:test2 richard$ /bin/sh: fork: Resource temporarily unavailable make[109]: *** [help] Error 128 /bin/sh: fork: Resource temporarily unavailable make[164]: *** [help] Error 128 /bin/sh: fork: Resource temporarily unavailable make[165]: *** [help] Error 128 Richards-MacBook-Pro:test2 richard$ uname -a Darwin Richards-MacBook-Pro.local 11.4.2 Darwin Kernel Version 11.4.2: Thu Aug 23 16:26:45 PDT 2012; root:xnu-1699.32.7~1/RELEASE_I386 i386