Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 2 Mar 2011 13:27:22 +0000
From:      "b. f." <bf1783@googlemail.com>
To:        Anton Shterenlikht <mexas@bristol.ac.uk>
Cc:        freebsd-questions@FreeBSD.org
Subject:   Re: GNU make doesn't understand .for? suffix rules obsolete?
Message-ID:  <AANLkTimKi25ayCg9=oiPO04RzU9Qgd=RMkGqyove%2BU8B@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
> 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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTimKi25ayCg9=oiPO04RzU9Qgd=RMkGqyove%2BU8B>