aboutsummaryrefslogtreecommitdiff
path: root/doc/meson.build
diff options
context:
space:
mode:
Diffstat (limited to 'doc/meson.build')
-rw-r--r--doc/meson.build41
1 files changed, 12 insertions, 29 deletions
diff --git a/doc/meson.build b/doc/meson.build
index 26e5d6c..6490969 100644
--- a/doc/meson.build
+++ b/doc/meson.build
@@ -1,33 +1,16 @@
-scdoc = find_program('scdoc', required: get_option('manpage'), disabler: true)
-if scdoc.found()
+if not get_option('manpage')
+ subdir_done()
+endif
sh = find_program('sh', required: true, native: true, disabler: true)
-man_files = ['man/smolbote.1.scd', 'man/smolbote.5.scd']
-
-foreach input : man_files
- topic = input.split('/')[-1].split('.')[-3]
- section = input.split('.')[-2]
- output = '@0@.@1@'.format(topic, section)
-
- message('creating manpage target ' + output)
- custom_target(output,
- build_by_default: true,
-
- input: input,
- output: output,
-
- # scdoc takes input from stdin, and prints its output to stdout
- # meson uses 'capture' to store stdout to output, but there is no stdin toggle
- #command: [scdoc],
- #capture: true,
-
- # workaround using sh
- command: [sh, '-c', '@0@ < @INPUT0@ > @OUTPUT0@'.format(scdoc.path())],
-
- install: true,
- install_dir: '@0@/man@1@'.format(get_option('mandir'), section)
- )
+foreach f : [ 'smolbote.1', 'smolboterc.5', 'smolbote-profile.5' ]
+manpage = custom_target(f,
+ input: 'man'/f+'.scd',
+ output: '@BASENAME@',
+ capture: true,
+ command: [ sh, meson.current_source_dir()/'man/genroff.sh', '@INPUT@' ],
+ install: true,
+ install_dir: get_option('mandir')
+)
endforeach
-
-endif # manpage