Whamcloud - gitweb
fd5a857277970e9d7f4c401fb4cc96245fc11dbe
[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 = GS_OPTIONS=-dCompatibilityLevel=1.1 $(srcdir)/tex2pdf -overwrite
6 TEX2PDF = GS_OPTIONS=-dCompatibilityLevel=1.1 $(srcdir)/tex2pdf -overwrite
7 LYX2PS = lyx --export ps
8 LYX2TEX = lyx --export latex
9 LYX2TXT = lyx --export text
10 LYX2HTML = lyx --export html
11 LATEX = latex
12 DVIPS = dvips
13 PS2PDF = ps2pdf
14 TEXEXPAND = texexpand
15 SUFFIXES = .lin .lyx .pdf .ps .sgml .html .txt .tex .fig .eps .dvi
16
17 DOCS = lustre.pdf lustre-HOWTO.txt
18 IMAGES := $(patsubst %.fig,%.eps,$(wildcard *.fig))
19 #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
20
21 LYXFILES= $(wildcard *.lin) $(wildcard *.lyx)
22
23 MAINTAINERCLEANFILES =  $(IMAGES) $(DOCS) $(VERSIONED)
24 CLEANFILES = *.aux *.tex doc.old/*.aux doc.old/*.tex *.eps *.log *.pdf
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 tex2pdf $(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.pdf:
63         $(TEX2PDF) $<
64
65 .tex.dvi:
66         $(LATEX) $<
67         $(LATEX) $<
68
69 .dvi.ps:
70         $(DVIPS) $< -o $@
71
72 .ps.pdf:
73         $(PS2PDF) $< $@
74
75 lustre.tex lustre.pdf lustre.txt lustre.html: $(IMAGES) $(LYXFILES) lustre-HOWTO.lyx
76 .fig.eps:
77         -fig2dev -L eps $< > $@
78
79 syncweb: lustre.pdf
80         cp lustre.pdf /usr/src/www/content/lustre/docs/lustre.pdf
81         ( cd /usr/src/www ; make lustre ; make synclustre )
82 .PHONY: syncweb chbar
83
84 # Build a changebar document from the files in doc.old and this directory.
85 chbar: lustre-chbar.pdf
86
87 %-chbar.tex: chbar.sh postbar doc.old/%-full.tex %-full.tex
88         $(SHELL) $(srcdir)/chbar.sh doc.old/$*-full.tex $*-full.tex | $(srcdir)/postbar > $@
89
90 %-full.tex: %.tex
91         $(TEXEXPAND) -texinputs=. -texinputs=$(srcdir) -output=$@ $<
92
93 doc.old/lustre.tex: doc.old/lustre-HOWTO.lyx
94 doc.old/%-full.tex: doc.old/%.tex
95         cd doc.old && $(TEXEXPAND) -texinputs=. -output=$*-full.tex $*.tex
96
97 # Check out the old directory if it doesn't exist.
98 doc.old/lustre.lin doc.old/lustre-HOWTO.lin:
99         @if test "X$(OLD)" = X; then \
100           echo "You must populate doc.old or specify a CVS tag like OLD=v0_5_1"; \
101           exit 1; \
102         fi
103         rm -rf doc.old
104         mkdir doc.old
105         cvs checkout -r $(OLD) -d doc.old lustre/doc
106
107 dist-hook:
108         rm -rf $(distdir)/figs/CVS
109
110 include $(top_srcdir)/Rules