summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/pbox/Makefile
blob: c35fe508883aebb1728d836462f90a117caf6a8f (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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
## Makefile - Makefile for the pbox package.
## Copyright (C) 2003  Simon Law
##
##   This program is free software: you can redistribute it and/or modify
##   it under the terms of the GNU General Public License as published by
##   the Free Software Foundation, either version 3 of the License, or
##   (at your option) any later version.
##
##   This program is distributed in the hope that it will be useful,
##   but WITHOUT ANY WARRANTY; without even the implied warranty of
##   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
##   GNU General Public License for more details.
##
##   You should have received a copy of the GNU General Public License
##   along with this program.  If not, see <http://www.gnu.org/licenses/>.
##

# Set the package name
PACKAGE = pbox

# Use pdfLaTeX for best results
LATEX = pdflatex
LATEX2DVI = $(LATEX) \\pdfoutput=0 \\input
LATEX2PDF = $(LATEX) \\pdfoutput=1 \\input

# MakeIndex parameters
MAKEINDEX = makeindex
GIND = gind.ist
GGLO = gglo.ist

# Installation
INSTALL = /usr/bin/install -c
INSTALL_DATA = $(INSTALL) -m 644
DESTDIR = .
TDSFORMAT = latex/

# Shell
RM = rm -f
ZIP = zip -9

TEXFILES=\
         $(PACKAGE).aux\
         $(PACKAGE).drv\
         $(PACKAGE).dvi\
         $(PACKAGE).glo\
         $(PACKAGE).gls\
         $(PACKAGE).idx\
         $(PACKAGE).ilg\
         $(PACKAGE).ind\
         $(PACKAGE).log\
         $(PACKAGE).pdf\
         $(PACKAGE).sty

PKGFILES=\
         AUTHORS\
         COPYING\
         ChangeLog\
         INSTALL\
         Makefile\
         README\
         $(PACKAGE).dtx\
         $(PACKAGE).ins\
         $(PACKAGE).pdf

.PHONY : all install uninstall dvi pdf clean

all : $(PACKAGE).sty $(PACKAGE).dvi $(PACKAGE).pdf ;

install : all
	$(INSTALL) -d $(DESTDIR)/texmf/tex/$(TDSFORMAT)/$(PACKAGE)
	$(INSTALL) -d $(DESTDIR)/texmf/doc/$(TDSFORMAT)/$(PACKAGE)
	$(INSTALL_DATA) $(PACKAGE).sty $(DESTDIR)/texmf/tex/$(TDSFORMAT)/$(PACKAGE)/
	$(INSTALL_DATA) $(PACKAGE).dvi $(DESTDIR)/texmf/doc/$(TDSFORMAT)/$(PACKAGE)/
	$(INSTALL_DATA) $(PACKAGE).pdf $(DESTDIR)/texmf/doc/$(TDSFORMAT)/$(PACKAGE)/

uninstall : all
	$(RM) $(DESTDIR)/texmf/tex/$(TDSFORMAT)/$(PACKAGE)/$(PACKAGE).sty
	$(RM) $(DESTDIR)/texmf/doc/$(TDSFORMAT)/$(PACKAGE)/$(PACKAGE).dvi
	$(RM) $(DESTDIR)/texmf/doc/$(TDSFORMAT)/$(PACKAGE)/$(PACKAGE).pdf
	ls $(DESTDIR)/texmf/tex/$(TDSFORMAT)/$(PACKAGE)/* >/dev/null 2>&1  \
	    || $(RM) -r $(DESTDIR)/texmf/tex/$(TDSFORMAT)/$(PACKAGE)
	ls $(DESTDIR)/texmf/doc/$(PACKAGE)/* >/dev/null 2>&1 \
	    || $(RM) -r $(DESTDIR)/texmf/doc/$(TDSFORMAT)/$(PACKAGE)

dvi : $(PACKAGE).dvi

pdf : $(PACKAGE).pdf

%.sty : %.ins %.dtx
	$(LATEX) $<

%.dvi : %.dtx %.sty
	$(LATEX2DVI) $<
	$(MAKEINDEX) -s $(GIND) $*.idx
	$(MAKEINDEX) -s $(GGLO) -o $*.gls $*.glo
	$(LATEX2DVI) $<

%.pdf : %.dtx %.sty
	$(LATEX2PDF) $<
	$(MAKEINDEX) -s $(GIND) $*.idx
	$(MAKEINDEX) -s $(GGLO) -o $*.gls $*.glo
	$(LATEX2DVI) $<

$(PACKAGE).zip : $(PKGFILES)
	$(RM) $@
	$(ZIP) $@ $^

clean :
	$(RM) $(TEXFILES) $(PACKAGE).zip