~sircmpwn/ctools

ref: 791aeab350c5829056cb3c25b86e80245d532a4f ctools/doc/meson.build -rw-r--r-- 681 bytes
791aeab3Drew DeVault man pages: fix build dependency issues 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
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',
	'false.1',
	'true.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@ > doc/@1@'.format(
				scdoc_prog.path(), output)
		],
		install: true,
		install_dir: '@0@/man@1@'.format(mandir, section)
	)
endforeach