From owner-freebsd-questions@FreeBSD.ORG Wed Mar 2 13:27:23 2011 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 83DC11065676 for ; Wed, 2 Mar 2011 13:27:23 +0000 (UTC) (envelope-from bf1783@googlemail.com) Received: from mail-gx0-f182.google.com (mail-gx0-f182.google.com [209.85.161.182]) by mx1.freebsd.org (Postfix) with ESMTP id 41ABA8FC19 for ; Wed, 2 Mar 2011 13:27:22 +0000 (UTC) Received: by gxk7 with SMTP id 7so2742408gxk.13 for ; Wed, 02 Mar 2011 05:27:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:reply-to:date:message-id:subject :from:to:cc:content-type; bh=j4U1MMtKlZF7KjE95Ta9TCXEYfRdjS+97O6IhScsYB0=; b=bPxTsmzGk550NwRZNPtJHWQatUsZx4tra92lwFAunmq2yR/56qh9x0C94EzFN/64Je zAXOG5CfijM0cyuw40RN1of21E6z1mcVNQ6/VPSghwlwAk/wk/A1yrsO/p1DWsXiCOqs p0EvzzVWRlI97GBgwN9T+jPvNEOUMajfxvhyo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:reply-to:date:message-id:subject:from:to:cc :content-type; b=bK0pzkAnfhUnK/vqBwSQkW5D/8qMMHqd7cxERjuZJ47Zgi/A3oz7Qzg9dbGEkC6OXU Q/UekvN4QOlMcbdgQvrz7B7P5UaghhzPUbHGeqbAdeHE88xNlb4QUBvk4Jp5WPMMzlG8 f5/Hf/HMYbcuEyklCfUIGbR92McJgh1HCJ6WA= MIME-Version: 1.0 Received: by 10.236.63.35 with SMTP id z23mr13801056yhc.92.1299072442425; Wed, 02 Mar 2011 05:27:22 -0800 (PST) Received: by 10.236.108.44 with HTTP; Wed, 2 Mar 2011 05:27:22 -0800 (PST) Date: Wed, 2 Mar 2011 13:27:22 +0000 Message-ID: From: "b. f." To: Anton Shterenlikht Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-questions@FreeBSD.org Subject: Re: GNU make doesn't understand .for? suffix rules obsolete? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: bf1783@gmail.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Mar 2011 13:27:23 -0000 > In particular I was surprised > to find out that GNU make considers > suffix rules obsolete: > http://www.gnu.org/software/make/manual/html_node/Suffix-Rules.html#Suffix-Rules > > I didn't think the suffix rules are > obsolete in BSD make, are they? > No (Although maybe some people will argue that BSD make itself is obsolete...). But what does it matter -- gnu make still understands them, doesn't it? > The GNU replacement for suffix rules > are "pattern rules". Now these don't > seem to be supported by BSD make, are they? > There are some implicit rules, and variable expansions can be used, but many of the GNU constructs are not supported. See make(1), and: http://www.freebsd.org/doc/en_US.ISO8859-1/books/pmake/index.html > Also, since ".for .endfor" > construct doesn't seem to be supported > by GNU make (please confirm or correct if I'm wrong), > what is an alternative in GNU make? Patterns and the foreach function: http://www.gnu.org/software/make/manual/html_node/Foreach-Function.html#Foreach-Function > My aim, of course, is to have > a makefile, which would work > on both GNU and BSD make. > The project is comparatively simple, > just a collection of fortran files, > which need to be compiled and several > executables need to be linked > against a number of libraries. You can limit yourself to constructs common to both makes, but if you prefer gnu make, then why not just write makefiles accordingly and use gmake from devel/gmake? b.