Whamcloud - gitweb
b8ee44775f380bdb3ff3ba6a947f7c833fc9d059
[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 = tex2pdf -overwrite
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_stat.eps sys_odirect.eps 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 # These variables are set by lbuild/check-build.
33 RPMRELEASE ?= RELEASE
34 KERNTYPE ?= chaos
35 KERNRPM ?= kernel-2.4.18lustre13-RELEASE.i386.rpm
36
37 # update date and version in document
38 date := $(shell date +%x)
39 tag := $(shell echo '$$Name:  $$' | sed -e 's/^\$$Na''me: *\$$$$/HEAD/; s/^\$$Na''me: \(.*\) \$$$$/\1/')
40 addversion = sed -e 's|@T''AG@|$(tag)|g; s|@VER''SION@|$(VERSION)|g; s|@DA''TE@|$(date)|g; s|@RPM''RELEASE@|$(RPMRELEASE)|g; s|@KERN''TYPE@|$(KERNTYPE)|g; s|@KERN''RPM@|$(KERNRPM)|g'
41
42 # Regenerate when the $(VERSION) or $Name:  $ changes.
43 .INTERMEDIATE: $(GENERATED)
44 $(VERSIONED) : %.lyx: %.lin Makefile
45         $(addversion) $< > $@
46
47 .lyx.pdf:
48         @echo $(LYX2PDF) $< && $(LYX2PDF) $< || printf "\n*** Warning: not creating PDF docs; install lyx to rectify this\n"
49
50 .lyx.ps:
51         @echo $(LYX2PS) $< && $(LYX2PS) $< || printf "\n*** Warning: not creating PostScript docs; install lyx to rectify this\n"
52
53 .lyx.tex:
54         @echo $(LYX2TEX) $< && $(LYX2TEX) $< || printf "\n*** Warning: not creating LaTeX docs; install lyx to rectify this\n"
55
56 .lyx.txt:
57         @echo $(LYX2TXT) $< && $(LYX2TXT) $< || printf "\n*** Warning: not creating text docs; install lyx to rectify this\n"
58
59 .lyx.html:
60         @echo $(LYX2HTML) $< && $(LYX2HTML) $< || printf "\n*** Warning: not creating HTML docs; install lyx to rectify this\n"
61
62 .tex.dvi:
63         $(LATEX) $<
64         $(LATEX) $<
65
66 .dvi.ps:
67         $(DVIPS) $< -o $@
68
69 .ps.pdf:
70         $(PS2PDF) $< $@
71
72 lustre.tex lustre.pdf lustre.txt lustre.html: $(IMAGES) lustre-HOWTO.lyx
73 .fig.eps:
74         -fig2dev -L eps $< > $@
75
76 syncweb: lustre.pdf
77         cp lustre.pdf /usr/src/www/content/lustre/docs/lustre.pdf
78         ( cd /usr/src/www ; make lustre ; make synclustre )
79 .PHONY: syncweb chbar
80
81 # Build a changebar document from the files in doc.old and this directory.
82 chbar: lustre-chbar.pdf
83
84 %-chbar.tex: chbar.sh postbar doc.old/%-full.tex %-full.tex
85         $(SHELL) $(srcdir)/chbar.sh doc.old/$*-full.tex $*-full.tex | $(srcdir)/postbar > $@
86
87 %-full.tex: %.tex
88         $(TEXEXPAND) -texinputs=. -texinputs=$(srcdir) -output=$@ $<
89
90 doc.old/lustre.tex: doc.old/lustre-HOWTO.lyx
91 doc.old/%-full.tex: doc.old/%.tex
92         cd doc.old && $(TEXEXPAND) -texinputs=. -output=$*-full.tex $*.tex
93
94 # Check out the old directory if it doesn't exist.
95 doc.old/lustre.lin doc.old/lustre-HOWTO.lin:
96         @if test "X$(OLD)" = X; then \
97           echo "You must populate doc.old or specify a CVS tag like OLD=v0_5_1"; \
98           exit 1; \
99         fi
100         rm -rf doc.old
101         mkdir doc.old
102         cvs checkout -r $(OLD) -d doc.old lustre/doc
103
104 dist-hook:
105         rm -rf $(distdir)/figs/CVS
106
107 include $(top_srcdir)/Rules