From owner-freebsd-doc@FreeBSD.ORG Fri Oct 25 23:25:24 2013 Return-Path: Delivered-To: freebsd-doc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A6E327B4 for ; Fri, 25 Oct 2013 23:25:24 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from co1outboundpool.messaging.microsoft.com (co1ehsobe006.messaging.microsoft.com [216.32.180.189]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6B4FD299F for ; Fri, 25 Oct 2013 23:25:23 +0000 (UTC) Received: from mail112-co1-R.bigfish.com (10.243.78.235) by CO1EHSOBE034.bigfish.com (10.243.66.99) with Microsoft SMTP Server id 14.1.225.22; Fri, 25 Oct 2013 23:10:12 +0000 Received: from mail112-co1 (localhost [127.0.0.1]) by mail112-co1-R.bigfish.com (Postfix) with ESMTP id AB12BCE0073; Fri, 25 Oct 2013 23:10:12 +0000 (UTC) X-Forefront-Antispam-Report: CIP:66.129.224.53; KIP:(null); UIP:(null); IPV:NLI; H:P-EMF01-SAC.jnpr.net; RD:none; EFVD:NLI X-SpamScore: 3 X-BigFish: VPS3(zzzz1f42h208ch1ee6h1de0h1fdah2073h1202h1e76h1d1ah1d2ah1fc6h1082kzz1de097hz2fh2a8h839hd25hf0ah1288h12a5h12a9h12bdh12e5h137ah139eh13b6h1441h14ddh1504h1537h162dh1631h1758h1898h18e1h1946h19b5h1ad9h1b0ah1b2fh1b88h1fb3h1d0ch1d2eh1d3fh1de2h1dfeh1dffh1e23h1fe8h1ff5h1155h) Received-SPF: pass (mail112-co1: domain of juniper.net designates 66.129.224.53 as permitted sender) client-ip=66.129.224.53; envelope-from=sjg@juniper.net; helo=P-EMF01-SAC.jnpr.net ; SAC.jnpr.net ; Received: from mail112-co1 (localhost.localdomain [127.0.0.1]) by mail112-co1 (MessageSwitch) id 1382742610560078_15345; Fri, 25 Oct 2013 23:10:10 +0000 (UTC) Received: from CO1EHSMHS010.bigfish.com (unknown [10.243.78.241]) by mail112-co1.bigfish.com (Postfix) with ESMTP id 7BAA3A80040; Fri, 25 Oct 2013 23:10:10 +0000 (UTC) Received: from P-EMF01-SAC.jnpr.net (66.129.224.53) by CO1EHSMHS010.bigfish.com (10.243.66.20) with Microsoft SMTP Server (TLS) id 14.16.227.3; Fri, 25 Oct 2013 23:10:10 +0000 Received: from magenta.juniper.net (172.17.27.123) by P-EMF01-SAC.jnpr.net (172.24.192.21) with Microsoft SMTP Server (TLS) id 14.3.146.0; Fri, 25 Oct 2013 16:10:09 -0700 Received: from chaos.jnpr.net (chaos.jnpr.net [172.24.29.229]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id r9PNA5L64515; Fri, 25 Oct 2013 16:10:06 -0700 (PDT) (envelope-from sjg@juniper.net) Received: from chaos.jnpr.net (localhost [127.0.0.1]) by chaos.jnpr.net (Postfix) with ESMTP id C74665807E; Fri, 25 Oct 2013 16:10:00 -0700 (PDT) To: Johan Kuuse Subject: Re: FreeBSD Make question In-Reply-To: References: <20131024214923.CB0AF5807E@chaos.jnpr.net> <20131025174720.870B35807E@chaos.jnpr.net> Comments: In-reply-to: Johan Kuuse message dated "Sat, 26 Oct 2013 00:38:31 +0200." From: "Simon J. Gerraty" X-Mailer: MH-E 7.82+cvs; nmh 1.3; GNU Emacs 22.3.1 Date: Fri, 25 Oct 2013 16:10:00 -0700 Message-ID: <20131025231000.C74665807E@chaos.jnpr.net> MIME-Version: 1.0 Content-Type: text/plain X-OriginatorOrg: juniper.net X-FOPE-CONNECTOR: Id%0$Dn%*$RO%0$TLS%0$FQDN%$TlsDn% Cc: freebsd-doc@freebsd.org, sjg@juniper.net X-BeenThere: freebsd-doc@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Documentation project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 23:25:24 -0000 >Johan: >Can you give an example of such a (glob chars) substitution? >May it be similar to, or better than, my ugly hack (see below)? Doesn't really help. Eg. --------------------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 .endfor all: @echo TLIST='${TLIST}' @echo tlist='${tlist}' --------------------8<-------------------- $ make TLIST="/tmp/dir with space/one" "/tmp/another spacey thing/two" tlist= /tmp/dir?with?space/one /tmp/another?spacey?thing/two $ but when we try to use ${tlist} as targets: --------------------8<-------------------- TLIST = "/tmp/dir with space/one" "/tmp/another spacey thing/two" tlist= .for t in ${TLIST} tlist+= ${t:tW:S, ,?,g:S,",,g} .endfor all: ${tlist} @echo TLIST='${TLIST}' @echo tlist='${tlist}' ${tlist}: .PHONY @echo "making: '$@'" --------------------8<-------------------- $ make TLIST="/tmp/dir with space/one" "/tmp/another spacey thing/two" tlist= /tmp/dir?with?space/one /tmp/another?spacey?thing/two $ 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 $