ia64/xen-unstable

changeset 3490:519af10797e4

bitkeeper revision 1.1159.223.17 (41f2c67c7vKsSLIzqLuYY24HOjsC5w)

Description: Use vars for complex programs
It's generally standard to call complex programs indirectly thru make
variables. This allows them to be replaced easily with alternative
versions, without editting each makefile.
Additionally, this patch makes use of $(pkgdocdir) in docs/Makefile.

From: Adam Heath <doogie@brainfood.com>
Signed-off-by: ian.pratt@cl.cam.ac.uk
author iap10@labyrinth.cl.cam.ac.uk
date Sat Jan 22 21:32:44 2005 +0000 (2005-01-22)
parents 78a95a35e3f1
children 77ecf0226c2c
files docs/Makefile
line diff
     1.1 --- a/docs/Makefile	Sat Jan 22 21:30:03 2005 +0000
     1.2 +++ b/docs/Makefile	Sat Jan 22 21:32:44 2005 +0000
     1.3 @@ -1,8 +1,21 @@
     1.4 +#!/usr/bin/make -f
     1.5  
     1.6 -DOC_TEX  := $(wildcard src/*.tex)
     1.7 -DOC_PS   := $(patsubst src/%.tex,ps/%.ps,$(DOC_TEX))
     1.8 -DOC_PDF  := $(patsubst src/%.tex,pdf/%.pdf,$(DOC_TEX))
     1.9 -DOC_HTML := $(patsubst src/%.tex,html/%/index.html,$(DOC_TEX))
    1.10 +
    1.11 +PS2PDF		:= ps2pdf
    1.12 +DVIPS		:= dvips
    1.13 +LATEX		:= latex
    1.14 +FIG2DEV		:= fig2dev
    1.15 +TGIF		:= tgif
    1.16 +LATEX2HTML	:= latex2html
    1.17 +
    1.18 +package		= xen
    1.19 +docdir		= /usr/share/doc
    1.20 +pkgdocdir	= $(docdir)/$(package)
    1.21 +
    1.22 +DOC_TEX		:= $(wildcard src/*.tex)
    1.23 +DOC_PS		:= $(patsubst src/%.tex,ps/%.ps,$(DOC_TEX))
    1.24 +DOC_PDF		:= $(patsubst src/%.tex,pdf/%.pdf,$(DOC_TEX))
    1.25 +DOC_HTML	:= $(patsubst src/%.tex,html/%/index.html,$(DOC_TEX))
    1.26  
    1.27  GFX  = $(patsubst %.obj, %.eps, $(wildcard figs/*.obj))
    1.28  GFX += $(patsubst %.fig, %.eps, $(wildcard figs/*.fig))
    1.29 @@ -22,30 +35,34 @@ clean:
    1.30  	rm -rf $(GFX) ps pdf html
    1.31  
    1.32  install: all
    1.33 -	rm -rf $(prefix)/usr/share/doc/xen
    1.34 -	mkdir -p $(prefix)/usr/share/doc/xen
    1.35 -	cp -dR ps $(prefix)/usr/share/doc/xen
    1.36 -	cp -dR pdf $(prefix)/usr/share/doc/xen
    1.37 -	cp -dR html $(prefix)/usr/share/doc/xen
    1.38 +	rm -rf $(prefix)$(pkgdocdir)
    1.39 +	mkdir -p $(prefix)$(pkgdocdir)
    1.40 +	cp -dR ps $(prefix)$(pkgdocdir)
    1.41 +	cp -dR pdf $(prefix)$(pkgdocdir)
    1.42 +	cp -dR html $(prefix)$(pkgdocdir)
    1.43  
    1.44  pdf/%.pdf: ps/%.ps
    1.45 -	mkdir -p pdf ; ps2pdf $< $@
    1.46 +	mkdir -p $(@D)
    1.47 +	$(PS2PDF) $< $@.new
    1.48 +	mv $@.new $@
    1.49  
    1.50  ps/%.ps: %.dvi
    1.51 -	mkdir -p ps ; dvips -Ppdf -G0 -o $@ $<
    1.52 +	mkdir -p $(@D)
    1.53 +	$(DVIPS) -Ppdf -G0 -o $@.new $<
    1.54 +	mv $@.new $@
    1.55  
    1.56  %.dvi: src/%.tex $(GFX)
    1.57 -	latex $< >/dev/null
    1.58 -	if [ -e $*.toc ] ; then latex $< >/dev/null ; fi
    1.59 +	$(LATEX) $< >/dev/null
    1.60 +	if [ -e $*.toc ] ; then $(LATEX) $< >/dev/null ; fi
    1.61  
    1.62  %.eps: %.fig
    1.63 -	fig2dev -L eps $< $@
    1.64 +	$(FIG2DEV) -L eps $< $@
    1.65  
    1.66  %.eps: %.obj
    1.67 -	tgif -print -color -eps $<
    1.68 +	$(TGIF) -print -color -eps $<
    1.69  
    1.70  html/%/index.html: src/%.tex
    1.71 -	mkdir -p html/$*
    1.72 -	latex2html -split 0 -show_section_numbers -toc_depth 3 -nonavigation \
    1.73 -	-numbered_footnotes -local_icons -noinfo -math -dir html/$* \
    1.74 +	mkdir -p $(@D)
    1.75 +	$(LATEX2HTML) -split 0 -show_section_numbers -toc_depth 3 -nonavigation \
    1.76 +	-numbered_footnotes -local_icons -noinfo -math -dir $(@D) \
    1.77  	$< 1>/dev/null 2>/dev/null