~sircmpwn/ctools

ref: 07cc27f5b3c391a52f471b7aed53e697a54a5295 ctools/doc/meson.build -rw-r--r-- 779 bytes
07cc27f5Drew DeVault logname: add man page 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
scdoc_prog = find_program(scdoc.get_pkgconfig_variable('scdoc'), native: true)
sh = find_program('sh', native: true)
mandir = get_option('mandir')

man_files = [
	'basename.1',
	'cat.1',
	'chgrp.1',
	'chown.1',
	'chmod.1',
	'cksum.1',
	'cmp.1',
	'comm.1',
	'link.1',
	'logname.1',
	'false.1',
	'true.1',
	'unlink.1',
]

foreach page : man_files
	filename = page + '.scd'
	topic = filename.split('.')[-3].split('/')[-1]
	section = filename.split('.')[-2]
	output = '@0@.@1@'.format(topic, section)

	custom_target(
		output,
		input: filename,
		output: output,
		command: [
			sh, '-c', '@0@ < @INPUT@ > @1@'.format(
				scdoc_prog.path(),
				join_paths(meson.current_build_dir(), output))
		],
		install: true,
		install_dir: '@0@/man@1@'.format(mandir, section)
	)
endforeach