Fixed typo and added reference to bst file
[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 .ind .idx .gls .glo
14 .PHONY: clean distclean tar zip install target
15
16 %.ind: %.idx
17         $(MAKEINDEX) -s gglo.ist -o $*.gls $*.glo
18         $(MAKEINDEX) -s gind.ist -o $*.ind $*.idx
19
20 %.idx: %.dtx
21         $(LATEX) $<
22
23 %.dvi: %.sty %.dtx %.ind
24         $(LATEX) $*.dtx
25         $(LATEX) $*.dtx
26
27 %.sty: %.ins %.dtx
28         $(LATEX) $*.ins
29
30 #.dtx.dvi:
31 #       $(LATEX) $<
32 #       $(LATEX) $<
33 #       $(MAKEINDEX) -s gind.ist $(*D)/$(*F)
34 #       $(MAKEINDEX) -s gglo.ist -o $(*D)/$(*F).gls $(*D)/$(*F).glo
35 #       $(LATEX) $<
36
37 %.ps: %.dvi
38         $(DVIPS) -o $@ $<
39
40 %.pdf: %.dtx %.ind
41         $(PDFLATEX) $*.dtx
42         $(PDFLATEX) $*.dtx
43
44 target: mlastyle.sty mlastyle.dvi instructions
45
46 all: mlastyle.sty mlastyle.dvi mlastyle.pdf mlastyle.ps zip tar
47
48 mlastyle: mlastyle.sty
49
50 clean:
51         rm -f *.glo *.gls *.idx *.ilg *.ind *.toc *.log *.aux *.blg *.bbl *~
52
53 distclean: clean
54         rm -f mlastyle.sty mlastyle.dvi mlastyle.ps mlastyle.pdf
55
56 tar:    mlastyle.sty mlastyle.dvi clean
57         rm -f mlastyle.tar.gz
58         tar czCf .. mlastyle.tar.gz \
59           $(SRCDIR)/README $(SRCDIR)/Makefile \
60           $(SRCDIR)/mlastyle.dtx \
61           $(SRCDIR)/mlastyle.ins \
62           $(SRCDIR)/mlastyle.dvi
63
64
65 zip:    mlastyle.sty mlastyle.dvi clean
66         mkdirhier tex/latex/mlastyle/
67         mkdirhier doc/latex/mlastyle/
68         mkdirhier source/latex/mlastyle/
69         mkdirhier bibtex/bst/mlastyle/
70         cp *.sty tex/latex/mlastyle/
71         cp mlastyle.dvi README doc/latex/mlastyle/
72         cp mlastyle.dtx mlastyle.ins Makefile source/latex/mlastyle/
73         cp *.bst bibtex/bst/mlastyle/
74         rm -f mlastyle.zip
75         zip -r mlastyle.zip tex doc source bibtex
76         rm -rf tex doc source bibtex
77
78
79 install: all
80         if [ ! -d $(INSTALLDIR) ]; then mkdirhier $(INSTALLDIR); fi
81         if [ ! -d $(DOCDIR) ]; then mkdirhier $(DOCDIR); fi
82         if [ ! -d $(BSTDIR) ]; then mkdirhier $(BSTDIR); fi
83         install -m644 mlastyle.sty $(INSTALLDIR)
84         install -m644 mlastyle.bst $(BSTDIR)
85         install -m644 mlastyle.dvi $(DOCDIR)
86         texhash
87
88 instructions:
89         @echo "Now run make install, or copy mlastyle.sty to a directory"
90         @echo "in the LaTeX search path"
91
92
93 mlastyle.sty: mlastyle.ins mlastyle.dtx
94
95 mlastyle.dvi: mlastyle.sty
96