[cmake-developers] disabling implicit rules ?

Alexander Neundorf neundorf at kde.org
Fri Sep 1 15:23:58 EDT 2006


Hi,

On Thursday 31 August 2006 22:34, Bill Hoffman wrote:
> At 04:21 PM 8/31/2006, Alexander Neundorf wrote:
> >Hi,
> >
> >yesterday I learnt that make has an implicit rule to generate a binary
> > from a file name "*.sh" by simply copying it.
> >For an OpenBSD user this had the effect that he wasn't able to compile
> > (guess what) kdelibs, because simply copied one of the shell wrapper
> > scripts (genembed.sh) to genembed, instead of building genembed. Renaming
> > the file from genembed.sh to genembed.shell helped against this problem.
> >The issue can be reproduced with the attached makefile, simply enter
> > "make" and it will copy the file.
> >Is there a way to disable this implicit rule ?
>
> We are already attempting to do this:
>
> See a build.make file :
>
> # Disable implicit rules so canonical targets will work.
> .SUFFIXES:
>
>
> Some makes are funny about this stuff, and maybe BSD make has
> a different syntax for getting rid of implicit rules.  Or maybe the
> order in the makefile counts.
>
> I did notice that the toplevel Makefile has the .SUFFICES thing much
> lower in the makefile than it used to.  It maybe an inadvertent change.
> Try moving it to the top of the toplevel Makefile and see if it fixes your
> problem.

it is a bug in the OpenBSD make which will be fixed after some release.
I'll have to do something about it nevertheless.
Here's the email:

On Friday 01 September 2006 00:40, Marc Espie wrote:
> On Thu, Aug 31, 2006 at 10:41:10PM +0200, Alexander Neundorf wrote:
> > Hi Marc,
> >
> > can you please try whether the attached makefile creates a file "blah" or
> > whether it reports an error ?
>
> Sorry, my previous email was not clear.
>
> This behavior is a bug in OpenBSD's make. I have a fix for it that will
> be committed right after we release 4.0... we're too far gone in the
> release process to risk it right now.
>
> I'll live with a work-around in KDE in-between. If you want to play safe,
> use .shell for shell extensions. Otherwise, well, it won't compile
> out-of-the-box on OpenBSD up to 4.0 included, but we can live with that.
>
> Up to OpenBSD 4.0, your testcase produces blah.
>
> In my tree, and right after OpenBSD 4.0, it will report an error.
>
>
> Specifically, the way we handle suffixes mean single suffix rules
> are not erased by
> .SUFFIXES:
> as they should.
>
> This was caused by some tweaks in our make to fix some other issues in
> normal bsd-make.
>
> Namely,
> .SUFFIXES:
> used to erase too much (it erased the implicit rules, which is fine, but
> it also erased everything deduced from them before .SUFFIXES, which is
> not). So now, we erase not enough.
>
> I've got a few regression tests, and a fix, but this won't happen before
> 4.0.
-- 
Work: alexander.neundorf AT jenoptik.com - http://www.jenoptik-los.de
Home: neundorf AT kde.org                - http://www.kde.org
      alex AT neundorf.net               - http://www.neundorf.net



More information about the cmake-developers mailing list