source: vendor/python/2.5/Doc/howto/Makefile

Last change on this file was 3225, checked in by bird, 18 years ago

Python 2.5

File size: 2.0 KB
Line 
1# Makefile for the HOWTO directory
2# LaTeX HOWTOs can be turned into HTML, PDF, PS, DVI or plain text output.
3# reST HOWTOs can only be turned into HTML.
4
5# Variables to change
6
7# Paper size for non-HTML formats (letter or a4)
8PAPER=letter
9
10# Arguments to rst2html.py, and location of the script
11RSTARGS = --input-encoding=utf-8
12RST2HTML = rst2html.py
13
14# List of HOWTOs that aren't to be processed. This should contain the
15# base name of the HOWTO without any extension (e.g. 'advocacy',
16# 'unicode').
17REMOVE_HOWTOS =
18
19MKHOWTO=../tools/mkhowto
20WEBDIR=.
21PAPERDIR=../paper-$(PAPER)
22HTMLDIR=../html
23
24# Determine list of files to be built
25TEX_SOURCES = $(wildcard *.tex)
26RST_SOURCES = $(wildcard *.rst)
27TEX_NAMES = $(filter-out $(REMOVE_HOWTOS),$(patsubst %.tex,%,$(TEX_SOURCES)))
28
29PAPER_PATHS=$(addprefix $(PAPERDIR)/,$(TEX_NAMES))
30DVI =$(addsuffix .dvi,$(PAPER_PATHS))
31PDF =$(addsuffix .pdf,$(PAPER_PATHS))
32PS =$(addsuffix .ps,$(PAPER_PATHS))
33
34ALL_HOWTO_NAMES = $(TEX_NAMES) $(patsubst %.rst,%,$(RST_SOURCES))
35HOWTO_NAMES = $(filter-out $(REMOVE_HOWTOS),$(ALL_HOWTO_NAMES))
36HTML = $(addprefix $(HTMLDIR)/,$(HOWTO_NAMES))
37
38# Rules for building various formats
39
40# reST to HTML
41$(HTMLDIR)/%: %.rst
42 if [ ! -d $@ ] ; then mkdir $@ ; fi
43 $(RST2HTML) $(RSTARGS) $< >$@/index.html
44
45# LaTeX to various output formats
46$(PAPERDIR)/%.dvi : %.tex
47 $(MKHOWTO) --dvi $<
48 mv $*.dvi $@
49
50$(PAPERDIR)/%.pdf : %.tex
51 $(MKHOWTO) --pdf $<
52 mv $*.pdf $@
53
54$(PAPERDIR)/%.ps : %.tex
55 $(MKHOWTO) --ps $<
56 mv $*.ps $@
57
58$(HTMLDIR)/% : %.tex
59 $(MKHOWTO) --html --iconserver="." --dir $@ $<
60
61# Rule that isn't actually used -- we no longer support the 'txt' target.
62$(PAPERDIR)/%.txt : %.tex
63 $(MKHOWTO) --text $<
64 mv $@ txt
65
66default:
67 @echo "'all' -- build all files"
68 @echo "'dvi', 'pdf', 'ps', 'html' -- build one format"
69
70all: dvi pdf ps html
71
72.PHONY : dvi pdf ps html
73dvi: $(DVI)
74pdf: $(PDF)
75ps: $(PS)
76html: $(HTML)
77
78clean:
79 rm -f *~ *.log *.ind *.l2h *.aux *.toc *.how *.bkm
80 rm -f *.dvi *.pdf *.ps
81
82clobber:
83 rm -rf $(HTML)
84 rm -rf $(DVI) $(PDF) $(PS)
Note: See TracBrowser for help on using the repository browser.