Readded after corruption
[latex-mlastyle.git] / Makefile
1 SRCDIR=mlastyle
2 TEXMFDIR=`if id|grep '^uid=0' >/dev/null; then kpsewhich --expand-path='$$TEXMFLOCAL'; else kpsewhich --expand-path='$$HOMETEXMF'; fi`
3 INSTALLDIR=$(TEXMFDIR)/tex/latex/mlastyle
4 DOCDIR=$(TEXMFDIR)/doc/latex/mlastyle
5 BSTDIR=$(TEXMFDIR)/bst/mlastyle
6 VERSION=`grep '^\\\\def\\\\fileversion' mlastyle.dtx | sed 's/^\\\\def\\\\fileversion{\\(.*\\)\\.\\(.*\\)}/\\1_\\2/'`
7 LATEX=latex
8 PDFLATEX=pdflatex
9 DVIPS=dvips
10 MAKEINDEX=/usr/bin/makeindex
11
12
13 .SUFFIXES: .sty .ins .dtx .dvi .ps .pdf
14 .PHONY: clean distclean tar zip install
15
16 %.ind: %.idx
17         $(MAKEINDIX) -s gglo.ist -o $@ $<
18         $(MAKEINDEX) -s gind.ist $<
19
20 %.idx: %.dtx
21         $(LATEX) $<
22
23 %.dvi: %.dtx %.ind
24         $(LATEX) $*.dtx
25         $(LATEX) $*.dtx
26
27 %.sty: %.ins %.dtx
28         $(LATEX) $*.ins
29         $(LATEX) $<
30
31 #.dtx.dvi:
32 #       $(LATEX) $<
33 #       $(LATEX) $<
34 #       $(MAKEINDEX) -s gind.ist $(*D)/$(*F)
35 #       $(MAKEINDEX) -s gglo.ist -o $(*D)/$(*F).gls $(*D)/$(*F).glo
36 #       $(LATEX) $<
37
38 %.ps: %.dvi
39         $(DVIPS) -o $@ $<
40
41 %.pdf: %.dtx %.ind
42         $(PDFLATEX) $*.dtx
43         $(PDFLATEX) $*.dtx
44
45 target: mlastyle.sty mlastyle.dvi
46
47 all: mlastyle.sty mlastyle.dvi mlastyle.pdf mlastyle.ps zip tar
48
49 mlastyle: mlastyle.sty
50
51 clean:
52         rm -f *.glo *.gls *.idx *.ilg *.ind *.toc *.log *.aux *.blg *.bbl
53         rm -f *~
54
55 distclean: clean
56         rm -f mlastyle.sty mlastyle.dvi mlastyle.ps mlastyle.pdf
57
58 tar:    all clean
59         rm -f mlastyle.tar.gz
60         tar czCf .. mlastyle.tar.gz \
61           $(SRCDIR)/README $(SRCDIR)/Makefile \
62           $(SRCDIR)/mlastyle.dtx \
63           $(SRCDIR)/mlastyle.ins \
64           $(SRCDIR)/mlastyle.dvi
65
66
67 zip:    all clean
68         mkdirhier tex/latex/mlastyle/
69         mkdirhier doc/latex/mlastyle/
70         mkdirhier source/latex/mlastyle/
71         mkdirhier bibtex/bst/mlastyle/
72         cp *.sty tex/latex/mlastyle/
73         cp mlastyle.dvi README doc/latex/mlastyle/
74         cp mlastyle.dtx mlastyle.ins Makefile source/latex/mlastyle/
75         cp *.bst bibtex/bst/mlastyle/
76         -@rm -f mlastyle.zip
77         zip -r mlastyle.zip tex doc source bibtex
78         rm -rf tex doc source bibtex
79
80
81 install: all
82         if [ ! -d $(INSTALLDIR) ]; then mkdirhier $(INSTALLDIR); fi
83         if [ ! -d $(DOCDIR) ]; then mkdirhier $(DOCDIR); fi
84         if [ ! -d $(BSTDIR) ]; then mkdirhier $(BSTDIR); fi
85         install -m644 mlastyle.sty $(INSTALLDIR)
86         install -m644 mlastyle.bst $(BSTDIR)
87         install -m644 mlastyle.dvi $(DOCDIR)
88         texhash
89
90 ausgabe:
91         @echo "Please copy mlastyle.sty to a directory"
92         @echo "in the LaTeX search path"
93
94
95 mlastyle.sty: mlastyle.ins mlastyle.dtx
96
97 mlastyle.dvi: mlastyle.sty
98