| 1 |
######################################################################## |
| 2 |
# Creating a installed version of pdfcprot |
| 3 |
# Copyright (c) Carsten Schurig, 2001, taken and modified from the |
| 4 |
# KOMA-Script bundle: (c) Markus Kohm, 1999-2001 |
| 5 |
# |
| 6 |
#>>>> USE THIS ONLY, IF THERE IS A TDS-COMPATIBLE TEX-INSTALLATION! <<<< |
| 7 |
#>>>> DO NOT CHANGE ANYTHING BUT THE CUSTOMIZATION SECTION! <<<< |
| 8 |
#>>>> YOU NEED GNU-MAKE TO RUN THIS! <<<< |
| 9 |
# |
| 10 |
# Defined rules for users: |
| 11 |
# |
| 12 |
# default default rule if make is called without parameter, |
| 13 |
# generates all pdfprot including the documentation |
| 14 |
# all same as default but without TEXMF-test |
| 15 |
# install installs all files in a TDS-tree |
| 16 |
# |
| 17 |
# docu makes the documentation |
| 18 |
# |
| 19 |
# implementation changes \OnlyDescription to %\OnlyDescription in |
| 20 |
# `pdfcprot.dtx' so that next docu run will include the |
| 21 |
# documentation of the implementation |
| 22 |
# |
| 23 |
# description changes %\OnlyDescription to \OnlyDescription in |
| 24 |
# `pdfcprot.dtx' so that next docu run will only include |
| 25 |
# description of the package |
| 26 |
# |
| 27 |
# srcclean deletes all generated files (but *tar.gz) |
| 28 |
# distclean deletes all generated files (but *tar.gz) not part of |
| 29 |
# the distribution |
| 30 |
# clean deletes all temporary files |
| 31 |
# |
| 32 |
# dist generates a tar file pdfcprot-<date>.tar.gz with all |
| 33 |
# files of the distribution |
| 34 |
######################################################################## |
| 35 |
|
| 36 |
######################################################################## |
| 37 |
# Start of customization section |
| 38 |
######################################################################## |
| 39 |
|
| 40 |
# The texmf-directory, where to install new stuff (see texmf.cnf) |
| 41 |
# If you don't know what to do, search for directory texmf at /usr. |
| 42 |
# With teTeX and linux often one of following is used: |
| 43 |
#TEXMF=/usr/TeX/texmf |
| 44 |
#TEXMF=/usr/local/TeX/texmf |
| 45 |
#TEXMF=/usr/share/texmf |
| 46 |
#TEXMF=/usr/local/share/texmf |
| 47 |
# user tree: |
| 48 |
#TEXMF=$(HOME)/texmf |
| 49 |
# Try to use the local tree known by kpsewhich: |
| 50 |
TEXMF=`kpsewhich --expand-var '$$TEXMFLOCAL'` |
| 51 |
# But you may set TEXMF to every directory you want. Maybe TEXMF is |
| 52 |
# already set by the environment. |
| 53 |
# Use following, if you only want to test the installation: |
| 54 |
#TEXMF=/tmp/texmf |
| 55 |
|
| 56 |
# If texhash must run after installation, you can invoke this: |
| 57 |
TEXHASH=texhash |
| 58 |
|
| 59 |
######### Edit following only, if you want to change defaults! |
| 60 |
|
| 61 |
# The directory, where to install *.sty and *.cpa |
| 62 |
STYDIR=$(TEXMF)/tex/latex/pdfcprot |
| 63 |
|
| 64 |
# The directory, where to install documentation |
| 65 |
DOCDIR=$(TEXMF)/doc/latex/pdfcprot |
| 66 |
|
| 67 |
# The directory, where to install the sources |
| 68 |
SRCDIR=$(TEXMF)/source/latex/pdfcprot |
| 69 |
|
| 70 |
######################################################################## |
| 71 |
# End of customization section |
| 72 |
######################################################################## |
| 73 |
|
| 74 |
# Used command: |
| 75 |
LATEX = latex |
| 76 |
PDFLATEX = pdflatex |
| 77 |
NONSTOPMODE = \\nonstopmode\\input |
| 78 |
BATCHMODE = \\batchmode\\input |
| 79 |
RM = rm -f |
| 80 |
RMDIR = rm -fr |
| 81 |
CP = cp -f |
| 82 |
CPALL = cp -af |
| 83 |
CD = cd |
| 84 |
MV = mv -f |
| 85 |
INSTALL = install -m 644 |
| 86 |
MKDIR = install -m 755 -d |
| 87 |
MAKEINDEX = makeindex -g -r -s gind.ist |
| 88 |
MAKECHANGE = makeindex -g -r -s gglo.ist -o |
| 89 |
MAKEIDX = makeindex -g |
| 90 |
BIBTEX = bibtex |
| 91 |
DVIPS = dvips -Pwww |
| 92 |
ECHO = echo |
| 93 |
TARCREATE = tar -zcvf |
| 94 |
DIRNAME = dirname |
| 95 |
LL = ls -l |
| 96 |
SED = sed |
| 97 |
CUT = cut |
| 98 |
GREP = grep |
| 99 |
PSSELECT = psselect |
| 100 |
PSBOOK = psbook |
| 101 |
PSTOPS = pstops |
| 102 |
EVAL = eval |
| 103 |
|
| 104 |
LOGMESSAGE = 'pdfcprot was made at '`date`'.' |
| 105 |
ENGREADME = 'Please read README.txt and INSTALL.txt.' |
| 106 |
|
| 107 |
######################################################################## |
| 108 |
|
| 109 |
RMEXT = *.log *.aux *.toc *.lot *.lof *.out *.ilg *.idx *.ind \ |
| 110 |
*.blg *.bbl *.glg *.glx *.glo *.gls |
| 111 |
|
| 112 |
RMOUT = *.pdf *.dvi *.ps |
| 113 |
|
| 114 |
RMSTY = *.cpa *.sty |
| 115 |
|
| 116 |
DTX_FILES = pdfcprot.dtx |
| 117 |
|
| 118 |
INS_FILES = pdfcprot.ins |
| 119 |
|
| 120 |
SRC_FILES = $(DTX_FILES) $(INS_FILES) |
| 121 |
|
| 122 |
TEXT_FILES = README.txt \ |
| 123 |
LEGAL.txt \ |
| 124 |
INSTALL.txt |
| 125 |
|
| 126 |
MISC_FILES = Makefile.unx |
| 127 |
|
| 128 |
DIST_SRC = $(TEXT_FILES) \ |
| 129 |
$(DTX_FILES) \ |
| 130 |
$(INS_FILES) \ |
| 131 |
$(MISC_FILES) |
| 132 |
|
| 133 |
XDIST_FILES = 00README \ |
| 134 |
$(DIST_SRC) |
| 135 |
|
| 136 |
DIST_FILES = 00CONTEN \ |
| 137 |
$(XDIST_FILES) |
| 138 |
|
| 139 |
STY_FILES = pdfcprot.sty |
| 140 |
|
| 141 |
CPA_FILES = pplmnT1.cpa \ |
| 142 |
pplmnOT1.cpa \ |
| 143 |
pplmnTS1.cpa \ |
| 144 |
pplmnT2A.cpa |
| 145 |
|
| 146 |
DOC_FILES = pdfcprot.dvi \ |
| 147 |
$(TEXT_FILES) \ |
| 148 |
$(MISC_SRC) |
| 149 |
|
| 150 |
IDOC_FILES = ${DTX_FILES:.dtx=.dvi} |
| 151 |
|
| 152 |
ILOG_FILES = ${DTX_FILES:.dtx=.log} |
| 153 |
|
| 154 |
######################################################################## |
| 155 |
|
| 156 |
default: |
| 157 |
@if test "x" = "x$(TEXMF)" -o ! -d "$(TEXMF)"; then \ |
| 158 |
$(ECHO) "Destination directories not there." ; \ |
| 159 |
$(ECHO) "Please edit TEXMF at the Makefile first!"; \ |
| 160 |
exit 1 ; \ |
| 161 |
else \ |
| 162 |
$(MAKE) all ; \ |
| 163 |
fi |
| 164 |
|
| 165 |
all: pdfcprotins.log $(IDOC_FILES) |
| 166 |
|
| 167 |
docu: docuclean $(IDOC_FILES) |
| 168 |
|
| 169 |
pdfcprotins.log: $(SRC_FILES) |
| 170 |
$(LATEX) pdfcprot.ins |
| 171 |
$(ECHO) $(LOGMESSAGE) > pdfcprotins.log |
| 172 |
|
| 173 |
######################################################################## |
| 174 |
|
| 175 |
install: pdfcprotins.log |
| 176 |
if test `pwd` = $(STYDIR) -o `pwd` = $(SRCDIR) -o `pwd` = $(DOCDIR); \ |
| 177 |
then \ |
| 178 |
$(CPALL) ./ /tmp/pdfcprot.tmp; \ |
| 179 |
$(CD) /tmp/pdfcprot.tmp; \ |
| 180 |
$(MAKE) install; \ |
| 181 |
$(RMDIR) /tmp/pdfcprot.tmp; \ |
| 182 |
else \ |
| 183 |
$(MKDIR) $(STYDIR); \ |
| 184 |
$(INSTALL) $(STY_FILES) $(STYDIR); \ |
| 185 |
$(INSTALL) $(CPA_FILES) $(STYDIR); \ |
| 186 |
$(MKDIR) $(DOCDIR); \ |
| 187 |
$(INSTALL) $(DOC_FILES) $(DOCDIR); \ |
| 188 |
for file in $(DIST_FILES); do \ |
| 189 |
dir=`dirname $$file`; \ |
| 190 |
if test "x$$dir" = "x"; \ |
| 191 |
then $(INSTALL) $$file $(SRCDIR); \ |
| 192 |
else $(MKDIR) $(SRCDIR)/$$dir; \ |
| 193 |
$(INSTALL) $$file $(SRCDIR)/$$dir; \ |
| 194 |
fi; \ |
| 195 |
done; \ |
| 196 |
$(INSTALL) pdfcprotins.log $(DOCDIR); \ |
| 197 |
fi |
| 198 |
@if test -z "$(TEXHASH)" ; then \ |
| 199 |
$(ECHO) ;\ |
| 200 |
$(ECHO) '>>> Maybe you have to run texhash or something else, now. <<<';\ |
| 201 |
$(ECHO) ;\ |
| 202 |
else \ |
| 203 |
$(EVAL) $(TEXHASH); \ |
| 204 |
fi |
| 205 |
|
| 206 |
######################################################################## |
| 207 |
|
| 208 |
srcclean: distclean |
| 209 |
$(RM) $(RMOUT) 00* |
| 210 |
|
| 211 |
distclean: clean |
| 212 |
$(RM) $(RMSTY) |
| 213 |
|
| 214 |
docuclean: clean |
| 215 |
$(RM) $(RMOUT) |
| 216 |
|
| 217 |
clean: |
| 218 |
$(RM) $(RMEXT) |
| 219 |
|
| 220 |
implementation: |
| 221 |
@for src in $(DTX_FILES);do \ |
| 222 |
$(CP) $${src} $${src}.bak; \ |
| 223 |
$(SED) 's/^\\OnlyDescription/%\\OnlyDescription/1' \ |
| 224 |
<$${src}.bak >$${src}; \ |
| 225 |
$(RM) $${src}.bak; \ |
| 226 |
done |
| 227 |
|
| 228 |
description: |
| 229 |
@for src in $(DTX_FILES);do \ |
| 230 |
$(CP) $${src} $${src}.bak; \ |
| 231 |
$(SED) 's/^%\\OnlyDescription/\\OnlyDescription/1' \ |
| 232 |
<$${src}.bak >$${src}; \ |
| 233 |
$(RM) $${src}.bak; \ |
| 234 |
done |
| 235 |
|
| 236 |
######################################################################## |
| 237 |
|
| 238 |
.SUFFIXES: .dtx .dvi .log |
| 239 |
|
| 240 |
.dtx.dvi: |
| 241 |
$(LATEX) $(BATCHMODE) $< |
| 242 |
$(LATEX) $(BATCHMODE) $< |
| 243 |
$(MAKEIDX) -r -s gind.ist $(<:.dtx=.idx) |
| 244 |
$(MAKEIDX) -r -s gglo.ist $(<:.dtx=.glo) -o $(<:.dtx=.gls) |
| 245 |
$(LATEX) $(NONSTOPMODE) $< |
| 246 |
|
| 247 |
.dtx.log: |
| 248 |
$(LATEX) $(BATCHMODE) $< |
| 249 |
$(LATEX) $(BATCHMODE) $< |
| 250 |
$(MAKEIDX) -r -s gind.ist $(<:.dtx=.idx) |
| 251 |
$(MAKEIDX) -r -s gglo.ist $(<:.dtx=.glo) -o $(<:.dtx=.gls) |
| 252 |
$(LATEX) $(NONSTOPMODE) $< |
| 253 |
|
| 254 |
dist: pdfcprotins.log $(DIST_FILES) $(ILOG_FILES) $(IDOC_FILES) |
| 255 |
@if $(GREP) "Checksum not passed" *.log; then \ |
| 256 |
$(ECHO) "Cannot create tar because of checksum error" >&2; \ |
| 257 |
else \ |
| 258 |
$(TARCREATE) pdfcprot-`date -I`.tar.gz $(DIST_FILES); \ |
| 259 |
fi |
| 260 |
|
| 261 |
00CONTEN: $(XDIST_FILES) |
| 262 |
$(LL) $(XDIST_FILES) > 00CONTEN |
| 263 |
$(LL) 00CONTEN >> 00CONTEN |
| 264 |
$(LL) $(DIST_FILES) > 00CONTEN.TMP |
| 265 |
$(CUT) -b 35- 00CONTEN.TMP > 00CONTEN |
| 266 |
$(RM) 00CONTEN.TMP |
| 267 |
|
| 268 |
00README: |
| 269 |
$(ECHO) $(GERMREADME) > 00README |
| 270 |
$(ECHO) $(ENGREADME) >> 00README |
| 271 |
|
| 272 |
######################################################################## |