1## Process this file with automake to produce Makefile.in
2# $MirOS: src/gnu/usr.bin/cvs/doc/Makefile.am,v 1.4 2011/12/04 18:53:01 tg Exp $
3# Makefile for GNU CVS documentation (excluding man pages - see ../man).
4#
5# Copyright (C) 1986-2005 The Free Software Foundation, Inc.
6#
7# Portions Copyright (C) 1998-2005 Derek Price, Ximbiot <http://ximbiot.com>,
8#                                  and others.
9
10# This program is free software; you can redistribute it and/or modify
11# it under the terms of the GNU General Public License as published by
12# the Free Software Foundation; either version 2, or (at your option)
13# any later version.
14
15# This program is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18# GNU General Public License for more details.
19
20AM_MAKEINFOFLAGS = --no-split
21
22info_TEXINFOS = cvs.texinfo cvsclient.texi
23man_MANS = cvs.1
24
25PSS = \
26	cvs.ps \
27	cvs-paper.ps \
28	cvsclient.ps
29
30PDFS = \
31	cvs.pdf \
32	cvs-paper.pdf \
33	cvsclient.pdf
34
35TXTS = \
36	cvs.txt \
37	cvsclient.txt
38
39EXTRA_DIST = \
40	$(PSS) \
41	HACKING.DOCS \
42	RCSFILES \
43	cvs.1 \
44	cvs-paper.ms \
45	cvs.man.header \
46	cvs.man.footer \
47	getdate.texi \
48	mdate-sh \
49	writeproxy.rtf
50
51MOSTLYCLEANFILES = \
52	$(TXTS)
53
54DISTCLEANFILES = *.info* texinfo-* cvs.1
55
56# These Automake generates MOSTLYCLEAN targets for PostScripts genersted from
57# TEXINFOS, but it shouldn't when those files are in EXTRA_DIST
58MAINTAINERCLEANFILES = \
59	$(PSS)
60
61doc: info ps
62.PHONY: doc
63
64txt: $(TXTS)
65.PHONY: txt
66
67dvi: cvs.dvi cvsclient.dvi
68.PHONY: dvi
69
70# FIXME-AUTOMAKE:
71# For some reason if I remove version.texi, it doesn't get built automatically.
72# This needs to be fixed in automake.
73cvs.txt: cvs.texinfo $(srcdir)/version.texi
74cvsclient.txt: cvsclient.texi $(srcdir)/version-client.texi
75
76# These targets need to be very specific so that the other PDFs get generated
77# correctly.  If they are more generic and cvs.ps is made before cvs.pdf, then
78# cvs.pdf will be generated from the generic target and the PS source, which
79# contains less information (hyperlinks and such) than the usual texinfo source.
80cvs-paper.ps: cvs-paper.ms
81	$(ROFF) -t -p -ms -Tps $< > $@-t
82	mv $@-t $@
83
84cvs-paper.pdf: cvs-paper.ps
85	ps2pdf $< $@
86
87# Targets to build a man page from cvs.texinfo.
88cvs.1: @MAINTAINER_MODE_TRUE@ mkman cvs.man.header cvs.texinfo cvs.man.footer
89	$(PERL) ./mkman $(srcdir)/cvs.man.header $(srcdir)/cvs.texinfo \
90	        $(srcdir)/cvs.man.footer >$@
91MAINTAINERCLEANFILES += cvs.1
92
93cvs.dvi cvs.html cvs.info cvs.pdf cvs.ps cvs.txt: getdate-cvs.texi
94getdate-cvs.texi: stamp-gdt
95stamp-gdt: $(srcdir)/getdate.texi $(top_srcdir)/configure
96	@echo "@c This file is generated via a rule in Makefile.am from the" \
97	  >getdate-cvs.tmp
98	@echo "@c getdate.texi file." >>getdate-cvs.tmp
99	@echo "@c" >>getdate-cvs.tmp
100	@echo "@c *** DO NOT EDIT THIS FILE DIRECTLY ***" >>getdate-cvs.tmp
101	@echo "@c" >>getdate-cvs.tmp
102	@echo "@c Edit getdate.texi instead." >>getdate-cvs.tmp
103	@echo >>getdate-cvs.tmp
104	sed -e "s/^@chapter /@appendixsec /" \
105	    -e "s/^@section /@appendixsubsec /" \
106	  <$(srcdir)/getdate.texi >>getdate-cvs.tmp
107	@cmp -s getdate-cvs.tmp getdate-cvs.texi \
108	  || (echo "Updating getdate-cvs.texi"; \
109	      cp getdate-cvs.tmp getdate-cvs.texi)
110	-@rm -f getdate-cvs.tmp
111	@echo -n >$@
112DISTCLEANFILES += getdate-cvs.texi stamp-gdt getdate-cvs.tmp
113
114# texinfo based targets automake neglects to include
115SUFFIXES = .txt
116.texinfo.txt:
117	$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
118	 --no-headers -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
119.txi.txt:
120	$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
121	 --no-headers -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
122.texi.txt:
123	$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
124	 --no-headers -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
125
126INSTALL_MAN=install-man
127install-data-am: install-info-am $(INSTALL_MAN)
128
129##
130## MAINTAINER Targets
131##
132
133# for backwards compatibility with the old makefiles
134realclean: maintainer-clean
135.PHONY: realclean
136