2 TD=`if id|grep '^uid=0' >/dev/null; then kpsewhich --expand-path='$$TEXMFLOCAL'; else kpsewhich --expand-path='$$HOMETEXMF'; fi | sed -e 's,.$$,&/,'`
3 LTXDIR=tex/latex/mlastyle
4 DOCDIR=doc/latex/mlastyle
5 BSTDIR=bibtex/bst/mlastyle
6 SRCDIR=source/latex/mlastyle
7 #VERSION=`grep '^\\\\def\\\\fileversion' mlastyle.dtx | sed 's/^\\\\def\\\\fileversion{\\(.*\\)\\.\\(.*\\)}/\\1_\\2/'`
8 VERSION=`grep '^%<[a-z]*> *\[[0-9/]* *v' mlastyle.dtx | sed 's/^%<[a-z]*> *\[[0-9/]* *v\([-_.0-9a-z]*\).*/\1/'`
11 MAKEINDEX=/usr/bin/makeindex
14 FAKEROOT=`[ -x /usr/bin/fakeroot ] && echo /usr/bin/fakeroot`
16 .SUFFIXES: .sty .ins .dtx .dvi .ps .pdf .ind .idx .gls .glo
17 .PHONY: clean distclean tar zip install target mlastyle instructions
28 %.dvi: %.sty %.dtx %.bbl
31 $(MAKEINDEX) -s gglo.ist -o $*.gls $*.glo
32 $(MAKEINDEX) -s gind.ist -o $*.ind $*.idx
38 %.pdf: %.sty %.dtx %.bbl
42 target: mlastyle.sty mlastyle.dvi instructions
44 all: mlastyle.sty mlastyle.dvi mlastyle.pdf mlastyle.ps zip tar
46 mlastyle: mlastyle.sty
48 mlastyle.sty: mlastyle.ins mlastyle.dtx
50 mlastyle.dvi: mlastyle.sty
53 rm -f *.glo *.gls *.idx *.ilg *.ind *.toc *.log *.aux *.blg *.bib *.bbl *~
56 rm -f mlastyle.sty mlastyle.dvi mlastyle.ps mlastyle.pdf
57 rm -rf $(LTXDIR)/* $(DOCDIR)/* $(SRCDIR)/* $(BSTDIR)/*
58 [ ! -d $(LTXDIR) ] || rmdir -p $(LTXDIR) $(DOCDIR) $(SRCDIR) $(BSTDIR)
60 tar: mlastyle.sty mlastyle.dvi clean
61 mkdir mlastyle-$(VERSION)
62 rm -f mlastyle_$(VERSION).tar.gz
63 install -m644 *.dtx *.ins *.bst Makefile README mlastyle-$(VERSION)
64 $(FAKEROOT) tar czf mlastyle_$(VERSION).tar.gz \
66 rm -rf mlastyle-$(VERSION)
68 zip: mlastyle.sty mlastyle.dvi clean
73 install -m644 *.sty $(LTXDIR)
74 install -m644 mlastyle.dvi $(DOCDIR)
75 [ ! -f mlastyle.pdf ] ||install -m644 mlastyle.pdf $(DOCDIR)
76 [ ! -f mlastyle.ps ] ||install -m644 mlastyle.ps $(DOCDIR)
77 install -m644 *.dtx *.ins *.bst Makefile README $(SRCDIR)
78 install -m644 *.bst $(BSTDIR)
80 zip -r mlastyle.zip tex doc source bibtex
81 rm -rf tex doc source bibtex
84 if [ ! -d $(TD)$(LTXDIR) ]; then mkdirhier $(TD)$(LTXDIR); fi
85 if [ ! -d $(TD)$(DOCDIR) ]; then mkdirhier $(TD)$(DOCDIR); fi
86 if [ ! -d $(TD)$(SRCDIR) ]; then mkdirhier $(TD)$(SRCDIR); fi
87 if [ ! -d $(TD)$(BSTDIR) ]; then mkdirhier $(TD)$(BSTDIR); fi
88 install -m644 *.sty $(TD)$(LTXDIR)
89 install -m644 *.ins *.dtx *.bst Makefile README $(TD)$(SRCDIR)
90 install -m644 mlastyle.dvi $(TD)$(DOCDIR)
91 [ ! -f mlastyle.pdf ] ||install -m644 mlastyle.pdf $(TD)$(DOCDIR)
92 [ ! -f mlastyle.ps ] ||install -m644 mlastyle.ps $(TD)$(DOCDIR)
93 install -m644 *.bst $(TD)$(BSTDIR)
97 @echo "Now run make install, or copy mlastyle.sty to a directory"
98 @echo "in the LaTeX search path and mlastyle.bst to a directory."
99 @echo "in the BibTeX search path."