On Mon, Apr 30, 2012 at 9:41 PM, AB <[email protected]> wrote:
> #Error out if wildcard is used in "test.mk" > LIST := $(wildcard *.txt) > this is rudimentary, but might work for simple cases: [stephan@host:~/tmp]$ cat wildcard.make all: NO_WILDCARD := $(shell grep -e '[$][(]wildcard .*)' $(MAKEFILE_LIST)) ifneq (,$(NO_WILDCARD)) $(error found wildcard) endif [stephan@host:~/tmp]$ make -f wildcard.make make: Nothing to be done for `all'. when i add: x = $(wildcard *.*) i get: wildcard.make:5: *** found wildcard. Stop. ACHTUNG: the final parenthesis in the grep is a kludge to work around what appears to be a parsing bug in make: NO_WILDCARD := $(shell grep -e '[$][(]wildcard ' $(MAKEFILE_LIST)) leads to: wildcard.make:3: *** unterminated call to function `shell': missing `)'. Stop. this means the above check will fail on multi-line $(wildcard) calls. -- ----- stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal _______________________________________________ Help-make mailing list [email protected] https://lists.gnu.org/mailman/listinfo/help-make
