~sircmpwn/ctools

ref: 757f8ea4ad84097e7a2418b1eed35366f78d8a46 ctools/doc/meson.build -rw-r--r-- 765 bytes
757f8ea4Drew DeVault test/unlink: use hardlink instead of symlink 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
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',
	'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