From owner-freebsd-questions@FreeBSD.ORG Wed May 26 05:28:24 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F01FE16A4CE for ; Wed, 26 May 2004 05:28:24 -0700 (PDT) Received: from mail.mri.ernet.in (mail.mri.ernet.in [202.41.87.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id DC9BB43D39 for ; Wed, 26 May 2004 05:28:21 -0700 (PDT) (envelope-from raghu@mri.ernet.in) Received: from ipc2.mri.ernet.in (unknown [192.168.1.9]) by mail.mri.ernet.in (Postfix) with ESMTP id D24DC85266; Wed, 26 May 2004 23:06:42 +0500 (MVT) Received: from riemann.mri.ernet.in (riemann.mri.ernet.in [192.168.3.122]) by ipc2.mri.ernet.in (Postfix) with ESMTP id 9C3B113C66; Wed, 26 May 2004 17:57:49 +0530 (IST) Received: from riemann.mri.ernet.in (localhost.mri.ernet.in [127.0.0.1]) i4QCPr8D019137; Wed, 26 May 2004 17:55:53 +0530 (IST) (envelope-from raghu@riemann.mri.ernet.in) Received: (from raghu@localhost) by riemann.mri.ernet.in (8.12.9p2/8.12.9/Submit) id i4QCPqu3019134; Wed, 26 May 2004 17:55:52 +0530 (IST) (envelope-from raghu) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16564.36048.491667.555279@riemann.mri.ernet.in> Date: Wed, 26 May 2004 17:55:52 +0530 From: "N. Raghavendra" To: Matthew Seaman In-Reply-To: <20040526114157.GE26430@happy-idiot-talk.infracaninophile.co.uk> References: <16563.20591.846129.789297@riemann.mri.ernet.in> <20040525144451.GA49822@happy-idiot-talk.infracaninophile.co.uk> <16564.15653.674179.246862@riemann.mri.ernet.in> <20040526114157.GE26430@happy-idiot-talk.infracaninophile.co.uk> X-Mailer: VM 7.18 under Emacs 21.3.1 X-Organization: Harish-Chandra Research Institute (HRI) X-Address: Chhatnag Road, Jhusi, Allahabad 211 019, India X-URL: http://www.mri.ernet.in/ X-Phone: +91 (532) 2667 509, 2667 318, 2667 578, 2567 746, 2567 747 X-Fax: +91 (532) 2667 576, 2567 748, 2567 444, 2568 036 X-OpenPGP-Key-ID: 0x03618806 X-OpenPGP-Key-Fingerprint: C75D D0AF 457E 7454 BEC2 37AD C6E1 0407 0361 8806 X-OpenPGP-Public-Key-Available-At: http://www.keyserver.net/ cc: FreeBSD Questions Subject: Re: `call' function in `make' X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: "N. Raghavendra" List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 May 2004 12:28:25 -0000 At 2004-05-26T12:41:57+01:00, Matthew Seaman wrote: > On Wed, May 26, 2004 at 12:15:57PM +0530, N. Raghavendra wrote: > > ### Makefile > > > > ## Create directory FOO if it does not exist. > > create_dir = if test ! -d foo ; then rm -f foo ; mkdir foo ; fi > > > > dir1: src1 > > $(create_dir:S/foo/$@/g) > > > > dir2: src2 > > $(create_dir:foo=$@) > > > > ### Makefile ends here > > Is there something wrong with the first form of the rule that means > you can't use it? Hi Matthew, Thanks for the help. I would have liked to use the second substitution mechanism (foo=$@) because it is part of the POSIX specification of `make' (http://www.opengroup.org/onlinepubs/009695399/utilities/make.html), whereas the first form (S/foo/$@/g) doesn't seem to be so. > You have got a line: > > .PHONY: dir1 dir2 > > to force those rules to be applied even if dir1 or dir2 are newer than > their sources? Yes, I had tried that too, but it doesn't make the second rule work. The second rule does work with `gmake'. Cheers, Raghavendra. -- N. Raghavendra | See mail headers for contact Harish-Chandra Research Institute | and OpenPGP details.