Imported Upstream version 1.0.1
[platform/upstream/libzip.git] / man / Makefile.am
1 MANFMT=@MANFMT@
2 man1_MANS=${MAN1:.mdoc=.${MANFMT}}
3 man3_MANS=${MAN3:.mdoc=.${MANFMT}}
4
5 DISTCLEANFILES=${HTML}
6 EXTRA_DIST=${MANDOC} ${MAN} CMakeLists.txt handle_links links
7
8 MAN1=   zipcmp.mdoc zipmerge.mdoc
9 MAN3=   \
10         ZIP_SOURCE_GET_ARGS.mdoc \
11         libzip.mdoc \
12         zip_add.mdoc \
13         zip_add_dir.mdoc \
14         zip_close.mdoc \
15         zip_delete.mdoc \
16         zip_dir_add.mdoc \
17         zip_discard.mdoc \
18         zip_error_clear.mdoc \
19         zip_error_code_system.mdoc \
20         zip_error_code_zip.mdoc \
21         zip_error_fini.mdoc \
22         zip_error_get.mdoc \
23         zip_error_get_sys_type.mdoc \
24         zip_error_init.mdoc \
25         zip_error_set.mdoc \
26         zip_error_strerror.mdoc \
27         zip_error_system_type.mdoc \
28         zip_error_to_data.mdoc \
29         zip_error_to_str.mdoc \
30         zip_errors.mdoc \
31         zip_fclose.mdoc \
32         zip_fdopen.mdoc \
33         zip_file_add.mdoc \
34         zip_file_extra_field_delete.mdoc \
35         zip_file_extra_field_get.mdoc \
36         zip_file_extra_field_set.mdoc \
37         zip_file_extra_fields_count.mdoc \
38         zip_file_get_comment.mdoc \
39         zip_file_get_error.mdoc \
40         zip_file_get_external_attributes.mdoc \
41         zip_file_rename.mdoc \
42         zip_file_set_comment.mdoc \
43         zip_file_set_external_attributes.mdoc \
44         zip_file_set_mtime.mdoc \
45         zip_file_strerror.mdoc \
46         zip_fopen.mdoc \
47         zip_fopen_encrypted.mdoc \
48         zip_fread.mdoc \
49         zip_get_archive_comment.mdoc \
50         zip_get_archive_flag.mdoc \
51         zip_get_error.mdoc \
52         zip_get_file_comment.mdoc \
53         zip_get_name.mdoc \
54         zip_get_num_entries.mdoc \
55         zip_get_num_files.mdoc \
56         zip_name_locate.mdoc \
57         zip_open.mdoc \
58         zip_rename.mdoc \
59         zip_set_archive_comment.mdoc \
60         zip_set_archive_flag.mdoc \
61         zip_set_default_password.mdoc \
62         zip_set_file_comment.mdoc \
63         zip_set_file_compression.mdoc \
64         zip_source.mdoc \
65         zip_source_begin_write.mdoc \
66         zip_source_buffer.mdoc \
67         zip_source_close.mdoc \
68         zip_source_commit_write.mdoc \
69         zip_source_error.mdoc \
70         zip_source_file.mdoc \
71         zip_source_filep.mdoc \
72         zip_source_free.mdoc \
73         zip_source_function.mdoc \
74         zip_source_is_deleted.mdoc \
75         zip_source_keep.mdoc \
76         zip_source_make_command_bitmap.mdoc \
77         zip_source_open.mdoc \
78         zip_source_read.mdoc \
79         zip_source_rollback_write.mdoc \
80         zip_source_seek.mdoc \
81         zip_source_seek_compute_offset.mdoc \
82         zip_source_seek_write.mdoc \
83         zip_source_stat.mdoc \
84         zip_source_tell.mdoc \
85         zip_source_tell_write.mdoc \
86         zip_source_win32a.mdoc \
87         zip_source_win32handle.mdoc \
88         zip_source_win32w.mdoc \
89         zip_source_write.mdoc \
90         zip_source_zip.mdoc \
91         zip_stat.mdoc \
92         zip_stat_init.mdoc \
93         zip_unchange.mdoc \
94         zip_unchange_all.mdoc \
95         zip_unchange_archive.mdoc
96
97 install-data-hook: link-man3
98
99 LN=ln -f
100
101 link-man3: install-man3 uninstall-hook
102         @${srcdir}/handle_links install directory=${DESTDIR}${man3dir} extension=3 command="${LN}" file=${srcdir}/links
103
104 uninstall-hook:
105         @${srcdir}/handle_links uninstall directory=${DESTDIR}${man3dir} extension=3 command="rm -f" file=${srcdir}/links
106
107 link-html: ${HTML}
108         @${srcdir}/handle_links uninstall directory=. extension=html command="rm -f" file=${srcdir}/links
109         @${srcdir}/handle_links install directory=. extension=html command="${LN}" file=${srcdir}/links
110
111 MANDOC=${MAN1} ${MAN3}
112 HTML=${MANDOC:.mdoc=.html}
113 MAN=${MANDOC:.mdoc=.man}
114
115 SUFFIXES=.man .mdoc .html
116
117 .PHONY: mkman update-errors
118
119 mkman: ${MAN}
120 mkhtml: ${HTML} link-html
121
122 mkdocset: mkdocset.pl ${HTML}
123         SRCDIR=${srcdir} perl ${srcdir}/mkdocset.pl ${HTML}
124
125 update-errors:
126         sh $(srcdir)/make_zip_errors.sh $(srcdir)/../lib/zip.h zip_errors.mdoc
127
128 .mdoc.man:
129         mandoc -T man $< | sed '/TH/s,"NetBSD [^"]*","NiH",' > $@.$$$$ && mv $@.$$$$ $@
130
131 .mdoc.html:
132         mandoc -Thtml -Oman="%N.html",style=../nih-man.css $< | ${srcdir}/fix-man-links.sh > $@.$$$$ && mv $@.$$$$ $@