make single-suffix inference rules ignored for paths with slashes

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

make single-suffix inference rules ignored for paths with slashes

Christopher Wellons

OpenBSD "make" does not correctly apply single-suffix inference rules
to paths containing slashes. Double-suffix inference rules work
correctly in this situation. Here's a little demonstration, starting
with a double-suffix inference rule and a sub-directory:

    $ mkdir a
    $ touch a/foo.abc
    $ cat > Makefile
    .SUFFIXES: .abc .xyz
    a/foo.xyz: a/foo.abc
    .abc.xyz:
    cp $< $@
    ^D
    $ make
    cp a/foo.abc a/foo.xyz
    $

The inference rule was correctly applied to the a/foo.xyz target. So
far so good. Next, a single-suffix inference rule without a directory:

    $ touch bar.abc
    $ cat > Makefile
    .SUFFIXES: .abc
    bar: bar.abc
    .abc:
    cp $< $@
    ^D
    $ make
    cp bar.abc bar
    $

Also correct. But now apply the same situation to a sub-directory:

    $ mkdir b
    $ touch b/baz.abc
    $ cat > Makefile
    .SUFFIXES: .abc
    b/baz: b/baz.abc
    .abc:
    cp $< $@
    ^D
    $ make
    $

The inference rule does not fire and nothing is built. It looks like
this bug has been fixed, probably by accident, in other forks of bmake,
such as in FreeBSD (which works correctly for all three examples).

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: make single-suffix inference rules ignored for paths with slashes

Marc Espie-2
I've looked at this. So far no real clue.
The maddening thing is that the code that triggers single suffix in
the non directory case is the same in freebsd's bmake and ours,
so obviously it doesn't trigger when there's an extra directory, as
the paths don't match.

I'll have to check if there's some sanitization of prefix that I haven't
found yet.

Still the most convoluted part of that program... :(

Loading...