Clean up `make man` target and normalize man page
enhancement
The `make man` target has a couple bummers, in both its execution and results.
* Regenerating the `cowthink.1` symlink in the build is crude, especially in its interaction with Asciidoctor and how it wants to use a roff include macro instead of a symlink.
* The generated man pages include the date they were generated.
* The generated man pages include the Asciidoctor version.
* The generated man pages don't include the cowsay version.
This ticket is based on one of the items in [PR #45 "Install doc files"](https://github.com/cowsay-org/cowsay/pull/45). That has a change that fixes up the above issues, except for adding the cowsay version. It's split out here so it can be worked on independently of the other items in that PR. It may need a bit of refinement.
## Details
From Hans's comments in the original commit in that PR:
```
Clean up the make recipe which updates the man page:
* There is no need for an additional dependency of
.PHONY target "man" to depend on the adoc file which
the "cowsay.1" target already depends on.
* We do not touch the man/man1/cowthink.1 symlink in any
make recipe any more.
* We have asciidoctor put its results into a temporary
directory, and then move only the cowsay.1 file from
there to the make target. So the make recipe only updates
one file, and we avoid the need to think about generating
files as side effects.
Also, we only need to update the man page if it has actually
changed. A change to the Asciidoctor version or to the current
date does not count as an actual change, so we normalize those
away before deciding whether to update cowsay.1 or not.
```
## Progress
Work is on the [`cleaner-make-man` branch](https://github.com/cowsay-org/cowsay/tree/cleaner-make-man).
关闭于 2024-12-01 5 条评论