Skip to content

Commit

Permalink
automake: use POSIX make syntax
Browse files Browse the repository at this point in the history
POSIX provides a shorthand for notdir-like functionality.
Use that instead of recommending GNU Make specific syntax.

https://pubs.opengroup.org/onlinepubs/9699919799/utilities/make.html
> Each of the internal macros has an alternative form. When an uppercase
> 'D' or 'F' is appended to any of the macros, the meaning shall be changed
> to the directory part for 'D' and filename part for 'F'.
  • Loading branch information
vapier committed Nov 5, 2022
1 parent f8ecee4 commit e9aaba7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions chapters/automake/nonrecursive.xmli
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = pkgconfig/foo.pc pkgconfig/foo-bar.pc
%-bar.pc: %.pc
$(LN_S) $^ $@
$(LN_S) $< $@
]]></programlisting>

<para>
Expand All @@ -235,9 +235,8 @@ pkgconfig_DATA = pkgconfig/foo.pc pkgconfig/foo-bar.pc
</para>

<para>
To avoid this kind of problem, you can make use of
<application>GNU make</application> extended functions in the
rules, to transform the path from full-relative form to base
To avoid this kind of problem, you can make use of the alternative
forms to transform the path from full-relative form to base
form (without the path). For instance the fragment above should
be replaced by the following:
</para>
Expand All @@ -247,7 +246,7 @@ pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = pkgconfig/foo.pc pkgconfig/foo-bar.pc
%-bar.pc: %.pc
$(LN_S) $(notdir $^) $@
$(LN_S) $(<F) $@
]]></programlisting>
</section>
</section>
Expand Down
2 changes: 1 addition & 1 deletion chapters/automake/silent.xmli
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])

<programlisting><![CDATA[
%-bar.pc: %.pc
$(AM_V_GEN)$(LN_S) $(notdir $^) $@
$(AM_V_GEN)$(LN_S) $(<F) $@
]]></programlisting>
</example>
</section>
Expand Down

0 comments on commit e9aaba7

Please sign in to comment.