groff
[Top][All Lists]
Advanced

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

an angry rant about *BSD Make


From: G. Branden Robinson
Subject: an angry rant about *BSD Make
Date: Wed, 30 Mar 2022 05:23:26 +1100
User-agent: NeoMutt/20180716

Here is a comment in a forthcoming commit to groff's doc/doc.am file.

# Generating *.me from *.me.in is, surprisingly, a challenge.
# 1.  A pattern rule ("%.me: %.me.in") is not portable to NetBSD or
#     OpenBSD make.
# 2.  A double-suffix rule won't work because the semantics of the rule
#     are that the suffix is replaced, not removed.
# 3.  A single-suffix rule works in an isolated Makefile, but _only_
#     with the .SUFFIXES special target, not with the SUFFIXES macro.
#     (Is the latter a bug?)
#       .SUFFIXES: .in
#       .in:
#               $(DOC_SED) $< >$@
#
# (One can raise a valid complaint that the above may be too general.)
#
# But...
#
# 4.  GNU Automake insists that we use the SUFFIXES macro and not the
#     special target.
#       error: use variable 'SUFFIXES', not target '.SUFFIXES'
# 5.  So we have to use target rules, and explicitly write the first
#     dependency name in the rule commands because NetBSD make (and
#     reportedly OpenBSD) refuses to honor the $< variable in target
#     rules.
#
# Yuck!
#
# Yes, I could work around this by renaming the depended upon files to
# destroy information, or to use confusing sigils instead of periods.
# But I won't--the meaning of, for instance, "meintro.me.in", is clear.
#
# This rigamarole by itself justifies to me the worth of pattern rules
# (which require neither '.SUFFIXES' nor 'SUFFIXES') and establishing
# semantics for $< in target rules.  But I won't hold my breath waiting
# on make(1) implementors to agree.

Regards,
Branden

Attachment: signature.asc
Description: PGP signature


reply via email to

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