summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/pst-optexp/Makefile
blob: 2cacec35d4bfbbd789c5ecc2cc23642b53a1d1d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
.SUFFIXES : .tex .ltx .dvi .ps .pdf .eps

PACKAGE = pst-optexp

LATEX = latex

ARCHNAME = $(PACKAGE)-$(shell date +"%y%m%d")

ARCHFILES = Makefile README Changes \
	    $(addprefix $(PACKAGE), -quickref.pdf .dtx .ins .pdf -DE.pdf)

PS2PDF = GS_OPTIONS=-dPDFSETTINGS=/prepress ps2pdf

all : doc-all Changes

doc-all: doc doc-DE doc-code quickref 

doc: $(PACKAGE).pdf
doc-DE: $(PACKAGE)-DE.pdf
doc-code: $(PACKAGE)-code.pdf
quickref: $(PACKAGE)-quickref.pdf

dist: $(ARCHFILES)
	mkdir -p $(PACKAGE)
	cp $(ARCHFILES) $(PACKAGE)
	zip -r $(PACKAGE).zip $(PACKAGE)
	$(RM) -rf $(PACKAGE)/

$(PACKAGE).dvi: L = english
$(PACKAGE)-DE.dvi: L = ngerman
$(PACKAGE)-code.dvi: L = english
%.dvi: $(PACKAGE).dtx $(PACKAGE).sty $(PACKAGE).ist $(PACKAGE).pro

	if [ "$@" = "$(PACKAGE)-code.dvi" ]; then \
		sed 's/^\\OnlyDescription//' < $(PACKAGE).dtx > tmp.dtx; \
	else cp $(PACKAGE).dtx tmp.dtx; \
	fi

	$(LATEX) -jobname=$(basename $@) '\newcommand*{\mainlang}{$(L)}\input{tmp.dtx}'
	$(LATEX) -jobname=$(basename $@) '\newcommand*{\mainlang}{$(L)}\input{tmp.dtx}'
	splitindex -m "" $(basename $@).idx
	if test -e $(basename $@)-idx.idx; then \
	  makeindex -s gind.ist -t $(basename $@)-idx.ilg \
	        -o $(basename $@)-idx.ind $(basename $@)-idx.idx; \
	fi
	if test -e $(basename $@)-doc.idx; then \
	  makeindex -s $(PACKAGE).ist -t $(basename $@)-doc.ilg \
	  	-o $(basename $@)-doc.ind $(basename $@)-doc.idx; \
	fi
	$(LATEX) -jobname=$(basename $@) '\newcommand*{\mainlang}{$(L)}\input{tmp.dtx}'	
	splitindex -m "" $(basename $@).idx
	if test -e $(basename $@)-idx.idx; then \
	  makeindex -s gind.ist -t $(basename $@)-idx.ilg \
	        -o $(basename $@)-idx.ind $(basename $@)-idx.idx; \
	fi
	if test -e $(basename $@)-doc.idx; then \
	  makeindex -s $(PACKAGE).ist -t $(basename $@)-doc.ilg \
	  	-o $(basename $@)-doc.ind $(basename $@)-doc.idx; \
	fi
	$(LATEX) -jobname=$(basename $@) '\newcommand*{\mainlang}{$(L)}\input{tmp.dtx}'
	$(RM) -f tmp.dtx

%.ps: %.dvi
	dvips $< 
%.pdf: %.ps
	$(PS2PDF) -dALLOWPSTRANSPARENCY $< $@

$(PACKAGE)-quickref.tex: $(PACKAGE)-quickref.py $(PACKAGE).dtx
	python $<

$(PACKAGE)-quickref.pdf: $(PACKAGE)-quickref.tex
	pdflatex $<

$(PACKAGE).sty $(PACKAGE).pro $(PACKAGE).ist: $(PACKAGE).ins $(PACKAGE).dtx
	tex $<

Changes: Changes.py $(PACKAGE).dtx
	python $<

clean :
	$(RM) $(foreach prefix, $(PACKAGE) $(PACKAGE)-code $(PACKAGE)-DE $(PACKAGE)-quickref, \
	        $(addprefix $(prefix), .dvi .ps .log .aux .bbl .blg .out .tmp \
	           .toc .idx .ind .ilg .hd \
	           -idx.idx -idx.ilg -idx.ind -doc.idx -doc.ilg -doc.ind .hd)) \
	      $(PACKAGE)-quickref.tex

veryclean : clean
	$(RM) $(addprefix $(PACKAGE), .pdf -DE.pdf -code.pdf -quickref.pdf .sty .pro .ist) Changes