From owner-freebsd-questions@FreeBSD.ORG Sun Jan 27 23:26:28 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88B9F16A41B for ; Sun, 27 Jan 2008 23:26:28 +0000 (UTC) (envelope-from rambiusparkisanius@gmail.com) Received: from rv-out-0910.google.com (rv-out-0910.google.com [209.85.198.188]) by mx1.freebsd.org (Postfix) with ESMTP id 287B513C461 for ; Sun, 27 Jan 2008 23:26:28 +0000 (UTC) (envelope-from rambiusparkisanius@gmail.com) Received: by rv-out-0910.google.com with SMTP id l15so1437751rvb.43 for ; Sun, 27 Jan 2008 15:26:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=WeZ49eCKBBLmAyhliHpu0H9hSTHXV/rCDf8wze1ujQg=; b=KBoNl1/kFSI0jx8QwxDv4jP6EDZjM+Xl1WIsIYh5cBgFlFK/mL7xHk4YqatdA7nhxMhPdX5AOOfOhzLyyJArN20quXxXqj5uhLPlEIYBC2+FCWmp0H2e0bDXPv1wfwcqC3DG/WzAawzzt9FMkdwYV+jmyLnbCbHwFxCfpImOTKA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=N+IXjSMrGTmMi+0LNhYAchfM5Vn5VkVF8Vrg2KW3HP9NyV/nbPfVqxSzqep3xBKtDkBNi8Avl2mkBvHbghIfMvE99XwUyxhOBLvsVGX92yw0K58nxPiD1Czth83o5FUaAI0/HgvU34R3U+D+2UdUj+PSJoTI8gZmBKaqhM1utZY= Received: by 10.141.113.6 with SMTP id q6mr3025441rvm.135.1201476386635; Sun, 27 Jan 2008 15:26:26 -0800 (PST) Received: by 10.140.161.2 with HTTP; Sun, 27 Jan 2008 15:26:26 -0800 (PST) Message-ID: <89ce7f740801271526p2e7721e0g72e89bd22c4c31d2@mail.gmail.com> Date: Mon, 28 Jan 2008 01:26:26 +0200 From: "Ivan \"Rambius\" Ivanov" To: freebsd-questions@freebsd.org In-Reply-To: <479D0ECB.1080605@student.utwente.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <89ce7f740801271448x27371cf7lfe5255256fb498ec@mail.gmail.com> <479D0ECB.1080605@student.utwente.nl> Subject: Re: Slightly OT: Invoking a shell command from a Makeile X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2008 23:26:28 -0000 Hello Alphons, On Jan 28, 2008 1:07 AM, Alphons Fonz van Werven wrote: > Ivan "Rambius" Ivanov wrote: > > > I am developing a FreeBSD port and I would like to invoke a shell > > command from it and assign its output to a variable. > > If you're using GNU make (called gmake on BSD systems), you can do > VAR := $(shell command) > or, as a concrete example, > CFILES := $(shell ls *.c) > Not that I recommend using that example, it just goes to illustrate. > > If you're using BSD make, I wouldn't know though. I'm just not familiar > with that. And if you wish to do it in a portable way such that it works > with BSD make, GNU make or whatever, then all I can say is good luck... I do use BSD make and not GNU make, but your examples gave me a hint what I should search on google and I found the exact syntax: FPCVERSION!= make -f ${PORTSDIR}/lang/fpc/Makefile -V PORTVERSION The assignment is done by the bang equals sign "!=" and I found it explained here http://www.khmere.com/freebsd_book/html/ch01.html Thank you for your quick response. Regards Rambius -- Tangra Mega Rock: http://www.radiotangra.com