automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: convert a pattern rule to a suffix rule


From: Ralf Wildenhues
Subject: Re: convert a pattern rule to a suffix rule
Date: Wed, 25 Aug 2010 20:37:04 +0200
User-agent: Mutt/1.5.20 (2010-04-22)

Hello,

* YuGiOhJCJ Mailing-List wrote on Wed, Aug 25, 2010 at 11:14:15AM CEST:
> I know that pattern rules are not portable. When we use one pattern
> rule, then we call autoreconf, we can see this warning :
> man/Makefile.am:8: `%'-style pattern rules are a GNU make extension
> So if we want a protable project, we should not use them in a Makefile.am 
> file.

Or you use -Wno-portability to silence the warning, and require GNU
make for building your project.

> But we can use a old fashioned suffix rule which is portable. The
> problem is when the prerequisites arn't in the same directory than the
> target and when the prerequisites have no suffix.

Then you cannot use suffix rules in a portable way, unfortunately;
you can get around the directory fairly portably by setting something
like
  VPATH = @srcdir@:../src:@srcdir@/../src

in the Makefile.am and then forget about the directory (but you need a
new Autoconf for this to work because we recently found an Autoconf bug
in this area), but single suffix rules work the other way round; see for
example `info Autoconf "Single Suffix Rules"'.

If you don't want to require GNU make, the only fully portable way I
know is to spell out the rule for each target.

Hope that helps.

Cheers,
Ralf



reply via email to

[Prev in Thread] Current Thread [Next in Thread]