16 May 2013 20:40
make: wilcard targets and .PHONY
Simon Gerraty <sjg <at> juniper.net>
2013-05-16 18:40:25 GMT
2013-05-16 18:40:25 GMT
Back in 2000, the callpath through Suff_FindDeps was skipped for .PHONY
targets.
It turns out though that that is the only place where wildcard targets
are expanded.
Assuming there is something in ./sub/ the makefile:
.MAIN: all
all: subs
SUBS= sub/*
subs: ${SUBS}
<at> echo yay ${SUBS}
.ifdef PHONY
.PHONY: subs
.endif
works so long as PHONY isn't defined.
The patch below (sans fixing the indentation) pushes the PHONY check
lower so that wildcards can be expanded correctly, while still skipping
most of the suffix related effort.
Index: suff.c
===================================================================
RCS file: /cvsroot/src/usr.bin/make/suff.c,v
retrieving revision 1.69
diff -u -p -r1.69 suff.c
--- suff.c 29 Sep 2011 23:38:04 -0000 1.69
+++ suff.c 16 May 2013 18:34:29 -0000
(Continue reading)
RSS Feed