FreeBSD Make question

Johan Kuuse kuuse at
Mon Oct 28 17:06:42 UTC 2013

> --------------------8<--------------------
> TLIST = "/tmp/dir with space/one" "/tmp/another spacey thing/two"
> tlist=
> .for t in ${TLIST}
> tlist+= ${t:tW:S, ,?,g:S,",,g}
> # the above :tW causes the value to be treated as one-word

The ':tW' variable modifier seems to be pmake/fmake syntax.
At least it doesn't work using my Make (9201120530, FreeBSD 9.1 RELEASE)
Is there any similar, non-documented, "treat-as-one-word"-modifier
avilable for FreeBSD Make?


> note we don't get 'making...'
> If we replace ? with . it works but that isn't very useful:
> all: ${tlist:S,?,.,g}
>         @echo TLIST='${TLIST}'
>         @echo tlist='${tlist}'
> ${tlist:S,?,.,g}: .PHONY
>         @echo "making: '$@'"
> $ make
> making: '/tmp/'
> making: '/tmp/another.spacey.thing/two'
> TLIST="/tmp/dir with space/one" "/tmp/another spacey thing/two"
> tlist= /tmp/dir?with?space/one /tmp/another?spacey?thing/two
> $

Yes, finally we end up with a .PHONY target, which isn't useful in a
real-case Makefile.
Any targets containing whitespaces will always be rebuilt even if
they're up to date.

I guess my final solution will be :
You are using FreeBSD Make, and one or more of your directories/files
contains whitespaces.
Either rename your targets (recommended), or stick to GNU Make."

Thanks for the input, regards,

More information about the freebsd-doc mailing list