diff options
author | Yang Tse <yangsita@gmail.com> | 2009-05-21 17:40:19 +0000 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2009-05-21 17:40:19 +0000 |
commit | 4c979aa44f63a55311e03bce942067375b67acef (patch) | |
tree | 90187a830f396c7a4f779b1a1e4b0ac86c796890 /ares/Makefile.am | |
parent | 274dc3ecac321d13b25289f7401b20681ceec194 (diff) |
Allow generation of .html and .pdf versions of c-ares man pages.
Diffstat (limited to 'ares/Makefile.am')
-rw-r--r-- | ares/Makefile.am | 46 |
1 files changed, 45 insertions, 1 deletions
diff --git a/ares/Makefile.am b/ares/Makefile.am index 373669ca3..de2ae90e7 100644 --- a/ares/Makefile.am +++ b/ares/Makefile.am @@ -46,7 +46,9 @@ noinst_PROGRAMS =$(PROGS) EXTRA_DIST = AUTHORS CHANGES README.cares Makefile.inc Makefile.dj \ Makefile.m32 Makefile.netware Makefile.vc6 $(man_MANS) $(MSVCFILES) \ config-win32.h RELEASE-NOTES libcares.pc.in buildconf get_ver.awk maketgz \ - TODO ares_build.h.in buildconf.bat + TODO ares_build.h.in buildconf.bat $(PDFPAGES) + +CLEANFILES = $(PDFPAGES) $(HTMLPAGES) DISTCLEANFILES = ares_build.h @@ -111,6 +113,48 @@ adig_LDADD = $(top_builddir)/$(lib_LTLIBRARIES) acountry_SOURCES = acountry.c ares_getopt.c ares_getopt.h acountry_LDADD = $(top_builddir)/$(lib_LTLIBRARIES) +SOURCEDMANDIR = man3 +SOURCEDMANPAGES = ares_init.3 +SOURCINGMANPAGES = ares_init_options.3 + +clean-local: clean-sourced-manpages + +clean-sourced-manpages: + @srcdmandir='$(SOURCEDMANDIR)'; \ + echo "rm -rf $(top_builddir)/$$srcdmandir"; \ + rm -rf $(top_builddir)/$$srcdmandir + +sourced-manpages: clean-sourced-manpages + @srcdmandir='$(SOURCEDMANDIR)'; \ + srcdmanfiles='$(SOURCEDMANPAGES)'; \ + mkdir $(top_builddir)/$$srcdmandir; \ + for file in $$srcdmanfiles; do \ + if test -f $(top_srcdir)/$$file; then \ + echo "cp $(top_srcdir)/$$file $(top_builddir)/$$srcdmandir/$$file"; \ + cp $(top_srcdir)/$$file $(top_builddir)/$$srcdmandir/$$file; \ + fi; \ + done + +$(SOURCINGMANPAGES): sourced-manpages + +MAN2HTML = roffit --mandir=. < $< >$@ + +SUFFIXES = .3 .html + +html: $(HTMLPAGES) + +.3.html: + $(MAN2HTML) + +pdf: $(PDFPAGES) + +.3.pdf: + @(foo=`echo $@ | sed -e 's/\.[0-9]$$//g'`; \ + groff -Tps -man $< >$$foo.ps; \ + ps2pdf $$foo.ps $@; \ + rm $$foo.ps; \ + echo "converted $< to $@") + # Make files named *.dist replace the file without .dist extension dist-hook: find $(distdir) -name "*.dist" -exec rm {} \; |