Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Oct 2013 18:06:31 +0100
From:      Johan Kuuse <kuuse@redantigua.com>
To:        "Simon J. Gerraty" <sjg@juniper.net>
Cc:        freebsd-doc@freebsd.org
Subject:   Re: FreeBSD Make question
Message-ID:  <CAGUU1d3JSwGtFwAPXbraVNZsjsoBby1j6AWKLK7p7_e5Erw34w@mail.gmail.com>
In-Reply-To: <20131025231000.C74665807E@chaos.jnpr.net>
References:  <CAGUU1d1RQAuq=5rOczZnRnVo31Rh_xhYOnDP7-=ajVv4AnRwZA@mail.gmail.com> <alpine.GSO.1.10.1310241730590.4934@multics.mit.edu> <20131024214923.CB0AF5807E@chaos.jnpr.net> <CAGUU1d0DVRYO_GUryyJONbpTgxrsYFf=WeQkn63557stnpsaVQ@mail.gmail.com> <20131025174720.870B35807E@chaos.jnpr.net> <CAGUU1d3ExyGrqGo1K8ta2qB=iwsU=ivgZUv3k3swbg-TRjtPzA@mail.gmail.com> <20131025231000.C74665807E@chaos.jnpr.net>

next in thread | previous in thread | raw e-mail | index | archive | help
> --------------------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/dir.with.space/one'
> 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 :
"Warning:
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,
Johan



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAGUU1d3JSwGtFwAPXbraVNZsjsoBby1j6AWKLK7p7_e5Erw34w>