From owner-freebsd-questions@FreeBSD.ORG Tue Sep 23 06:56:50 2003 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 6FD5016A4BF for ; Tue, 23 Sep 2003 06:56:50 -0700 (PDT) Received: from sferics.mongueurs.net (sferics.mongueurs.net [81.80.147.197]) by mx1.FreeBSD.org (Postfix) with ESMTP id 175BB43FBF for ; Tue, 23 Sep 2003 06:56:47 -0700 (PDT) (envelope-from david@landgren.net) Received: from landgren.net (81-80-147-206.bpinet.com [81.80.147.206]) by sferics.mongueurs.net (Postfix) with ESMTP id CA60CA94A for ; Tue, 23 Sep 2003 15:56:43 +0200 (CEST) Message-ID: <3F70512B.5090707@landgren.net> Date: Tue, 23 Sep 2003 15:56:59 +0200 From: David Landgren Organization: A thousand golden eyes are watching User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5a) Gecko/20030718 X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: Emulating gmake functionality in make X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2003 13:56:50 -0000 Hello list, gnu's make (a.k.a gmake) has a nifty piece of functionality that, while it may be possible to perform with make, for the life of me I can't figure out the syntax. Let's say you have a list of files a b c d that get transformed by program foo into a.x b.x c.x and d.x Further, let us suppose that you have another list of files e f g that get tranformed by bar into e.x f.x and g.x Note how the resulting files all have a .x extension, yet are produced with two different programs. In gnu parlance, one would write something like FOO = a.x b.x c.x d.x BAR = e.x f.x g.x $(FOO): %.x: % foo $< $(BAR): %.x: % bar $< Which roughly translates to "for the files in the FOO list, you get to something.x from something, by running 'foo something' (since foo produces something.x as a result). And the resulting Makefile is very compact. Can this be done with make (without repeating things in more than one place in the Makefile)? I'm quite happy with the gmake way of doing things, except of course I keep running 'make' instead of 'gmake' and it complains out the syntax. If I could just teach make how to do this it would be more comfortable. Thanks, David :x