Re: GNU make doesn't understand .for? suffix rules obsolete?

2011-03-02 Thread Anton Shterenlikht
On Wed, Mar 02, 2011 at 01:27:22PM +, 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
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: GNU make doesn't understand .for? suffix rules obsolete?

2011-03-02 Thread b. f.
> 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.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: GNU make

2004-12-28 Thread Giorgos Keramidas
On 2004-12-28 09:53, Len Zettel <[EMAIL PROTECTED]> wrote:

> Are there any serious differences between GNU make and the FreeBSD
> make command?

Yes.  These two programs serve a similar purpose and you may carefully
write Makefiles that use a very minimal feature set of both that happen
to work on any of the two, but they are a lot different too.

> Will the information in the GNU make manual be relevant?

The information in the GNU make manual applies to GNU make.  You can
install GNU make using the ports though:

% pkg_info | grep gmake
gmake-3.80_2GNU version of 'make' utility
% which gmake
/usr/local/bin/gmake
% gmake --version
GNU Make 3.80
Copyright (C) 2002  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
%

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: GNU make

2004-12-28 Thread Lowell Gilbert
Len Zettel <[EMAIL PROTECTED]> writes:

> Are there any serious differences between
> GNU make and the FreeBSD make command?

Yes.

> Will the information in the GNU make
> manual be relevant?

Only if you're using GNU make.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"