summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/koma-script/Makefile.unx
blob: 2a11523889b6946a96de13bc4b4ed5085907465a (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
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
########################################################################
# Creating a installed version of KOMA-Script
# Copyright (c) Markus Kohm, 1999-2004
#
#>>>> USE THIS ONLY, IF THERE IS A TDS-COMPATIBLE TEX-INSTALLATION! <<<<
#>>>>     DO NOT CHANGE ANYTHING BUT THE CUSTOMIZATION SECTION!     <<<<
#>>>>                 YOU NEED GNU-MAKE TO RUN THIS!                <<<<
#
# Defined rules for users:
#
#   all       default rule if make is called without parameter,
#             generates all KOMA-Script-files but not the guides
#   install   installs all files in a TDS-tree
#
#   guides    makes all the guides but ps-files 
#   optionalguides
#             like guides but does also make the ps-files
#
#   scrguide2p
#             generates a scrguide2p.ps, a postscript file with two
#             A5 pages together at A5 pages 
#             (doesn't need installation with unmodified maintainer 
#             distribution)
#   scrguide4p
#             generates a scrguide4p.ps, a postscript file with four
#             A5 pages aranged at A4 page for book printing 
#             (doesn't need installation with unmodified maintainer 
#             distribution)
#   scrguide4p16
#             generates a scrguide4p16.ps, a postscript file like 
#             scrguide4p.ps but with signature=16 (see psbook)
#             (doesn't need installation with unmodified maintainer 
#             distribution)
#
#   srcclean  deletes all generated files (but *tar.gz)
#   distclean deletes all generated files (but *tar.gz) not part of 
#             the distribution
#   clean     deletes all temporary files
#
#   dist      generates a tar file koma-script-<date>.tar.gz with all
#             files of the distribution
#             (needs unmodified maintainer distribution)
#
#   texlive   generates a directory structure, which may be copied to
#             TeXLive
########################################################################

########################################################################
#   Start of customization section
########################################################################

# The texmf-directory, where to install new stuff (see texmf.cnf)
# If you don't know what to do, search for directory texmf at /usr.
# With teTeX and linux often one of following is used:
#INSTALLTEXMF ?= /usr/TeX/texmf
#INSTALLTEXMF ?= /usr/local/TeX/texmf
#INSTALLTEXMF ?= /usr/share/texmf
#INSTALLTEXMF ?= /usr/local/share/texmf
# user tree:
#INSTALLTEXMF ?= $(HOME)/texmf
# Try to use user's tree known by kpsewhich:
#INSTALLTEXMF ?= `kpsewhich --expand-var '$$HOMETEXMF'`
# Try to use the local tree known by kpsewhich:
INSTALLTEXMF ?= `kpsewhich --expand-var '$$TEXMFLOCAL'`
# But you may set INSTALLTEXMF to every directory you want. 
# Use following, if you only want to test the installation:
#INSTALLTEXMF ?= /tmp/texmf

# If texhash must run after installation, you can invoke this:
TEXHASH ?= texhash

# You should change following only, if you want to change defaults!

# The directory, where to install *.cls and *.sty
CLSDIR=$(INSTALLTEXMF)/tex/latex/koma-script

# The directory, where to install documentation
DOCDIR=$(INSTALLTEXMF)/doc/latex/koma-script

# The directory, where to install the sources
SRCDIR=$(INSTALLTEXMF)/source/latex/koma-script

# The directory, where to install demo-files
# If we have some, we have to add following 2 lines to install rule:
#	  $(MKDIR) $(DEMODIR); \
#	  $(INSTALL) $(DEMO_FILES) $(DEMODIR); \
DEMODIR=$(DOCDIR)/demo

# We need this, because the documentation needs the classes and packages
# It's not realy a good solution, but it's a working solution, if no
# KOMA-Script was installed.
TEXINPUTS := $(PWD):$(TEXINPUTS)

########################################################################
#   End of customization section                     
########################################################################

# Used command:
LATEX      = latex
PDFLATEX   = pdflatex
NONSTOPMODE = \\nonstopmode\\input
BATCHMODE   = \\batchmode\\input
RM         = rm -f
RMDIR      = rm -fr
CP         = cp -f
CPALL      = cp -Rpf
CD         = cd
MV         = mv -f
SYMLINK    = ln -sf
INSTALL    = install -m 644
MKDIR      = install -m 755 -d
MAKEINDEX  = makeindex -g -r -s scrguide.ist
MAKECHANGE = makeindex -g -r -s scrguide.gst -o 
MAKEIDX    = makeindex -g
GENINDEX   = $(PWD)/genindex.pl
BIBTEX     = bibtex
DVIPS      = dvips -Pwww
ECHO       = echo
ECHONONL   = echo -n
TARCREATE  = tar -zcvf
TARCREATEBZ = tar -jcvf
ZIPCREATE  = zip -9o
DIRNAME    = dirname
LL         = ls -l
LLL        = ls -sh1
SED        = sed
CUT        = cut
GREP       = grep
PSSELECT   = psselect
PSBOOK     = psbook
PSTOPS     = pstops
EVAL       = eval

LOGMESSAGE = 'KOMA-Script was made at '`date`'.'
GERMREADME = 'Wenn Sie Deutsch verstehen, lesen Sie bitte liesmich.txt.'
ENGREADME  = 'If you do not understand german, read readme.txt.'

########################################################################

# files needed only for generation of documentation files
RMEXT       = *.log *.aux *.toc *.lot *.lof *.out *.ilg *.idx *.ind \
              *.blg *.bbl *.glg *.glx *.glo *.gls

# documentation files
RMOUT       = *.pdf *.dvi *.ps

# class and package files
RMCLS       = *.cls *.sty

# sources of KOMA-Script News
NEWS_SRC    = scr_new1.tex \
              scr_new2.tex \
              scr_new3.tex \
              scr_new4.tex \
              scr_new5.tex \
              scr_new6.tex \
              scr_new7.tex \
              scr_new8.tex \
              scr_new9.tex \
              scrnew10.tex \
              scrnew11.tex \
              scrnew12.tex \
              scrnew13.tex \
              scrnew14.tex \
              scrnew15.tex \
              scrnew16.tex \
              scrnew17.tex \
              scrnew18.tex \
              scrnew19.tex \
              scrnew20.tex \
	      scrnew21.tex

# folder with german manual
DE_GUIDE_DIR = scrguide

# source of german manual
DE_GUIDE_SRC = $(DE_GUIDE_DIR)/scrguide2.tex \
              $(DE_GUIDE_DIR)/einleit.tex \
              $(DE_GUIDE_DIR)/satzspgl.tex \
              $(DE_GUIDE_DIR)/hauptcls.tex \
              $(DE_GUIDE_DIR)/layout.tex \
              $(DE_GUIDE_DIR)/datmzeit.tex \
              $(DE_GUIDE_DIR)/brief.tex \
              $(DE_GUIDE_DIR)/adressen.tex \
              $(DE_GUIDE_DIR)/adrkonv.tex \
              $(DE_GUIDE_DIR)/datladen.tex \
              $(DE_GUIDE_DIR)/scrguide.bib \
              $(DE_GUIDE_DIR)/scrguide.bst \
              $(DE_GUIDE_DIR)/scrguide.dbj \
              $(DE_GUIDE_DIR)/scrguide.mbs \
              $(DE_GUIDE_DIR)/scrguide.ist \
	      $(DE_GUIDE_DIR)/scrguide.gst

# folder with english manual
EN_GUIDE_DIR = scrguide/english
EN_GUIDE_RELTO_BASE = ../..

# source of english manual
EN_GUIDE_SRC = $(EN_GUIDE_DIR)/main.tex \
               $(EN_GUIDE_DIR)/scrguide2.tex \
               $(EN_GUIDE_DIR)/introduc.tex \
	       $(EN_GUIDE_DIR)/pglayout.tex \
               $(EN_GUIDE_DIR)/maincls.tex \
               $(EN_GUIDE_DIR)/headfoot.tex \
               $(EN_GUIDE_DIR)/datetime.tex \
               $(EN_GUIDE_DIR)/letter.tex \
               $(EN_GUIDE_DIR)/addressf.tex \
               $(EN_GUIDE_DIR)/addrconv.tex \
	       $(EN_GUIDE_DIR)/loadfile.tex \
               $(EN_GUIDE_DIR)/scrguide.bib \
               $(EN_GUIDE_DIR)/scrguide-en.bst \
               $(EN_GUIDE_DIR)/scrguide-en.dbj \
               $(EN_GUIDE_DIR)/scrguide.mbs \
               $(EN_GUIDE_DIR)/scrguide.ist \
	       $(EN_GUIDE_DIR)/scrguide.gst

# other source files (unused)
MISC_SRC    = Makefile.unx \
	      genindex.pl

# source of all manuals
GUIDE_SRC   = koma-script.tex \
	      $(DE_GUIDE_SRC) $(EN_GUIDE_SRC)

# ready made KOMA-Script News
NEWS        = ${NEWS_SRC:.tex=.dvi}

# ready made german guides
DE_GUIDES   = scrguide.dvi \
              scrguide.pdf
# ready made german guides (optional)
O_DE_GUIDES = scrguide.ps

# ready made english guides
EN_GUIDES   = scrguien.dvi \
              scrguien.pdf
# ready made english guide (optional)
O_EN_GUIDES = scrguien.ps

# ready made guides
GUIDES      = koma-script.pdf \
              komascript.pdf \
              komascr.pdf \
	      $(DE_GUIDES) $(EN_GUIDES)
# ready made guide (optional)
OGUIDES    = $(O_DE_GUIDES) $(O_EN_GUIDES)

# primary dtx files
DTX_FILES   = scrclass.dtx \
	      scraddr.dtx \
	      scrlettr.dtx \
	      scrtime.dtx \
	      scrpage.dtx
#	      script20.dtx \

# dtx includes
DTX_INCLUDE = scrlogo.dtx

# batch files
INS_FILES   = komascr.ins \
	      scrclass.ins \
	      scrtime.ins \
	      scrpage.ins

# all sourced need to made classes and packages
CLS_SRC     = $(DTX_FILES) \
	      $(DTX_INCLUDE) \
	      $(INS_FILES) \
	      $(MISC_SRC)

# all files needed by generations
SRC_FILES   = $(CLS_SRC) \
	      $(GUIDE_SRC) \
	      $(NEWS_SRC)

# text files
TEXT_FILES  = ChangeLog      \
              liesmich.txt   \
              readme.txt     \
	      LEGAL.TXT      \
              LEGALDE.TXT    \
              INSTALL.TXT    \
              INSTALLD.TXT

# misc installation files
MISC_FILES  = komabug.tex

# files at distribution source
DIST_SRC    = $(TEXT_FILES)  \
	      $(SRC_FILES)   \
              $(MISC_FILES)

# files at distribution contents file
XDIST_FILES = 00README  \
              $(GUIDES) \
              $(DIST_SRC)

# files at distribution
DIST_FILES  = 00CONTEN \
	      komascript.md5 \
              $(XDIST_FILES)

# files to be installed at CLSDIR
CLS_FILES   = scrartcl.cls \
              scrreprt.cls \
              scrbook.cls  \
              typearea.sty \
	      scrlfile.sty \
              scrlettr.cls \
	      scrlttr2.cls \
	      scraddr.sty \
	      DIN.lco \
              DINmtext.lco \
              SNleft.lco \
	      SN.lco \
              KOMAold.lco \
              scrtime.sty  \
              scrdate.sty  \
              scrpage.sty  \
              scrpage2.sty

# files to be installed at DOCDIR
DOC_FILES   = $(GUIDES)     \
              $(TEXT_FILES) \
              $(NEWS)       \
              komabug.tex

# optional files to be installed at DOCDIR
ODOC_FILES  = $(OGUIDES)

# installation documentation files
IDOC_FILES  = ${DTX_FILES:.dtx=.dvi}

# installation documentation log files
ILOG_FILES  = ${DTX_FILES:.dtx=.log}

########################################################################
 
all: komascript.log #guides

guides: $(GUIDES)

optionalguides: guides $(OGUIDES)

komascript.log: Makefile $(CLS_SRC) $(NEWS)
	$(LATEX) komascr.ins
	$(ECHO) $(LOGMESSAGE) > komascript.log

Makefile: Makefile.unx
	@if test -r Makefile && test Makefile.unx -nt Makefile; then\
	  $(ECHO) "Makefile.unx is newer than Makefile!";\
	  $(ECHO) "Delete or Re-edit it!";\
	  exit 1;\
	fi 
	$(SYMLINK) Makefile.unx Makefile

scr_new%.dvi: scr_new%.tex
	$(LATEX) $(NONSTOPMODE) $<
	$(LATEX) $(BATCHMODE) $<

scrnew%.dvi: scrnew%.tex
	$(LATEX) $(NONSTOPMODE) $<
	$(LATEX) $(BATCHMODE) $<

scrguide: $(DE_GUIDES)

scrguide2p:	scrguide2p.ps

scrguide4p16:	scrguide4p16.ps

scrguide4p:	scrguide4p.ps

screnggu: scrguide-english

scrguien: scrguide-english

scrguide-english: $(EN_GUIDES)

scrguide.dvi:	$(DE_GUIDE_DIR)/scrguide2.dvi
	$(CP) $(DE_GUIDE_DIR)/scrguide2.dvi scrguide.dvi

scrguide.ps:	scrguide.dvi
	$(DVIPS) scrguide.dvi -oscrguide.ps

scrguide2p.ps:	scrguide.ps
	$(PSSELECT) -p1,2,_,3- scrguide.ps tmp.ps
	$(PSTOPS) -w29.7cm -h21cm '2:0L(21cm,0)+1L(21cm,14.85cm)' \
	       tmp.ps tmp2.ps
	$(SED) 's/%%BoundingBox: 0 0 420 596/%%BoundingBox: 0 0 596 842/' \
	    tmp2.ps > scrguide2p.ps
	$(RM) tmp.ps tmp2.ps

scrguide4p16.ps:	scrguide.ps
	$(PSBOOK) -s16 scrguide.ps tmp.ps
	$(PSTOPS) '4:0L(21cm,0)+1L(21cm,14.85cm),2R(0,29.7cm)+3R(0,14.85cm)' \
	       tmp.ps tmp2.ps
	$(SED) 's/%%BoundingBox: 0 0 420 596/%%BoundingBox: 0 0 596 842/' \
	    tmp2.ps > scrguide4p16.ps
	$(RM) tmp.ps tmp2.ps

scrguide4p.ps:	scrguide.ps
	$(PSBOOK) scrguide.ps tmp.ps
	$(PSTOPS) '4:0L(21cm,0)+1L(21cm,14.85cm),2R(0,29.7cm)+3R(0,14.85cm)' \
	       tmp.ps tmp2.ps
	$(SED) 's/%%BoundingBox: 0 0 420 596/%%BoundingBox: 0 0 596 842/' \
	    tmp2.ps > scrguide4p.ps
	$(RM) tmp.ps tmp2.ps

scrguide.pdf:	$(DE_GUIDE_DIR)/scrguide2.pdf
	$(CP) $(DE_GUIDE_DIR)/scrguide2.pdf scrguide.pdf

scrguien.dvi: $(EN_GUIDE_DIR)/main.dvi
	$(CP) $(EN_GUIDE_DIR)/main.dvi scrguien.dvi

scrguien.ps:	scrguien.dvi
	$(DVIPS) scrguien.dvi -oscrguien.ps

scrguien.pdf:	$(EN_GUIDE_DIR)/main.pdf
	$(CP) $(EN_GUIDE_DIR)/main.pdf scrguien.pdf

screnggu.dvi:	$(EN_GUIDE_DIR)/screnggu.dvi
	$(CP) $(EN_GUIDE_DIR)/screnggu.dvi .

screnggu.ps:	screnggu.dvi
	$(DVIPS) screnggu.dvi -oscrenggu.ps

screnggu.pdf:	$(EN_GUIDE_DIR)/screnggu.pdf
	$(CP) $(EN_GUIDE_DIR)/screnggu.pdf .

koma-script.pdf: koma-script.tex
	$(PDFLATEX) $(NONSTOPMODE) koma-script.tex

komascript.pdf: koma-script.pdf
	$(SYMLINK) koma-script.pdf komascript.pdf

komascr.pdf: koma-script.pdf
	$(SYMLINK) koma-script.pdf komascr.pdf


ifneq ($(USEMULTIINDEX),false)
USEMULTIINDEX = test -x $(GENINDEX)
endif

$(DE_GUIDE_DIR)/scrguide2.dvi: komascript.log $(DE_GUIDE_SRC)
	$(CD) $(DE_GUIDE_DIR) && \
	$(RM) $(RMEXT) && \
	( oncemore=true; \
	  while $$oncemore; do \
	    $(LATEX) $(NONSTOPMODE) scrguide2.tex && \
	    $(BIBTEX) scrguide2 && \
	    $(MAKECHANGE) scrguide2.chn scrguide2.glo && \
	    $(MAKEINDEX) scrguide2 && \
	    ( ! $(USEMULTIINDEX) || $(GENINDEX) scrguide2 ); \
	    if test $$? != 0; then rm scrguide2.dvi; exit 1; fi;\
	    if $(GREP) Rerun scrguide2.log;\
	    then oncemore=true; else oncemore=false; fi;\
	  done;\
	)

$(DE_GUIDE_DIR)/scrguide2.pdf: komascript.log $(DE_GUIDE_SRC)
	$(CD) $(DE_GUIDE_DIR) && \
	$(RM) $(RMEXT) && \
	( oncemore=true; \
	  while $$oncemore; do \
	    $(PDFLATEX) $(NONSTOPMODE) scrguide2.tex && \
	    $(BIBTEX) scrguide2 && \
	    $(MAKECHANGE) scrguide2.chn scrguide2.glo && \
	    $(MAKEINDEX) scrguide2 && \
	    ( ! $(USEMULTIINDEX) || $(GENINDEX) scrguide2 ); \
	    if test $$? != 0; then rm scrguide2.pdf; exit 1; fi;\
	    if $(GREP) Rerun scrguide2.log;\
	    then oncemore=true; else oncemore=false; fi;\
	  done;\
	)

$(EN_GUIDE_DIR)/main.dvi: komascript.log $(EN_GUIDE_SRC)
	$(CD) $(EN_GUIDE_DIR) && \
	$(RM) $(RMEXT) && \
	( oncemore=true; \
	  while $$oncemore; do \
	    $(LATEX) $(NONSTOPMODE) main.tex && \
	    $(BIBTEX) main && \
	    $(MAKECHANGE) main.chn main.glo && \
	    $(MAKEINDEX) main && \
	    ( ! $(USEMULTIINDEX) || $(GENINDEX) main ); \
	    if test $$? != 0; then rm main.dvi; exit 1; fi;\
	    if $(GREP) Rerun main.log;\
	    then oncemore=true; else oncemore=false; fi;\
	  done;\
	)

$(EN_GUIDE_DIR)/main.pdf: komascript.log $(EN_GUIDE_SRC)
	$(CD) $(EN_GUIDE_DIR) && \
	$(RM) $(RMEXT) && \
	( oncemore=true; \
	  while $$oncemore; do \
	    $(PDFLATEX) $(NONSTOPMODE) main.tex && \
	    $(BIBTEX) main && \
	    $(MAKECHANGE) main.chn main.glo && \
	    $(MAKEINDEX) main && \
	    ( ! $(USEMULTIINDEX) || $(GENINDEX) main ); \
	    if test $$? != 0; then rm main.pdf; exit 1; fi;\
	    if $(GREP) Rerun main.log;\
	    then oncemore=true; else oncemore=false; fi;\
	  done;\
	)

$(EN_GUIDE_DIR)/scrguide2.tex: $(DE_GUIDE_DIR)/scrguide2.tex
	$(SYMLINK) $(EN_GUIDE_RELTO_BASE)/$(DE_GUIDE_DIR)/scrguide2.tex \
		$(EN_GUIDE_DIR)/scrguide2.tex

$(EN_GUIDE_DIR)/scrguide.bib: $(DE_GUIDE_DIR)/scrguide.bib
	$(SYMLINK) $(EN_GUIDE_RELTO_BASE)/$(DE_GUIDE_DIR)/scrguide.bib \
		 $(EN_GUIDE_DIR)/scrguide.bib

$(EN_GUIDE_DIR)/scrguide.ist: $(DE_GUIDE_DIR)/scrguide.ist
	$(SYMLINK) $(EN_GUIDE_RELTO_BASE)/$(DE_GUIDE_DIR)/scrguide.ist \
		$(EN_GUIDE_DIR)/scrguide.ist

$(EN_GUIDE_DIR)/scrguide.mbs: $(DE_GUIDE_DIR)/scrguide.mbs
	$(SYMLINK) $(EN_GUIDE_RELTO_BASE)/$(DE_GUIDE_DIR)/scrguide.mbs \
		$(EN_GUIDE_DIR)/scrguide.mbs

$(EN_GUIDE_DIR)/scrguide.gst: $(DE_GUIDE_DIR)/scrguide.gst
	$(SYMLINK) $(EN_GUIDE_RELTO_BASE)/$(DE_GUIDE_DIR)/scrguide.gst \
		$(EN_GUIDE_DIR)/scrguide.gst


########################################################################

install: clean komascript.log
	@if test "x" = "x$(INSTALLTEXMF)" || ! $(MKDIR) $(INSTALLTEXMF) \
	  || ! test -w "$(INSTALLTEXMF)"; then \
	  $(ECHO) "Not able to write to install directory \"$(INSTALLTEXMF)\"";\
	  $(ECHO) "Please edit INSTALLTEXMF at the Makefile first!"; \
	  exit 1 ; \
	fi
	@if test `pwd` = $(CLSDIR) -o `pwd` = $(SRCDIR) -o `pwd` = $(DOCDIR); \
	then \
	  $(CPALL) ./ /tmp/koma-script.tmp; \
	  $(CD) /tmp/koma-script.tmp; \
	  $(MAKE) install; \
	  $(RMDIR) /tmp/koma-script.tmp; \
	else \
	  $(ECHO) "Installation at $(INSTALLTEXMF):"; \
	  $(MKDIR) $(CLSDIR); \
	  $(ECHONONL) "  at $(CLSDIR): "; \
	  $(INSTALL) $(CLS_FILES) $(CLSDIR); \
	  $(ECHO) "."; \
	  $(MKDIR) $(DOCDIR); \
	  $(ECHONONL) "  at $(DOCDIR): "; \
	  $(INSTALL) $(DOC_FILES) $(DOCDIR); \
	  $(ECHONONL) "."; \
	  for file in "$(ODOC_FILES)"; do \
	    if test -r "$$file"; then \
	      $(ECHONONL) "."; \
	      $(INSTALL) $$file $(DOCDIR); \
	    fi; \
	  done; \
	  $(ECHO) "."; \
	  $(ECHONONL) "  at $(SRCDIR): "; \
	  for file in $(DIST_FILES); do \
	    dir=`dirname $$file`; \
	    if test "x$$dir" = "x"; \
	      then $(INSTALL) $$file $(SRCDIR); \
	      else $(ECHONONL) "."; \
	        $(MKDIR) $(SRCDIR)/$$dir; \
	        $(INSTALL) $$file $(SRCDIR)/$$dir; \
	    fi; \
	  done; \
	  $(ECHO) "."; \
	  $(INSTALL) komascript.log $(DOCDIR); \
	  $(ECHO) "done"; \
	fi
	@if test -z "$(TEXHASH)" ; then \
          $(ECHO) ;\
          $(ECHO) '>>> Maybe you have to run texhash or something else, now. <<<';\
          $(ECHO) ;\
        else \
          $(EVAL) $(TEXHASH); \
	fi

########################################################################

srcclean: distclean
	$(RM) $(RMOUT) 00*

distclean: clean
	$(RM) $(RMCLS) $(IDOC_FILES)
	$(CD) $(DE_GUIDE_DIR) && $(RM) $(RMOUT)
	$(CD) $(EN_GUIDE_DIR) && $(RM) $(RMOUT)

clean:
	$(RM) $(RMEXT)
	$(CD) $(DE_GUIDE_DIR) && $(RM) $(RMEXT)
	$(CD) $(EN_GUIDE_DIR) && $(RM) $(RMEXT)

########################################################################

.SUFFIXES: .dtx .dvi .log

.dtx.dvi:
	$(LATEX) $(NONSTOPMODE) $<
	$(LATEX) $(BATCHMODE) $<
	$(MAKEIDX) -r -s gind.ist $(<:.dtx=.idx)
	$(MAKEIDX) -r -s gglo.ist $(<:.dtx=.glo) -o $(<:.dtx=.gls)
	$(LATEX) $(BATCHMODE) $<

.dtx.log:
	$(LATEX) $(NONSTOPMODE) $<
	$(LATEX) $(BATCHMODE) $<
	$(MAKEIDX) -r -s gind.ist $(<:.dtx=.idx)
	$(MAKEIDX) -r -s gglo.ist $(<:.dtx=.glo) -o $(<:.dtx=.gls)
	$(LATEX) $(BATCHMODE) $<

ifeq ($(USER),mjk)
release:
	@for src in $(INS_FILES);do \
	  $(CP) $${src} $${src}.bak; \
	  $(SED) 's/\\let\\ifbeta\\iftrue/\\let\\ifbeta\\iffalse/1' \
	      <$${src}.bak >$${src}; \
	done
	@$(RM) Makefile
	$(SED) -e "s/^\(INSTALLTEXMF \?= \`kpsewhich .*HOME\)/#\1/" \
	       -e "s/^#\(INSTALLTEXMF \?= \`kpsewhich .*TEXMFLOCAL\)/\1/" \
	       <Makefile.unx >Makefile

beta:
	@for src in $(INS_FILES);do \
	  $(CP) $${src} $${src}.bak; \
	  $(SED) 's/\\let\\ifbeta\\iffalse/\\let\\ifbeta\\iftrue/1' \
	      <$${src}.bak >$${src}; \
	done
	@$(RM) Makefile
	$(SED) -e "s/^#\(INSTALLTEXMF \?= \`kpsewhich .*HOME\)/\1/" \
	       -e "s/^\(INSTALLTEXMF \?= \`kpsewhich .*TEXMFLOCAL\)/#\1/" \
	       <Makefile.unx >Makefile
endif

dist: komascript.log $(DIST_FILES) $(ILOG_FILES) $(IDOC_FILES)
	@if $(GREP) "Checksum not passed" *.log; then \
	  $(ECHO) "Cannot create tar because of checksum error" >&2; \
	else \
	  $(RM) koma-script-`date -I`.tar.gz; \
	  $(TARCREATE) koma-script-`date -I`.tar.gz $(DIST_FILES); \
	fi

check: dist-bzip
	$(RMDIR) /tmp/texmf/
	$(MKDIR) /tmp/texmf/source/latex/komascript
	$(CP) koma-script-`date -I`.tar.bz2 /tmp/texmf/source/latex/komascript
	cd /tmp/texmf/source/latex/komascript
	tar -xjf koma-script-`date -I`.tar.bz2
	$(RM) koma-script-`date -I`.tar.bz2
	$(eval export INSTALLTEXMF=/tmp/texmf)
	$(eval export TEXHASH=)
	$(MAKE) install 2>&1 | tee make.log
	echo "Test installation to /tmp/texmf was successfull."
	$(RMDIR) /tmp/texmf/source/latex/komascript
	tree /tmp/texmf

texlive: Makefile
	@if [ -z "$(TEXLIVE)" ]; then \
	  $(ECHO) "Error: You have to set up variable TEXLIVE!" >&2; \
	  exit 1; \
	fi
	$(eval export INSTALLTEXMF=$(TEXLIVE))
	$(eval export TEXHASH=)
	$(MAKE) install

dist-bzip: komascript.log $(DIST_FILES) $(ILOG_FILES) $(IDOC_FILES)
	@if $(GREP) "Checksum not passed" *.log; then \
	  $(ECHO) "Cannot create tar because of checksum error" >&2; \
	else \
	  $(RM) koma-script-`date -I`.tar.bz2; \
	  $(TARCREATEBZ) koma-script-`date -I`.tar.bz2 $(DIST_FILES); \
	fi

dist-zip: komascript.log $(DIST_FILES) $(ILOG_FILES) $(IDOC_FILES)
	@if $(GREP) "Checksum not passed" *.log; then \
	  $(ECHO) "Cannot create zip because of checksum error" >&2; \
	else \
	  $(RM) koma-script-`date -I`.zip; \
	  $(ZIPCREATE) koma-script-`date -I`.zip $(DIST_FILES); \
	fi

distsrc: komascript.log $(DIST_SRC) $(ILOG_FILES) $(IDOC_FILES)
	@if $(GREP) "Checksum not passed" *.log; then \
	  $(ECHO) "Cannot create tar because of checksum error" >&2; \
	else \
	  $(TARCREATE) koma-script-src-`date -I`.tar.gz $(DIST_SRC); \
	fi

komascript.md5: $(XDIST_FILES)
	$(MV) komascript.md5 komascript.md5.bak
	md5sum $(XDIST_FILES) > komascript.md5

00CONTEN: $(XDIST_FILES) komascript.md5
	$(LLL) $(XDIST_FILES) > 00CONTEN
	$(LLL) 00CONTEN >> 00CONTEN
	$(LLL) $(DIST_FILES) > 00CONTEN.TMP
	$(MV) 00CONTEN.TMP 00CONTEN

00README:
	$(ECHO) $(GERMREADME) > 00README
	$(ECHO) $(ENGREADME) >> 00README

########################################################################