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