summaryrefslogtreecommitdiff
path: root/pkg/mandoc/gen.lua
blob: 8ce4e84f560f394319e9c0a061c8788909bf2b00 (plain)
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
cflags{
	'-I $dir',
	'-I pkg/openbsd/include',
	'-I $builddir/pkg/zlib/include',
}

lib('libmandoc.a', {
	'man.c',
	'man_macro.c',
	'man_validate.c',

	'att.c',
	'lib.c',
	'mdoc.c',
	'mdoc_argv.c',
	'mdoc_macro.c',
	'mdoc_state.c',
	'mdoc_validate.c',
	'st.c',

	'eqn.c',
	'roff.c',
	'roff_validate.c',
	'tbl.c',
	'tbl_data.c',
	'tbl_layout.c',
	'tbl_opts.c',

	'chars.c',
	'mandoc.c',
	'mandoc_aux.c',
	'mandoc_ohash.c',
	'mandoc_xr.c',
	'msec.c',
	'preconv.c',
	'read.c',

	'compat_fts.c',
	'compat_ohash.c',
}, {'pkg/zlib/headers'})

exe('mandoc', {
	'main.c',
	'manpath.c',
	'mdoc_man.c',
	'mdoc_markdown.c',
	'out.c',
	'tag.c',
	'tree.c',

	'eqn_html.c',
	'html.c',
	'man_html.c',
	'mdoc_html.c',
	'roff_html.c',
	'tbl_html.c',

	'eqn_term.c',
	'man_term.c',
	'mdoc_term.c',
	'roff_term.c',
	'term.c',
	'term_ascii.c',
	'term_ps.c',
	'term_tab.c',
	'tbl_term.c',

	'dbm.c',
	'dbm_map.c',
	'mansearch.c',

	'dba.c',
	'dba_array.c',
	'dba_read.c',
	'dba_write.c',
	'mandocdb.c',

	'libmandoc.a',
	'$builddir/pkg/openbsd/libbsd.a',
	'$builddir/pkg/zlib/libz.a',
})
file('bin/mandoc', '755', '$outdir/mandoc')
for _, cmd in ipairs{'apropos', 'man', 'whatis', 'makewhatis'} do
	sym('bin/'..cmd, 'mandoc')
end

exe('demandoc', {
	'demandoc.c',
	'libmandoc.a',
	'$builddir/pkg/openbsd/libbsd.a',
	'$builddir/pkg/zlib/libz.a',
})
file('bin/demandoc', '755', '$outdir/demandoc')

man{
	'mandoc.1',
	'demandoc.1',
	'man.1',
	'apropos.1',

	'man.conf.5',
	'mandoc.db.5',

	'man.7',
	'mdoc.7',
	'roff.7',
	'eqn.7',
	'tbl.7',
	'mandoc_char.7',

	'makewhatis.8',
}
sym('share/man/man1/whatis.1.gz', 'apropos.1.gz')

fetch 'curl'