blob: 19701c69eb7d3844cc8b340e6bb32d46653e1422 [file] [log] [blame]
Andrew M. Kuchlinge8f44d62005-08-30 01:25:05 +00001
2MKHOWTO=../tools/mkhowto
3WEBDIR=.
4RSTARGS = --input-encoding=utf-8
5VPATH=.:dvi:pdf:ps:txt
6
7# List of HOWTOs that aren't to be processed
8
9REMOVE_HOWTO =
10
11# Determine list of files to be built
12
13HOWTO=$(filter-out $(REMOVE_HOWTO),$(wildcard *.tex))
14RST_SOURCES = $(shell echo *.rst)
15DVI =$(patsubst %.tex,%.dvi,$(HOWTO))
16PDF =$(patsubst %.tex,%.pdf,$(HOWTO))
17PS =$(patsubst %.tex,%.ps,$(HOWTO))
18TXT =$(patsubst %.tex,%.txt,$(HOWTO))
19HTML =$(patsubst %.tex,%,$(HOWTO))
20
21# Rules for building various formats
22%.dvi : %.tex
23 $(MKHOWTO) --dvi $<
24 mv $@ dvi
25
26%.pdf : %.tex
27 $(MKHOWTO) --pdf $<
28 mv $@ pdf
29
30%.ps : %.tex
31 $(MKHOWTO) --ps $<
32 mv $@ ps
33
34%.txt : %.tex
35 $(MKHOWTO) --text $<
36 mv $@ txt
37
38% : %.tex
39 $(MKHOWTO) --html --iconserver="." $<
40 tar -zcvf html/$*.tgz $*
41 #zip -r html/$*.zip $*
42
43default:
44 @echo "'all' -- build all files"
45 @echo "'dvi', 'pdf', 'ps', 'txt', 'html' -- build one format"
46
47all: $(HTML)
48
49.PHONY : dvi pdf ps txt html rst
50dvi: $(DVI)
51
52pdf: $(PDF)
53ps: $(PS)
54txt: $(TXT)
55html:$(HTML)
56
57# Rule to build collected tar files
58dist: #all
59 for i in dvi pdf ps txt ; do \
60 cd $$i ; \
61 tar -zcf All.tgz *.$$i ;\
62 cd .. ;\
63 done
64
65# Rule to copy files to the Web tree on AMK's machine
66web: dist
67 cp dvi/* $(WEBDIR)/dvi
68 cp ps/* $(WEBDIR)/ps
69 cp pdf/* $(WEBDIR)/pdf
70 cp txt/* $(WEBDIR)/txt
71 for dir in $(HTML) ; do cp -rp $$dir $(WEBDIR) ; done
72 for ltx in $(HOWTO) ; do cp -p $$ltx $(WEBDIR)/latex ; done
73
74rst: unicode.html
75
76%.html: %.rst
77 rst2html $(RSTARGS) $< >$@
78
79clean:
80 rm -f *~ *.log *.ind *.l2h *.aux *.toc *.how
81 rm -f *.dvi *.ps *.pdf *.bkm
82 rm -f unicode.html
83
84clobber:
85 rm dvi/* ps/* pdf/* txt/* html/*
86
87
88