aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-10-13 03:42:37 +0000
committer_ov4 <ov4@ov4.org>2026-10-13 03:42:37 +0000
commitf0780bf173ddfdb7ebbf2c7cd2ffd2e447379a65 (patch)
treec1166c3a6eafc192cef4673c14066b2a8019e8a8
parenta0169ee98152d78054dac51a908f1ae718d6ca3e (diff)
build: place generated man page under build/doc
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
-rw-r--r--CMakeLists.txt7
-rw-r--r--README.md7
2 files changed, 7 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b230fe5..e63860b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -44,12 +44,13 @@ target_link_libraries(cpsc
)
add_custom_command(
- OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/cpsc.1"
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/doc/cpsc.1"
+ COMMAND "${CMAKE_COMMAND}" -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/doc"
COMMAND pandoc --standalone --from=markdown --to=man
"${CMAKE_CURRENT_SOURCE_DIR}/doc/cpsc.md"
- --output "${CMAKE_CURRENT_BINARY_DIR}/cpsc.1"
+ --output "${CMAKE_CURRENT_BINARY_DIR}/doc/cpsc.1"
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/doc/cpsc.md"
COMMENT "Generating cpsc(1) manual"
VERBATIM
)
-add_custom_target(doc DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/cpsc.1")
+add_custom_target(doc DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/doc/cpsc.1")
diff --git a/README.md b/README.md
index ba4132c..5f8a223 100644
--- a/README.md
+++ b/README.md
@@ -103,8 +103,7 @@ if execution fails.
## Manual
-The command-line quick reference is in `doc/cpsc.md`. Generating the man page
-requires Pandoc; ordinary builds do not.
+The command-line quick reference is in `doc/cpsc.md`. Generating the man page requires Pandoc; ordinary builds do not.
From the project root on Linux:
@@ -112,11 +111,11 @@ From the project root on Linux:
sudo apt-get install pandoc
cmake -S . -B build
make -C build doc
-man ./build/cpsc.1
+man ./build/doc/cpsc.1
```
You can also run `make doc` inside the configured `build/` directory.
-The output is `build/cpsc.1` and is regenerated when the Markdown source changes.
+The output is `build/doc/cpsc.1` and is regenerated when the Markdown source changes.
# Note