summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/koma-script/Makefile
blob: 077e70ffdb68cd1d2d10efa3b6cfb4b02c93283b (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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
# ======================================================================
# Makefile
# Copyright (c) Markus Kohm, 2002-2008
#
# This file is part of the LaTeX2e KOMA-Script bundle.
#
# This work may be distributed and/or modified under the conditions of
# the LaTeX Project Public License, version 1.3b of the license.
# The latest version of this license is in
#   http://www.latex-project.org/lppl.txt
# and version 1.3b or later is part of all distributions of LaTeX 
# version 2005/12/01 or later and of this work.
#
# This work has the LPPL maintenance status "author-maintained".
#
# The Current Maintainer and author of this work is Markus Kohm.
#
# This work consists of all files listed in manifest.txt.
# ----------------------------------------------------------------------
# Makefile
# Copyright (c) Markus Kohm, 2002-2008
#
# Dieses Werk darf nach den Bedingungen der LaTeX Project Public Lizenz,
# Version 1.3b, verteilt und/oder veraendert werden.
# Die neuste Version dieser Lizenz ist
#   http://www.latex-project.org/lppl.txt
# und Version 1.3b ist Teil aller Verteilungen von LaTeX
# Version 2005/12/01 oder spaeter und dieses Werks.
#
# Dieses Werk hat den LPPL-Verwaltungs-Status "author-maintained"
# (allein durch den Autor verwaltet).
#
# Der Aktuelle Verwalter und Autor dieses Werkes ist Markus Kohm.
# 
# Dieses Werk besteht aus den in manifest.txt aufgefuehrten Dateien.
# ======================================================================

# ----------------------------------------------------------------------
# All directories with Makefiles
export BASEDIR ?= $(PWD)/
SUBDIRS = doc
# ----------------------------------------------------------------------
# Load common rules
include Makefile.baserules
# Load variable definitions
include Makefile.baseinit
# ----------------------------------------------------------------------
# Temporary folder, used to create distribution.
# Same folder with postfix "-maintain" will be used to create maintain-
# distribution.
export DISTDIR	   := $(PWD)/koma-script-$(ISODATE)
export MAINTAINDIR := $(DISTDIR)-maintain
# ----------------------------------------------------------------------

# ----------------------------------------------------------------------
# More than once used:
# Make implementation documentation
define makedvifromdtx
	if ! $(LATEX) $(NONSTOPMODE) $(DVIOUTPUT) $<; then \
	    $(RM) -v $@; \
	    exit 1; \
	fi
        oncemore=true; \
        checksum=`$(CKSUM) $(basename $<).aux`; \
        while $$oncemore; \
	do \
	    if ! $(MKINDEX) $(basename $<) \
	       || ! $(LATEX) $(NONSTOPMODE) $(DVIOUTPUT) $<; then \
	        $(RM) -v $@; \
	        exit 1; \
	    fi; \
	    $(GREP) Rerun $(basename $<).log || oncemore=false; \
	    newchecksum=`$(CKSUM) $(basename $<).aux`; \
	    [ "$$newchecksum"="$$checksum" ] || oncemore=true; \
	    checksum="$$newchecksum"; \
	done
endef
# ----------------------------------------------------------------------

# ----------------------------------------------------------------------
# List of all Makefiles
MAKE_FILES	= Makefile Makefile.baserules Makefile.baseinit
# ----------------------------------------------------------------------
# make classes, packages, etc.
INS_TEMPLATES	= scrstrip.inc \
		  scrstrop.inc

CLS_MAIN	= scrbook.cls \
		  scrreprt.cls \
		  scrartcl.cls \
		  scrlttr2.cls \
	          scrlettr.cls \
		  typearea.sty \
		  scrsize10pt.clo \
		  scrsize11pt.clo \
		  scrsize12pt.clo \
		  scrlfile.sty \
		  scrbase.sty \
		  scrkbase.sty \
		  scraddr.sty \
		  scrpage.sty \
		  scrpage2.sty \
		  scrtime.sty \
		  scrdate.sty \
		  scrjura.sty \
		  tocbasic.sty \
		  tocstyle.sty \
		  scrextend.sty \
	          DIN.lco \
		  DINmtext.lco \
		  SN.lco \
	 	  SNleft.lco \
		  KOMAold.lco \
		  NipponEH.lco \
		  NipponEL.lco \
		  NipponLH.lco \
		  NipponLL.lco \
		  NipponRL.lco \
		  KakuLL.lco

CLS_MAIN_DTX    = scrbeta.dtx \
		  scrkbase.dtx \
		  scrkbib.dtx \
		  scrkcile.dtx \
		  scrkcomp.dtx \
		  scrkfloa.dtx \
		  scrkfont.dtx \
		  scrkftn.dtx \
		  scrkidx.dtx \
		  scrklang.dtx \
		  scrklco.dtx \
		  japanlco.dtx \
		  scrkliof.dtx \
		  scrklist.dtx \
		  scrkmisc.dtx \
		  scrknpap.dtx \
		  scrkpage.dtx \
		  scrkpar.dtx \
		  scrkplen.dtx \
		  scrksect.dtx \
		  scrktare.dtx \
		  scrktitl.dtx \
		  scrkvars.dtx \
		  scrkvers.dtx \
		  scrlfile.dtx \
		  scraddr.dtx \
		  scrpage.dtx \
		  scrtime.dtx \
		  scrlettr.dtx \
		  scrlogo.dtx \
	          scrextend.dtx \
		  scrjura.dtx \
		  tocbasic.dtx \
		  tocstyle.dtx

STATIC_DOC      = README \
	          INSTALL.txt \
		  INSTALLD.txt \
	          lppl.txt \
	          lppl-de.txt \
		  manifest.txt \
		  komabug.tex

CLS_MAIN_DVI	= scrsource.dvi

CLS_MAIN_INS	= scrmain.ins

CLS_MAIN_SUBINS	= scrlfile.ins scraddr.ins scrlettr.ins scrpage.ins \
		  scrtime.ins

ALPHA_INS       = tocstyle.dtx tocbasic.dtx scrjura.dtx

ALPHA_DOC       = tocstyle.pdf scrjura.pdf

ALPHA_DTX       = $(subst .pdf,.dtx,$(ALPHA_DOC))

DTX_IS_INS      = tocstyle.dtx tocbasic.dtx scrjura.dtx

CLS_MAIN_SRC	= $(CLS_MAIN_DTX) $(CLS_MAIN_INS) $(CLS_MAIN_SUBINS) \
		  scrsource.tex

$(ALPHA_DOC): $(ALPHA_DTX)
	$(LATEX) $(BATCHMODE) $(PDFOUTPUT) $(subst .pdf,.dtx,$@)
	$(MKINDEX) $(subst .pdf,,$@)
	$(LATEX) $(BATCHMODE) $(PDFOUTPUT) $(subst .pdf,.dtx,$@)
	$(MKINDEX) $(subst .pdf,,$@)
	$(LATEX) $(BATCHMODE) $(PDFOUTPUT) $(subst .pdf,.dtx,$@)

$(CLS_MAIN): $(CLS_MAIN_DVI) $(CLS_MAIN_INS) $(INS_TEMPLATES) $(MAKE_FILES)
	$(TEXUNPACK) $(CLS_MAIN_INS)
	$(foreach alphains,$(ALPHA_INS),$(TEXUNPACK) $(alphains);)

scrsource.dvi: scrsource.tex $(CLS_MAIN_DTX) $(MAKE_FILES) scrdoc.cls
	$(makedvifromdtx)

scrdoc.cls: scrdoc.dtx
	$(SSYMLINK) scrdoc.dtx scrdoc.cls

# ----------------------------------------------------------------------
CLS_FILES	= scrdoc.cls $(CLS_MAIN)

CLS_DVIS	= $(CLS_MAIN_DVI)

CLS_SRC		= $(CLS_MAIN_SRC)

NODIST_GENERATED = $(CLS_DVIS) $(CLS_FILES)

GENERATED	= $(NODIST_GENERATED)

MISC_SRC	= $(INS_TEMPLATES) $(MAKE_FILES) \
                  scrdoc.dtx ChangeLog ChangeLog.2

DIST_SRC	= $(MISC_SRC) $(CLS_SRC)

DIST_FILES	= $(DIST_SRC) $(STATIC_DOC) $(ALPHA_DOC)

MAINTAIN_SRC    = $(DIST_SRC) missing.dtx .cvsignore

MAINTAIN_FILES  = $(MAINTAIN_SRC)
# ----------------------------------------------------------------------

# ----------------------------------------------------------------------
# additional ruls
bindist:dist
	$(UNTARGZ) $(DISTDIR).tar.gz
	chmod -R a+w $(DISTDIR)
ifdef PREPARERELEASE
	$(foreach dtxins,$(DTX_IS_INS),\
	          sed -i -e 's/{trace,/{/g;s/\(\\let\\ifbeta=\\if\)true/\1false/' $(DISTDIR)/$(dtxins) && ) :
	developer/scripts/preparerelease.sh 2 $(notdir $(DISTDIR))
endif
	$(CD) $(notdir $(DISTDIR)) && \
	  $(MAKE)
	$(MKDIR) $(notdir $(DISTDIR))-bin/komascript-texmf
	$(CD) $(notdir $(DISTDIR)) && \
	  $(MAKE) INSTALLTEXMF=$(PWD)/$(notdir $(DISTDIR))-bin/komascript-texmf install
	$(RMDIR) $(notdir $(DISTDIR))
	$(SRM) $(notdir $(DISTDIR))-bin/komascript-texmf/ls-R
	$(INSTALL) $(notdir $(DISTDIR))-bin/komascript-texmf/source/latex/koma-script/ChangeLog $(notdir $(DISTDIR))-bin
	$(INSTALL) $(notdir $(DISTDIR))-bin/komascript-texmf/doc/latex/koma-script/scrgui* $(notdir $(DISTDIR))-bin
	$(INSTALL) $(notdir $(DISTDIR))-bin/komascript-texmf/doc/latex/koma-script/*.txt $(notdir $(DISTDIR))-bin
	$(INSTALL) $(notdir $(DISTDIR))-bin/komascript-texmf/doc/latex/koma-script/README $(notdir $(DISTDIR))-bin
	$(INSTALL) $(notdir $(DISTDIR))-bin/komascript-texmf/doc/latex/koma-script/koma*.html $(notdir $(DISTDIR))-bin
	$(GREP) 'CheckKOMAScriptVersion{' $(notdir $(DISTDIR))-bin/komascript-texmf/source/latex/koma-script/scrkvers.dtx | grep -o '2.*t' > $(notdir $(DISTDIR))-bin/VERSION
	$(CD) $(notdir $(DISTDIR))-bin/komascript-texmf && \
	  $(ZIP) ../komascript.tds.zip source doc tex
	$(RMDIR) $(notdir $(DISTDIR))-bin/komascript-texmf
	$(SRM) $(notdir $(DISTDIR))-bin.zip
	$(CD) $(notdir $(DISTDIR))-bin && \
	  $(ZIP) ../$(notdir $(DISTDIR))-bin.zip *
	$(SRM) $(notdir $(DISTDIR)).tar.gz
	$(RMDIR) $(notdir $(DISTDIR))-bin

# ----------------------------------------------------------------------
# local rules

ChangeLog:
	$(warning Developers should generate ChangeLog manually, see developers/doc/README.)
	$(warning Distributors should not use a SVN version for their distributions!)
	$(warning Betatester may continue with an empty ChangeLog after using: touch ChangeLog)
	@exit 1

default_local: test_baseinit $(CLS_FILES)

prepare_local: # nothing to do

install_local: test_baseinit $(DIST_SRC) $(CLS_FILES) $(STATIC_DOC) $(ALPHA_DOC)
	@if ! $(MKDIR) $(INSTALLSRCDIR) \
	  || ! $(MKDIR) $(INSTALLCLSDIR) \
	  || ! $(MKDIR) $(INSTALLDOCDIR) ; then \
	    echo '--------------------------------------------------'; \
	    echo '| Cannot install to' $(INSTALLSRCDIR) or $(INSTALLCLSDIR) or $(INSTALLDOCDIR)!; \
	    echo '| You should try:'; \
	    echo '|     sudo "make install"'; \
	    echo '--------------------------------------------------'; \
	    exit 1; \
	fi
	$(INSTALL) $(DIST_SRC) $(INSTALLSRCDIR)
	$(INSTALL) $(CLS_FILES) $(INSTALLCLSDIR)
	$(INSTALL) $(STATIC_DOC) $(ALPHA_DOC) $(INSTALLDOCDIR)
	$(SECHO) ------------------------------------------------------------
	$(SECHO) Installed files at $(INSTALLSRCDIR):
	$(SECHO) $(DIST_SRC)
	$(SECHO) ------------------------------------------------------------
	$(SECHO) Installed files at $(INSTALLCLSDIR):
	$(SECHO) $(CLS_FILES)
	$(SECHO) ------------------------------------------------------------
	$(SECHO) Installed files at $(INSTALLDOCDIR):
	$(SECHO) $(STATIC_DOC) $(ALPHA_DOC)
	$(SECHO) ------------------------------------------------------------

uninstall_local:
	@if [ -d $(INSTALLSRCDIR) ]; then \
	    $(RM) -v $(foreach file,$(DIST_SRC),$(INSTALLSRCDIR)/$(file)); \
	    if [ ls $(INSTALLSRCDIR) > /dev/null 2>&1; then \
	        $(RMDIR) -v $(INSTALLSRCDIR); \
	    else \
	        echo "$(INSTALLSRCDIR) not empty!"; \
	    fi; \
	else \
	    echo "$(INSTALLSRCDIR) not found --> nothing to uninstall!"; \
	fi
	@if [ -d $(INSTALLCLSDIR) ]; then \
	    $(RM) -v $(foreach file,$(CLS_FILES),$(INSTALLCLSDIR)/$(file)); \
	    if ls $(INSTALLCLSDIR) > /dev/null 2>&1; then \
	        $(RMDIR) -v $(INSTALLCLSDIR); \
	    else \
	        echo "$(INSTALLCLSDIR) not empty!"; \
	    fi; \
	else \
	    echo "$(INSTALLCLSDIR) not found --> nothing to uninstall!"; \
	fi
	@if [ -d $(INSTALLDOCDIR) ]; then \
	    $(RM) -v $(foreach file,$(STATIC_DOC),$(INSTALLDOCDIR)/$(file)); \
	    if ls $(INSTALLDOCDIR) > /dev/null 2>&1; then \
	        $(RMDIR) -v $(INSTALLDOCDIR); \
	    else \
	        echo "$(INSTALLDOCDIR) not empty!"; \
	    fi; \
	else \
	    echo "$(INSTALLDOCDIR) not found --> nothing to uninstall!"; \
	fi

clean_local:
	$(SRM) *~ $(CLEANEXTS)

distclean_local: clean_local
	$(SRM) $(NODIST_GENERATED)

maintainclean_local: clean_local
	$(SRM) $(GENERATED)

dist_prior:
ifdef PREPARERELEASE
	developer/scripts/preparerelease.sh 1
endif
	-$(RMDIR) $(DISTDIR)
	$(MKDIR) $(DISTDIR)

dist_local: $(DIST_FILES)
	$(CP) $(DIST_FILES) $(DISTDIR)

dist_post:
	$(TARGZ) $(DISTDIR).tar.gz $(notdir $(DISTDIR))
	$(RMDIR) $(DISTDIR)
	$(LL) $(notdir $(DISTDIR)).tar.gz

dist-bz2_post:
	$(STARBZ) $(DISTDIR).tar.bz2 $(notdir $(DISTDIR))
	$(SRMDIR) $(DISTDIR)
	$(SLL) $(notdir $(DISTDIR)).tar.bz2

dist-zip_post:
	$(SZIP) $(DISTDIR).zip $(notdir $(DISTDIR))
	$(SRMDIR) $(DISTDIR)
	$(SLL) $(notdir $(DISTDIR)).zip

maintain_prior:
	-$(RMDIR) $(MAINTAINDIR)
	$(MKDIR) $(MAINTAINDIR)

maintain_local:
	$(CP) $(MAINTAIN_FILES) $(MAINTAINDIR)

maintain_post:
	$(TARGZ) $(MAINTAINDIR).tar.gz $(notdir $(MAINTAINDIR))
	$(RMDIR) $(MAINTAINDIR)
	$(LL) $(notdir $(MAINTAINDIR)).tar.gz

maintain-bz2_post:
	$(STARBZ) $(MAINTAINDIR).tar.bz2 $(notdir $(MAINTAINDIR))
	$(SRMDIR) $(MAINTAINDIR)
	$(SLL) $(notdir $(MAINTAINDIR)).tar.bz2

maintain-zip_post:
	$(SZIP) $(MAINTAINDIR).zip $(notdir $(MAINTAINDIR))
	$(SRMDIR) $(MAINTAINDIR)
	$(SLL) $(notdir $(MAINTAINDIR)).zip
# ----------------------------------------------------------------------