[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: generating helpful message when an invalid target specified
From: |
Stephan Beal |
Subject: |
Re: generating helpful message when an invalid target specified |
Date: |
Mon, 20 Aug 2012 18:13:17 +0200 |
On Sat, Aug 18, 2012 at 8:31 PM, Rakesh Sharma <address@hidden>wrote:
> then when an invalid target is specified, make should just run the "make
> help" target.
>
This isn't quite what you want but might still be useful:
########################################################################
# A simple help facility, taken from "Managing Projects with GNU Make,
# Third Edition":
.PHONY: list-targets
list-targets-noop:# don't ask
list-targets:
@$(MAKE) --print-data-base --question list-targets-noop | \
grep -v -e '^no-such-target' -e '^makefile' | \
awk '/^[^.%][-A-Za-z0-9_]*:/{ print substr($$1, 1, length($$1)-1) }'
| \
sort | \
pr --omit-pagination --columns=2
--
----- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal