Whamcloud - gitweb
Don't just delete the generated PDF.
[fs/lustre-release.git] / lustre / doc / Makefile.am
1 # Copyright (C) 2001, 2002 Cluster File Systems, Inc.
2 #
3 # This code is issued under the GNU General Public License.
4 # See the file COPYING in this distribution
5 LYX2PDF = lyx --export pdf
6 LYX2PS = lyx --export ps
7 LYX2TEX = lyx --export latex
8 LYX2TXT = lyx --export text
9 LYX2HTML = lyx --export html
10 LATEX = latex
11 DVIPS = dvips
12 PS2PDF = ps2pdf
13 TEXEXPAND = texexpand
14 SUFFIXES = .lin .lyx .pdf .ps .sgml .html .txt .tex .fig .eps .dvi
15
16 DOCS = lustre.pdf lustre-HOWTO.txt
17 IMAGES =  sys_open.eps sys_write.eps sys_mount.eps cache1.eps cache2.eps intermezzocache.eps intermezzofilesys.eps meta.eps metadata1.eps networklayer.eps bigpicture.eps intermezzo.eps mds.eps portals.eps client.eps layering.eps metadata.eps sb.eps cow.eps lockacq.eps obdfs.eps snapsetup.eps dirbodyapi.eps loraid.eps ost.eps updates.eps hotmigrate.eps lustreclusters.eps osthw.eps portals-lib.eps lockqueues.eps lockexample1.eps lockexample2.eps lockexample3.eps lockexample4.eps lockseverity.eps gssapi.eps lovextents.eps cpsd.eps setup-accept.eps authenticate.eps login.eps
18 LYXFILES= lustre.lin evolution.lyx  llocks.lyx mgmt.lyx uncertain.lyx\
19         fs.lyx         lustre-HOWTO.lin      namespace.lyx\
20         glossary.lyx   lustre-debugging.lyx  network.lyx\
21         intro.lyx      obdspec.lyx recovery.lyx
22
23 MAINTAINERCLEANFILES =  $(IMAGES) $(DOCS) $(VERSIONED)
24 CLEANFILES = *.aux *.tex doc.old/*.aux doc.old/*.tex *.eps
25 VERSIONED = lustre-HOWTO.lyx lustre.lyx doc.old/lustre-HOWTO.lyx doc.old/lustre.lyx
26 GENERATED = $(VERSIONED) lustre-full.tex lustre-chbar.tex
27
28 EXTRA_DIST = chbar.sh postbar $(DOCS) $(IMAGES) $(LYXFILES) lustre.bib
29
30 all: $(DOCS)
31
32 # update date and version in document
33 date := $(shell date +%x)
34 tag := $(shell echo '$$Name:  $$' | sed -e 's/^\$$Na''me: *\$$$$/HEAD/; s/^\$$Na''me: \(.*\) \$$$$/\1/')
35 addversion = sed -e 's|@T''AG@|$(tag)|g; s|@VER''SION@|$(VERSION)|g; s|@DA''TE@|$(date)|g'
36
37 # Regenerate when the $(VERSION) or $Name:  $ changes.
38 .INTERMEDIATE: $(GENERATED)
39 $(VERSIONED) : %.lyx: %.lin Makefile
40         $(addversion) $< > $@
41
42 .lyx.pdf:
43         @echo $(LYX2PDF) $< && $(LYX2PDF) $< || printf "\n*** Warning: not creating PDF docs; install lyx to rectify this\n"
44
45 .lyx.ps:
46         @echo $(LYX2PS) $< && $(LYX2PS) $< || printf "\n*** Warning: not creating PostScript docs; install lyx to rectify this\n"
47
48 .lyx.tex:
49         @echo $(LYX2TEX) $< && $(LYX2TEX) $< || printf "\n*** Warning: not creating LaTeX docs; install lyx to rectify this\n"
50
51 .lyx.txt:
52         @echo $(LYX2TXT) $< && $(LYX2TXT) $< || printf "\n*** Warning: not creating text docs; install lyx to rectify this\n"
53
54 .lyx.html:
55         @echo $(LYX2HTML) $< && $(LYX2HTML) $< || printf "\n*** Warning: not creating HTML docs; install lyx to rectify this\n"
56
57 .tex.dvi:
58         $(LATEX) $<
59         $(LATEX) $<
60
61 .dvi.ps:
62         $(DVIPS) $< -o $@
63
64 .ps.pdf:
65         $(PS2PDF) $< $@
66
67 lustre.tex lustre.pdf lustre.txt lustre.html: $(IMAGES) lustre-HOWTO.lyx
68 .fig.eps:
69         -fig2dev -L eps $< > $@
70
71 syncweb: lustre.pdf
72         cp lustre.pdf /usr/src/www/content/lustre/docs/lustre.pdf
73         ( cd /usr/src/www ; make lustre ; make synclustre )
74 .PHONY: syncweb chbar
75
76 # Build a changebar document from the files in doc.old and this directory.
77 chbar: lustre-chbar.pdf
78
79 lustre-chbar.tex: chbar.sh postbar doc.old/lustre-full.tex lustre-full.tex
80         $(SHELL) $(srcdir)/chbar.sh doc.old/lustre-full.tex lustre-full.tex | $(srcdir)/postbar > $@
81
82 lustre-full.tex: lustre.tex
83         $(TEXEXPAND) -texinputs=. -texinputs=$(srcdir) -output=$@ $<
84
85 doc.old/lustre.tex: doc.old/lustre-HOWTO.lyx
86 doc.old/lustre-full.tex: doc.old/lustre.tex
87         cd doc.old && $(TEXEXPAND) -texinputs=. -output=lustre-full.tex lustre.tex
88
89 # Check out the old directory if it doesn't exist.
90 doc.old/lustre.lin doc.old/lustre-HOWTO.lin:
91         @if test "X$(OLD)" = X; then \
92           echo "You must populate doc.old or specify a CVS tag like OLD=v0_5_1"; \
93           exit 1; \
94         fi
95         rm -rf doc.old
96         mkdir doc.old
97         cvs checkout -r $(OLD) -d doc.old lustre/doc
98
99 dist-hook:
100         rm -rf $(distdir)/figs/CVS
101
102 include $(top_srcdir)/Rules