Documentation issue

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Documentation issue

Peter Marshall

Hello,

I think I found a documentation issue in the GNU make manual. Section 5.3 of the GNU make manual implies that $(@D) and $(@F) expand to the prerequisite path and file respectively, but section 10.5.3 says they expand according to the filename of the target. https://www.gnu.org/software/make/manual/make.html#Execution

See the following excerpts from the manual:

5.3 Recipe Execution

foo : bar/lose

        cd $(@D) && gobble $(@F) > ../$@


10.5.3 Automatic Variables

‘$(@D)’

The directory part of the file name of the target, with the trailing slash removed. If the value of ‘$@’ is dir/foo.o then ‘$(@D)’ is dir. This value is . if ‘$@’ does not contain a slash.

$(@F)

The file-within-directory part of the file name of the target. If the value of ‘$@’ is dir/foo.o then ‘$(@F)’ is foo.o. ‘$(@F)’ is equivalent to ‘$(notdir $@)’.


Thanks,

Peter


_______________________________________________
Bug-make mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-make
Reply | Threaded
Open this post in threaded view
|

Re: Documentation issue

Paul Smith-20
On Thu, 2019-09-05 at 16:49 -0400, Peter Marshall wrote:
> 5.3 Recipe Execution
>
> foo : bar/lose
>         cd $(@D) && gobble $(@F) > ../$@

Indeed this is incorrect.  I've updated the manual.

Thanks for mentioning this!


_______________________________________________
Bug-make mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-make