|
| 1 | +# you could set this to a4 |
| 2 | +PAPER=letter |
| 3 | + |
| 4 | +# Where are the various programs? |
| 5 | +LATEX= latex |
| 6 | +PDFLATEX= pdflatex |
| 7 | +DVIPS= dvips -N0 -t $(PAPER) |
| 8 | +MAKEINDEX= makeindex -s ../texinputs/myindex.ist |
| 9 | +PYTHON= python |
| 10 | + |
| 11 | +TOOLSDIR= ../tools |
| 12 | +TEXINPUTS= .:../texinputs: |
| 13 | + |
| 14 | +MKDVI= TEXINPUTS=$(TEXINPUTS) $(TOOLSDIR)/mkdvi.sh |
| 15 | +MKHOWTO= $(TOOLSDIR)/mkhowto.sh --keep |
| 16 | +MKPDF= TEXINPUTS=$(TEXINPUTS) $(TOOLSDIR)/mkdvi.sh --pdf |
| 17 | + |
| 18 | + |
| 19 | +# what's what |
| 20 | +MANDVIFILES= api.dvi ext.dvi lib.dvi ref.dvi tut.dvi |
| 21 | +HOWTODVIFILES= mac.dvi |
| 22 | + |
| 23 | +MANPDFFILES= api.pdf ext.pdf lib.pdf ref.pdf tut.pdf |
| 24 | +HOWTOPDFFILES= mac.pdf |
| 25 | + |
| 26 | +MANPSFILES= api.ps ext.ps lib.ps ref.ps tut.ps |
| 27 | +HOWTOPSFILES= mac.ps |
| 28 | + |
| 29 | +DVIFILES= $(MANDVIFILES) $(HOWTODVIFILES) |
| 30 | +PDFFILES= $(MANPDFFILES) $(HOWTOPDFFILES) |
| 31 | +PSFILES= $(MANPSFILES) $(HOWTOPSFILES) |
| 32 | + |
| 33 | + |
| 34 | +include ../Makefile.deps |
| 35 | + |
| 36 | +COMMONSTYLES= ../texinputs/python.sty \ |
| 37 | + ../texinputs/pypaper.sty \ |
| 38 | + ../texinputs/myindex.ist |
| 39 | + |
| 40 | +COMMONTEX= ../texinputs/copyright.tex \ |
| 41 | + ../texinputs/boilerplate.tex |
| 42 | + |
| 43 | +MANSTYLES= ../texinputs/fncychap.sty \ |
| 44 | + ../texinputs/manual.cls \ |
| 45 | + $(COMMONSTYLES) |
| 46 | + |
| 47 | +HOWTOSTYLES= ../texinputs/howto.cls \ |
| 48 | + $(COMMONSTYLES) |
| 49 | + |
| 50 | + |
| 51 | +$(DVIFILES): ../tools/fix_hack ../tools/mkdvi.sh $(COMMONTEX) |
| 52 | +$(PDFFILES): ../tools/fix_hack ../tools/mkdvi.sh $(COMMONTEX) |
| 53 | + |
| 54 | +$(MANDVIFILES): $(MANSTYLES) |
| 55 | +$(MANPDFFILES): $(MANSTYLES) |
| 56 | + |
| 57 | +$(HOWTODVIFILES): ../tools/mkhowto.sh $(HOWTOSTYLES) |
| 58 | +$(HOWTOPDFFILES): ../tools/mkhowto.sh $(HOWTOSTYLES) |
| 59 | + |
| 60 | + |
| 61 | +# Rules to build PostScript and PDF formats |
| 62 | +.SUFFIXES: .dvi .ps .pdf |
| 63 | + |
| 64 | +.dvi.ps: |
| 65 | + $(DVIPS) -o $@ $< |
| 66 | + |
| 67 | + |
| 68 | +all: ps |
| 69 | +dvi: $(DVIFILES) |
| 70 | +pdf: $(PDFFILES) |
| 71 | +ps: $(PSFILES) |
| 72 | + |
| 73 | + |
| 74 | +# Python Library Reference |
| 75 | +lib.dvi: $(TOOLSDIR)/indfix.py $(LIBFILES) |
| 76 | + $(TOOLSDIR)/newind.py >$*.ind |
| 77 | + $(TOOLSDIR)/newind.py modindex >mod$*.ind |
| 78 | + TEXINPUTS=../lib:$(TEXINPUTS) $(LATEX) $* |
| 79 | + $(MAKEINDEX) mod$*.idx |
| 80 | + $(TOOLSDIR)/fix_hack $*.idx |
| 81 | + $(MAKEINDEX) $*.idx |
| 82 | + $(TOOLSDIR)/indfix.py $*.ind |
| 83 | + TEXINPUTS=../lib:$(TEXINPUTS) $(LATEX) $* |
| 84 | + |
| 85 | +lib.pdf: $(TOOLSDIR)/indfix.py $(LIBFILES) |
| 86 | + $(TOOLSDIR)/newind.py >$*.ind |
| 87 | + $(TOOLSDIR)/newind.py modindex >mod$*.ind |
| 88 | + TEXINPUTS=../lib:$(TEXINPUTS) $(PDFLATEX) $* |
| 89 | + $(MAKEINDEX) mod$*.idx |
| 90 | + $(TOOLSDIR)/fix_hack $*.idx |
| 91 | + $(MAKEINDEX) $*.idx |
| 92 | + $(TOOLSDIR)/indfix.py $*.ind |
| 93 | + $(TOOLSDIR)/toc2bkm.py $* |
| 94 | + TEXINPUTS=../lib:$(TEXINPUTS) $(PDFLATEX) $* |
| 95 | + |
| 96 | +# Python/C API Reference Manual |
| 97 | +api.dvi: $(APIFILES) |
| 98 | + $(MKDVI) api |
| 99 | + |
| 100 | +api.pdf: $(APIFILES) |
| 101 | + $(MKPDF) api |
| 102 | + |
| 103 | +# Extending and Embedding the Python Interpreter |
| 104 | +ext.dvi: $(EXTFILES) |
| 105 | + $(MKDVI) ext |
| 106 | + |
| 107 | +ext.pdf: $(EXTFILES) |
| 108 | + $(MKPDF) ext |
| 109 | + |
| 110 | +# Macintosh Library Modules |
| 111 | +mac.dvi: $(MACFILES) |
| 112 | + $(MKHOWTO) --dvi ../$*/$*.tex |
| 113 | + |
| 114 | +mac.pdf: $(MACFILES) |
| 115 | + $(MKHOWTO) --pdf ../$*/$*.tex |
| 116 | + |
| 117 | +# Python Reference Manual |
| 118 | +ref.dvi: $(REFFILES) |
| 119 | + $(MKDVI) ref |
| 120 | + |
| 121 | +ref.pdf: $(REFFILES) |
| 122 | + $(MKPDF) ref |
| 123 | + |
| 124 | +# Python Tutorial |
| 125 | +tut.dvi: $(TUTFILES) |
| 126 | + $(MKDVI) tut |
| 127 | + |
| 128 | +tut.pdf: $(TUTFILES) |
| 129 | + $(MKPDF) tut |
| 130 | + |
| 131 | + |
| 132 | +clean: |
| 133 | + rm -f *~ *.aux *.idx *.ilg *.ind *.log *.toc *.bkm *.syn |
| 134 | + |
| 135 | +clobber: clean |
| 136 | + rm -f $(DVIFILES) $(PSFILES) $(PDFFILES) |
0 commit comments