| 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)
|
|---|
| 8 | PAPER=letter
|
|---|
| 9 |
|
|---|
| 10 | # Arguments to rst2html.py, and location of the script
|
|---|
| 11 | RSTARGS = --input-encoding=utf-8
|
|---|
| 12 | RST2HTML = 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').
|
|---|
| 17 | REMOVE_HOWTOS =
|
|---|
| 18 |
|
|---|
| 19 | MKHOWTO=../tools/mkhowto
|
|---|
| 20 | WEBDIR=.
|
|---|
| 21 | PAPERDIR=../paper-$(PAPER)
|
|---|
| 22 | HTMLDIR=../html
|
|---|
| 23 |
|
|---|
| 24 | # Determine list of files to be built
|
|---|
| 25 | TEX_SOURCES = $(wildcard *.tex)
|
|---|
| 26 | RST_SOURCES = $(wildcard *.rst)
|
|---|
| 27 | TEX_NAMES = $(filter-out $(REMOVE_HOWTOS),$(patsubst %.tex,%,$(TEX_SOURCES)))
|
|---|
| 28 |
|
|---|
| 29 | PAPER_PATHS=$(addprefix $(PAPERDIR)/,$(TEX_NAMES))
|
|---|
| 30 | DVI =$(addsuffix .dvi,$(PAPER_PATHS))
|
|---|
| 31 | PDF =$(addsuffix .pdf,$(PAPER_PATHS))
|
|---|
| 32 | PS =$(addsuffix .ps,$(PAPER_PATHS))
|
|---|
| 33 |
|
|---|
| 34 | ALL_HOWTO_NAMES = $(TEX_NAMES) $(patsubst %.rst,%,$(RST_SOURCES))
|
|---|
| 35 | HOWTO_NAMES = $(filter-out $(REMOVE_HOWTOS),$(ALL_HOWTO_NAMES))
|
|---|
| 36 | HTML = $(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 |
|
|---|
| 66 | default:
|
|---|
| 67 | @echo "'all' -- build all files"
|
|---|
| 68 | @echo "'dvi', 'pdf', 'ps', 'html' -- build one format"
|
|---|
| 69 |
|
|---|
| 70 | all: dvi pdf ps html
|
|---|
| 71 |
|
|---|
| 72 | .PHONY : dvi pdf ps html
|
|---|
| 73 | dvi: $(DVI)
|
|---|
| 74 | pdf: $(PDF)
|
|---|
| 75 | ps: $(PS)
|
|---|
| 76 | html: $(HTML)
|
|---|
| 77 |
|
|---|
| 78 | clean:
|
|---|
| 79 | rm -f *~ *.log *.ind *.l2h *.aux *.toc *.how *.bkm
|
|---|
| 80 | rm -f *.dvi *.pdf *.ps
|
|---|
| 81 |
|
|---|
| 82 | clobber:
|
|---|
| 83 | rm -rf $(HTML)
|
|---|
| 84 | rm -rf $(DVI) $(PDF) $(PS)
|
|---|