Imported Upstream version 0.10.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
7
8 MAN1=   zipcmp.mdoc zipmerge.mdoc ziptorrent.mdoc
9 MAN3=   libzip.mdoc \
10         zip_add.mdoc \
11         zip_add_dir.mdoc \
12         zip_close.mdoc \
13         zip_delete.mdoc \
14         zip_error_clear.mdoc \
15         zip_error_get.mdoc \
16         zip_error_get_sys_type.mdoc \
17         zip_error_to_str.mdoc \
18         zip_errors.mdoc \
19         zip_fclose.mdoc \
20         zip_fdopen.mdoc \
21         zip_file_strerror.mdoc \
22         zip_fopen.mdoc \
23         zip_fopen_encrypted.mdoc \
24         zip_fread.mdoc \
25         zip_get_archive_comment.mdoc \
26         zip_get_archive_flag.mdoc \
27         zip_get_file_comment.mdoc \
28         zip_get_file_extra.mdoc \
29         zip_get_name.mdoc \
30         zip_get_num_entries.mdoc \
31         zip_get_num_files.mdoc \
32         zip_name_locate.mdoc \
33         zip_open.mdoc \
34         zip_rename.mdoc \
35         zip_set_archive_comment.mdoc \
36         zip_set_archive_flag.mdoc \
37         zip_set_default_password.mdoc \
38         zip_set_file_comment.mdoc \
39         zip_set_file_extra.mdoc \
40         zip_source_buffer.mdoc \
41         zip_source_file.mdoc \
42         zip_source_filep.mdoc \
43         zip_source_free.mdoc \
44         zip_source_function.mdoc \
45         zip_source_zip.mdoc \
46         zip_stat.mdoc \
47         zip_stat_init.mdoc \
48         zip_unchange.mdoc \
49         zip_unchange_all.mdoc \
50         zip_unchange_archive.mdoc
51
52 install-data-hook: link-man3
53
54 LN=ln
55
56 link-man3: install-man3 uninstall-hook
57         ${LN} ${DESTDIR}${man3dir}/zip_error_clear.3 \
58                 ${DESTDIR}${man3dir}/zip_file_error_clear.3
59         ${LN} ${DESTDIR}${man3dir}/zip_error_get.3 \
60                 ${DESTDIR}${man3dir}/zip_file_error_get.3
61         ${LN} ${DESTDIR}${man3dir}/zip_fopen.3 \
62                 ${DESTDIR}${man3dir}/zip_fopen_index.3
63         ${LN} ${DESTDIR}${man3dir}/zip_fopen_encrypted.3 \
64                 ${DESTDIR}${man3dir}/zip_fopen_index_encrypted.3
65         ${LN} ${DESTDIR}${man3dir}/zip_add.3 \
66                 ${DESTDIR}${man3dir}/zip_replace.3
67         ${LN} ${DESTDIR}${man3dir}/zip_stat.3 \
68                 ${DESTDIR}${man3dir}/zip_stat_index.3
69         ${LN} ${DESTDIR}${man3dir}/zip_file_strerror.3 \
70                 ${DESTDIR}${man3dir}/zip_strerror.3
71
72 uninstall-hook:
73         -rm -f ${DESTDIR}${man3dir}/zip_file_error_clear.3
74         -rm -f ${DESTDIR}${man3dir}/zip_file_error_get.3
75         -rm -f ${DESTDIR}${man3dir}/zip_fopen_index.3
76         -rm -f ${DESTDIR}${man3dir}/zip_fopen_index_encrypted.3
77         -rm -f ${DESTDIR}${man3dir}/zip_replace.3
78         -rm -f ${DESTDIR}${man3dir}/zip_stat_index.3
79         -rm -f ${DESTDIR}${man3dir}/zip_strerror.3
80
81 link-html: ${HTML}
82         -rm -f zip_file_error_get.html zip_fopen_index.html \
83                 zip_fopen_index_encrypted \
84                 zip_replace.html zip_stat_index.html \
85                 zip_strerror.html
86         ${LN} zip_error_get.html zip_file_error_get.html
87         ${LN} zip_fopen.html zip_fopen_index.html
88         ${LN} zip_fopen_encrypted.html zip_fopen_index_encrypted.html
89         ${LN} zip_add.html zip_replace.html
90         ${LN} zip_stat.html zip_stat_index.html
91         ${LN} zip_file_strerror.html zip_strerror.html
92
93 MANDOC=${MAN1} ${MAN3}
94 HTML=${MANDOC:.mdoc=.html}
95 MAN=${MANDOC:.mdoc=.man}
96
97 MDOC2MAN=mdoc2man
98 SUFFIXES=.man .mdoc .html
99
100 .PHONY: mkman update-errors
101
102 mkman: ${MAN}
103 mkhtml: ${HTML} link-html
104
105 update-errors:
106         sh $(srcdir)/make_zip_errors.sh $(srcdir)/../lib/zip.h zip_errors.mdoc
107
108 .mdoc.man:
109         ${MDOC2MAN} $< > $@.$$$$ && mv $@.$$$$ $@
110
111 .mdoc.html:
112         mandoc -Thtml -Oman="%N.html",style=../nih-man.css $< > $@.$$$$ && mv $@.$$$$ $@