From owner-freebsd-questions@FreeBSD.ORG Wed Apr 18 00:51:12 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0F8D416A400 for ; Wed, 18 Apr 2007 00:51:12 +0000 (UTC) (envelope-from kelly.terry.jones@gmail.com) Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.225]) by mx1.freebsd.org (Postfix) with ESMTP id C541613C465 for ; Wed, 18 Apr 2007 00:51:11 +0000 (UTC) (envelope-from kelly.terry.jones@gmail.com) Received: by wx-out-0506.google.com with SMTP id s18so2187588wxc for ; Tue, 17 Apr 2007 17:51:11 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=ZrWJTcXgYhFj2bX4e71wjfaw2HiwNZwL3RPaT6q3ntL/XJtk4wbLg0w15lVuvMbkAJzqtir1EmqDCcClve6DjmOD3rFQ7Lv6eZwb9z3r1Ryg4Ncm5AoBNhC5iUNVV6mB5tSt3soq2JFAXMtcGLZd2FYDUC3/lX41LUueBzgTFkg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=Vi7Me+kIsdRp5v1evkSoIkOTh/NCO6A1QPQCqrYuAbgwyCmtUj4AXEy+Xqc0W2ovkinvV4VzWHxrlwVJS35DzMSyV4SXSWnAH6pIZnrUAfXahsT2dLNf4Mii/7f4jSVCqHd/OMYlz4Ha4gzY/zNeWHjROPzPmf9xsGMImtFTxtg= Received: by 10.70.31.6 with SMTP id e6mr13939379wxe.1176857470939; Tue, 17 Apr 2007 17:51:10 -0700 (PDT) Received: by 10.70.15.3 with HTTP; Tue, 17 Apr 2007 17:51:10 -0700 (PDT) Message-ID: <26face530704171751r243ccf01sbb6d4572e8006a68@mail.gmail.com> Date: Tue, 17 Apr 2007 17:51:10 -0700 From: "Kelly Jones" To: nmlug@nmlug.org, nmosug-l@mailman.swcp.com, linuxusersgroup@googlegroups.com, techtalk@linuxchix.org, freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Cc: Subject: Loop/wildcard-like syntax for GNU make? 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: Wed, 18 Apr 2007 00:51:12 -0000 Here's a Makefile that converts 3 GIFs to JPGs in a given directory: 1.jpg: 1.gif /usr/local/bin/convert 1.gif 1.jpg 2.jpg: 2.gif /usr/local/bin/convert 2.gif 2.jpg 3.jpg: 3.gif /usr/local/bin/convert 3.gif 3.jpg How do I generalize this to apply to ALL the GIFs in a given directory? I tried: *.jpg: *.gif /usr/bin/local/bin/convert $1.gif $1.jpg but this obviously doesn't work (I didn't really expect it to). Neither does for $i (*.jpg) { $i.jpg: $i.gif /usr/bin/local/bin/convert $i.gif $i.jpg } (again, didn't really expect it to, since you can't put shell looping into a Makefile). -- We're just a Bunch Of Regular Guys, a collective group that's trying to understand and assimilate technology. We feel that resistance to new ideas and technology is unwise and ultimately futile.