1 # Copyright (C) 2001, 2002 Cluster File Systems, Inc.
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
15 SUFFIXES = .lin .lyx .pdf .ps .sgml .html .txt .tex .fig .eps .dvi
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
21 LYXFILES= $(wildcard *.lin) $(wildcard *.lyx)
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
28 EXTRA_DIST = chbar.sh postbar tex2pdf $(DOCS) $(IMAGES) $(LYXFILES) lustre.bib
32 # These variables are set by lbuild/check-build.
35 KERNRPM ?= kernel-2.4.18lustre13-RELEASE.i386.rpm
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'
42 # Regenerate when the $(VERSION) or $Name: $ changes.
43 .INTERMEDIATE: $(GENERATED)
44 $(VERSIONED) : %.lyx: %.lin Makefile
48 @echo $(LYX2PDF) $< && $(LYX2PDF) $< || printf "\n*** Warning: not creating PDF docs; install lyx to rectify this\n"
51 @echo $(LYX2PS) $< && $(LYX2PS) $< || printf "\n*** Warning: not creating PostScript docs; install lyx to rectify this\n"
54 @echo $(LYX2TEX) $< && $(LYX2TEX) $< || printf "\n*** Warning: not creating LaTeX docs; install lyx to rectify this\n"
57 @echo $(LYX2TXT) $< && $(LYX2TXT) $< || printf "\n*** Warning: not creating text docs; install lyx to rectify this\n"
60 @echo $(LYX2HTML) $< && $(LYX2HTML) $< || printf "\n*** Warning: not creating HTML docs; install lyx to rectify this\n"
75 lustre.tex lustre.pdf lustre.txt lustre.html: $(IMAGES) $(LYXFILES) lustre-HOWTO.lyx
77 -fig2dev -L eps $< > $@
80 cp lustre.pdf /usr/src/www/content/lustre/docs/lustre.pdf
81 ( cd /usr/src/www ; make lustre ; make synclustre )
84 # Build a changebar document from the files in doc.old and this directory.
85 chbar: lustre-chbar.pdf
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 > $@
91 $(TEXEXPAND) -texinputs=. -texinputs=$(srcdir) -output=$@ $<
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
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"; \
105 cvs checkout -r $(OLD) -d doc.old lustre/doc
108 rm -rf $(distdir)/figs/CVS
110 include $(top_srcdir)/Rules