mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
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
69 lines
1.5 KiB
Makefile
69 lines
1.5 KiB
Makefile
#!/usr/bin/make -f
|
|
|
|
|
|
PS2PDF := ps2pdf
|
|
DVIPS := dvips
|
|
LATEX := latex
|
|
FIG2DEV := fig2dev
|
|
TGIF := tgif
|
|
LATEX2HTML := latex2html
|
|
|
|
package = xen
|
|
docdir = /usr/share/doc
|
|
pkgdocdir = $(docdir)/$(package)
|
|
|
|
DOC_TEX := $(wildcard src/*.tex)
|
|
DOC_PS := $(patsubst src/%.tex,ps/%.ps,$(DOC_TEX))
|
|
DOC_PDF := $(patsubst src/%.tex,pdf/%.pdf,$(DOC_TEX))
|
|
DOC_HTML := $(patsubst src/%.tex,html/%/index.html,$(DOC_TEX))
|
|
|
|
GFX = $(patsubst %.obj, %.eps, $(wildcard figs/*.obj))
|
|
GFX += $(patsubst %.fig, %.eps, $(wildcard figs/*.fig))
|
|
|
|
all: ps pdf html
|
|
rm -f *.aux *.dvi *.bbl *.blg *.glo *.idx *.ilg *.log *.ind *.toc
|
|
|
|
ps: $(DOC_PS)
|
|
|
|
pdf: $(DOC_PDF)
|
|
|
|
html: $(DOC_HTML)
|
|
|
|
clean:
|
|
rm -rf .word_count *.aux *.dvi *.bbl *.blg *.glo *.idx *~
|
|
rm -rf *.ilg *.log *.ind *.toc *.bak core
|
|
rm -rf $(GFX) ps pdf html
|
|
|
|
install: all
|
|
rm -rf $(prefix)$(pkgdocdir)
|
|
mkdir -p $(prefix)$(pkgdocdir)
|
|
cp -dR ps $(prefix)$(pkgdocdir)
|
|
cp -dR pdf $(prefix)$(pkgdocdir)
|
|
cp -dR html $(prefix)$(pkgdocdir)
|
|
|
|
pdf/%.pdf: ps/%.ps
|
|
mkdir -p $(@D)
|
|
$(PS2PDF) $< $@.new
|
|
mv $@.new $@
|
|
|
|
ps/%.ps: %.dvi
|
|
mkdir -p $(@D)
|
|
$(DVIPS) -Ppdf -G0 -o $@.new $<
|
|
mv $@.new $@
|
|
|
|
%.dvi: src/%.tex $(GFX)
|
|
$(LATEX) $< >/dev/null
|
|
if [ -e $*.toc ] ; then $(LATEX) $< >/dev/null ; fi
|
|
|
|
%.eps: %.fig
|
|
$(FIG2DEV) -L eps $< $@
|
|
|
|
%.eps: %.obj
|
|
$(TGIF) -print -color -eps $<
|
|
|
|
html/%/index.html: src/%.tex
|
|
mkdir -p $(@D)
|
|
$(LATEX2HTML) -split 0 -show_section_numbers -toc_depth 3 -nonavigation \
|
|
-numbered_footnotes -local_icons -noinfo -math -dir $(@D) \
|
|
$< 1>/dev/null 2>/dev/null
|