From owner-freebsd-questions@FreeBSD.ORG Wed Mar 2 13:42:27 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 D21DF1065670 for ; Wed, 2 Mar 2011 13:42:27 +0000 (UTC) (envelope-from mexas@bristol.ac.uk) Received: from dirj.bris.ac.uk (dirj.bris.ac.uk [137.222.10.78]) by mx1.freebsd.org (Postfix) with ESMTP id 8C94E8FC13 for ; Wed, 2 Mar 2011 13:42:27 +0000 (UTC) Received: from ncsd.bris.ac.uk ([137.222.10.59] helo=ncs.bris.ac.uk) by dirj.bris.ac.uk with esmtp (Exim 4.72) (envelope-from ) id 1PumJt-0004Iy-Tz; Wed, 02 Mar 2011 13:42:26 +0000 Received: from mech-cluster241.men.bris.ac.uk ([137.222.187.241]) by ncs.bris.ac.uk with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1PumJt-0000GY-MI; Wed, 02 Mar 2011 13:42:25 +0000 Received: from mech-cluster241.men.bris.ac.uk (localhost [127.0.0.1]) by mech-cluster241.men.bris.ac.uk (8.14.4/8.14.4) with ESMTP id p22DgO1l086588; Wed, 2 Mar 2011 13:42:24 GMT (envelope-from mexas@bristol.ac.uk) Received: (from mexas@localhost) by mech-cluster241.men.bris.ac.uk (8.14.4/8.14.4/Submit) id p22DgNBk086587; Wed, 2 Mar 2011 13:42:23 GMT (envelope-from mexas@bristol.ac.uk) X-Authentication-Warning: mech-cluster241.men.bris.ac.uk: mexas set sender to mexas@bristol.ac.uk using -f Date: Wed, 2 Mar 2011 13:42:23 +0000 From: Anton Shterenlikht To: bf1783@gmail.com Message-ID: <20110302134222.GB86263@mech-cluster241.men.bris.ac.uk> Mail-Followup-To: bf1783@gmail.com, Anton Shterenlikht , freebsd-questions@FreeBSD.org References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: Anton Shterenlikht , 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 List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Mar 2011 13:42:27 -0000 On Wed, Mar 02, 2011 at 01:27:22PM +0000, b. f. wrote: > > 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? It seems the way suffix rules are impemented differs. E.g. this construct .SUFFIXES: .f90 .o .f90.o: $(AUX).mod $(FC) $(FFLAGS) -c $< meaning "compile all fortran files into objects, and make sure $(AUX).mod file exists and up to date" works in BSD make, while GNU make: *quote* Suffix rules cannot have any prerequisites of their own. If they have any, they are treated as normal files with funny names, not as suffix rules. Thus, the rule: .c.o: foo.h $(CC) -c $(CFLAGS) $(CPPFLAGS) -o $@ $< tells how to make the file .c.o from the prerequisite file foo.h, and is not at all like the pattern rule: %.o: %.c foo.h $(CC) -c $(CFLAGS) $(CPPFLAGS) -o $@ $< which tells how to make `.o' files from `.c' files, and makes all `.o' files using this pattern rule also depend on foo.h. *end quote* > > 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 Thanks for pmake, but I think I'll try instead to use as simple constructs as I can. > You can limit yourself to constructs common to both makes, yes, will try. Many thanks Anton -- Anton Shterenlikht Room 2.6, Queen's Building Mech Eng Dept Bristol University University Walk, Bristol BS8 1TR, UK Tel: +44 (0)117 331 5944 Fax: +44 (0)117 929 4423