summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/koma-script/doc/Makefile.guide
blob: 0956492f512eb8d44ef31884d483378758f7b1d6 (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
# ======================================================================
# Makefile.guide
# Copyright (c) Markus Kohm, 2002-2019
#
# 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.3c of the license.
# The latest version of this license is in
#   http://www.latex-project.org/lppl.txt
# and version 1.3c 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.guide
# Copyright (c) Markus Kohm, 2002-2019
#
# Dieses Werk darf nach den Bedingungen der LaTeX Project Public Lizenz,
# Version 1.3c, verteilt und/oder veraendert werden.
# Die neuste Version dieser Lizenz ist
#   http://www.latex-project.org/lppl.txt
# und Version 1.3c 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.
# ======================================================================

# ----------------------------------------------------------------------
# Load common rules
include $(BASEDIR)Makefile.baserules
# Load variable definitions
include $(BASEDIR)Makefile.baseinit
include $(DOCDIR)Makefile.latexinit
# ----------------------------------------------------------------------
# Temporary folder, used to create distribution.
# Same folder with postfix "-maintain" will be used to create maintain-
# distribution.
ifdef DISTDIR
export DISTDIR	   := $(DISTDIR)/$(LANGUAGE)
endif
ifdef MAINTAINDIR
export MAINTAINDIR := $(MAINTAINDIR)/$(LANGUAGE)
endif
ifdef INSTALLSRCDIR
export INSTALLSRCDIR := $(INSTALLSRCDIR)/$(LANGUAGE)
endif

# ----------------------------------------------------------------------
# List of all Makefiles
MAKE_FILES	= Makefile

# ----------------------------------------------------------------------
GUIDENAME       = scrgui$(LANGUAGESHORTCUT)

ifeq ($(LANGUAGE),english)
TEX_APPENDICES  = japanlco.tex
else
TEX_APPENDICES  =
endif

TEX_CHAPTERS     = preface.tex introduction.tex \
                   authorpart.tex typearea.tex scrbookreportarticle.tex \
                   scrlttr2.tex scrlayer-scrpage.tex \
		   scrdatetime.tex scraddr.tex \
                   adrconvnote.tex scrextend.tex scrjura.tex \
                   expertpart.tex scrbase.tex scrlfile.tex scrwfile.tex \
		   tocbasic.tex scrhack.tex \
		   scrlayer.tex \
		   scrlayer-scrpage-experts.tex scrlayer-notecolumn.tex \
                   typearea-experts.tex scrbookreportarticle-experts.tex \
                   scrlttr2-experts.tex \
                   $(TEX_APPENDICES)

TEX_MISC         = ../guide.tex ../linkalias.tex \
		   common-options.tex \
		   common-compatibility.tex \
		   common-draftmode.tex \
		   common-typearea.tex \
		   common-fontsize.tex \
		   common-textmarkup.tex \
		   common-parmarkup.tex \
		   common-oddorevenpage.tex \
		   common-interleafpage.tex \
		   common-footnotes.tex \
		   common-lists.tex \
		   common-marginpar.tex \
		   common-titles.tex \
		   common-dictum.tex \
		   common-headfootheight.tex \
		   common-pagestylemanipulation.tex

EXAMPLE_LETTER_DTX = scrlttr2examples.dtx

EXAMPLE_LETTER_LETTERS = $(foreach num,\
                           0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 \
                           20 21 22 23 nipponA nipponB,\
                           letter-$(num).tex)

EXAMPLE_LETTER_DTX_RESULT = $(EXAMPLE_LETTER_LETTERS) musterlogo.eps ich.lco

EXAMPLE_NOTECOLUMN_SRC = scrlayer-notecolumn-example.tex
EXAMPLE_NOTECOLUMN_PDF = $(addsuffix .pdf,$(basename $(EXAMPLE_NOTECOLUMN_SRC)))

EXAMPLE_JURA_SRC = scrjuraexample.tex

EXAMPLE_JURA_PDF = $(addsuffix .pdf,$(basename $(EXAMPLE_JURA_SRC)))

PLENGTH_DTX      = $(DOCDIR)plength.dtx

PLENGTH_DTX_RESULT = plength.drv plenDIN.mp varDIN.mp plinc.mp \
                   pltex-vars.mp pltex-terms.mp pllcoDIN.mp

PLENGTH_PDF      = plenDIN.pdf varDIN.pdf

PDF_EPS_SRC      = musterlogo.eps

PDF_EPS          = $(addsuffix .pdf,$(basename $(PDF_EPS_SRC)))

EXAMPLE_LETTER_TEX_SRC = $(EXAMPLE_LETTER_LETTERS) ich.lco
EXAMPLE_LETTER_SRC = $(EXAMPLE_LETTER_TEX_SRC) $(PDF_EPS)
EXAMPLE_LETTER_PDF = $(addsuffix .pdf,$(basename $(EXAMPLE_LETTER_LETTERS)))

GENERATED_SRC    = $(EXAMPLE_LETTER_PDF) $(PLENGTH_PDF) \
                   $(EXAMPLE_NOTECOLUMN_PDF) $(EXAMPLE_JURA_PDF)

GENERATED_CLEAN  = $(GENERATED_SRC) \
		   $(EXAMPLE_LETTER_DTX_RESULT) letter-label.tex \
		   $(PDF_EPS) \
                   $(PLENGTH_DTX_RESULT) 

TEX_SRC		= guide-$(LANGUAGELONG).tex $(TEX_CHAPTERS) $(TEX_MISC)

MISC_SRC	= $(MAKE_FILES) htmlsetup

DIST_SRC	= $(MISC_SRC) $(TEX_SRC) $(EXAMPLE_LETTER_DTX) \
		  $(EXAMPLE_NOTECOLUMN_SRC) $(EXAMPLE_JURA_SRC)

GUIDE_FILES     = $(GUIDENAME).pdf $(GUIDENAME).html

DIST_FILES	= $(DIST_SRC) $(GUIDE_FILES)

MAINTAIN_SRC	= $(DIST_SRC)

MAINTAIN_FILES	= $(MAINTAIN_SRC)

# ----------------------------------------------------------------------
# local rules
default_local: $(GUIDE_FILES)

prepare_local:
#	$(ECHO) $(GENERATED_SRC)

clean_local:
	$(RM) *.aux *.bbl *.blg *.glo *.idx *.ilg *.ind *.lof *.log *.lot \
	      *.dvi *.tmp  mpxerr.tex *.1 *.mp.keep *.mpo \
	      *.md5 *.toc *.mpx *.drv *.chn *.xref *.slnc

distclean_local: clean_local
	$(RM) $(GENERATED_CLEAN)

maintainclean_local: distclean_local
	$(RM) guide.pdf $(GUIDENAME).pdf $(GUIDENAME).html

ifdef DISTDIR

install_local: $(DIST_FILES)
	@if ! $(MKDIR) $(INSTALLSRCDIR) || \
	    ! [ -d $(INSTALLDOCDIR) ]; then \
	    echo '--------------------------------------------------'; \
	    echo '| Cannot install to' $(INSTALLSRCDIR) or $(INSTALLDOCDIR)!; \
	    echo '| You should try:'; \
	    echo '|     sudo "make install"'; \
	    echo '--------------------------------------------------'; \
	    exit 1; \
	fi
	$(INSTALL) $(DIST_SRC) $(INSTALLSRCDIR)
	$(INSTALL) $(GUIDE_FILES) $(INSTALLDOCDIR)
	$(foreach file,$(GUIDE_FILES),$(SYMLINK) ../../../../doc/latex/koma-script/$(file) $(INSTALLSRCDIR)/../$(file);)
	$(SECHO) ------------------------------------------------------------
	$(SECHO) Installed files at $(INSTALLSRCDIR):
	$(SECHO) $(DIST_SRC)
	$(SECHO) ------------------------------------------------------------
	$(SECHO) Installed files at $(INSTALLDOCDIR):
	$(SECHO) $(GUIDE_FILES)
	$(SECHO) ------------------------------------------------------------
	$(SECHO) Links at $(INSTALLSRCDIR)/..:
	$(SECHO) $(GUIDE_FILES)
	$(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 $(INSTALLDOCDIR) ]; then \
	    $(RM) -v $(foreach file,$(GUIDE_FILES),$(INSTALLDOCDIR)/$(file)); \
	else \
	    echo "$(INSTALLDOCDIR) not found --> nothing to uninstall!"; \
	fi

dist_local: $(DIST_FILES)
	-$(RMDIR) $(DISTDIR)
	$(MKDIR) $(DISTDIR)
	$(CP) $(DIST_FILES) $(DISTDIR)

maintain_local:
	-$(RMDIR) $(MAINTAINDIR)
	$(MKDIR) $(MAINTAINDIR)
	$(CP) $(MAINTAIN_FILES) $(MAINTAINDIR)

else

install_local:
	$(error install not supported at local make)

uninstall_local:
	$(error uninstall not supported at local make)

dist_local:
	$(error dist not supported at local make)

maintain_prior:
	$(error maintain not supported at local make)

endif

# ----------------------------------------------------------------------
# usefull addons

edit:
	$(EDITOR) $(TEX_SRC)

# ----------------------------------------------------------------------
# file rules

CKSUMFILES = $(BIBTEX_SRC) $(MAKEINDEXSTYLE) $(MAKECHANGESTYLE) \
	     guide.aux guide.ind guide.idx guide.bbl guide.toc guide.lot \
	     guide.chn guide.glo \
	     $(foreach file,$(TEX_CHAPTERS) $(TEX_NONFREECHAPTERS),$(basename $(file)).aux)

define latex
	$(SMV) $@ guide.pdf || exit 0
	@while ! $(CKSUM) -c guide.md5; do \
	  $(CKSUM) $(CKSUMFILES) > guide.md5 \
	  && $(PDFLATEX) guide.tex \
	  && ( $(BIBTEX) guide || [ $$? -le $(BIBTEXNOERROR) ] || exit 1 ) \
          && $(BIBTEXFIX) guide.bbl \
	  && $(MAKEINDEX) guide.ind guide.idx  \
	  && $(INDEXPOSTOP) guide \
	  && $(MAKECHANGE) guide.chn guide.glo \
	  || exit 1;\
	done
	$(SMV) guide.pdf $@
endef

$(GUIDENAME).html: htmlsetup guide.aux \
                   $(foreach file,$(TEX_CHAPTERS) $(TEX_NONFREECHAPTERS),\
		             $(basename $(file)).aux)
	$(GENHTMLINDEX) $(addsuffix .aux,\
	                  $(basename $(TEX_CHAPTERS) $(TEX_NONFREECHAPTERS)))\
			  >$@

$(GUIDENAME).pdf: $(DOCDIR)scrguide.cls $(DOCDIR)guide.tex $(GENERATED_SRC)\
		  guide.aux guide.bbl $(BIBTEX_SRC) \
	          $(MAKEINDEXSTYLE) guide.ind guide.idx \
		  $(MAKECHANGESTYLE) guide.chn guide.glo \
	          $(TEX_SRC) $(TEX_NONFREECHAPTERS) $(TEX_NONFREEMISC)
	$(SRM) guide.md5
	$(latex)

$(PLENGTH_DTX_RESULT): $(PLENGTH_DTX)
	$(PDFLATEX) $<

$(PLENGTH_PDF): $(PLENGTH_DTX_RESULT)
	$(MPOST) $(addsuffix .mp,$(basename $@))
	$(MPTOPDF) $(addsuffix .mp,$(basename $@))
	@if [ -r $(addsuffix .pdf,$(basename $@)-1)];\
	  then $(MV) $(addsuffix .pdf,$(basename $@)-1) $@;\
	fi

$(PDF_EPS): $(PDF_EPS_SRC)
	$(EPSTOPDF) $(addsuffix .eps,$(basename $@))

$(EXAMPLE_LETTER_PDF): $(EXAMPLE_LETTER_SRC)
	$(PDFLATEX) $(addsuffix .tex,$(basename $@))

$(EXAMPLE_LETTER_DTX_RESULT): $(EXAMPLE_LETTER_DTX)
	$(PDFLATEX) $<

ifdef EXAMPLE_NOTECOLUMN_SRC
$(EXAMPLE_NOTECOLUMN_PDF): $(EXAMPLE_NOTECOLUMN_SRC)
	$(PDFLATEX) $<
	$(PDFLATEX) $<
	$(PDFLATEX) $<
	$(PDFLATEX) $<
endif

ifdef EXAMPLE_JURA_SRC
$(EXAMPLE_JURA_PDF): $(EXAMPLE_JURA_SRC)
	$(PDFLATEX) $(addsuffix .tex,$(basename $@))
	$(PDFLATEX) $(addsuffix .tex,$(basename $@))
	$(PDFLATEX) $(addsuffix .tex,$(basename $@))
endif

guide.ind: guide.idx
	$(MAKEINDEX) $@ $<
	$(INDEXPOSTOP) guide

guide.chn: guide.glo
	$(MAKECHANGE) $@ $<

guide.bbl: $(BIBTEX_SRC) guide.aux
	$(BIBTEX) guide || test $$? -le $(BIBTEXNOERROR)
	$(BIBTEXFIX) guide.bbl

guide.glo guide.idx guide.aux: $(DOCDIR)guide.tex $(TEX_SRC) \
	                       $(TEX_NONFREECHAPTERS) $(TEX_NONFREEMISC)
	$(PDFLATEX) guide.tex

# ----------------------------------------------------------------------