summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/disser/nomake.cmd
blob: b11cee262111857c9b285e72a5c5260f5df6004c (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
@echo off

rem nomake script for LaTeX packages
rem Author: Stanislav Kruchinin <stanislav.kruchinin@gmail.com>

if "%CMDEXTVERSION%"=="" (
	echo Error: This script requires command interpreter from Windows 2000 or above.
	goto :eof
)

if "%target%"=="" set target=disser
set subclass=gost732
set bst=disser-bst

if "%texmf%"=="" set texmf=%programfiles%\miktex

if "%clsdir%"=="" set clsdir=%texmf%\tex\latex\%target%
if "%bstdir%"=="" set bstdir=%texmf%\bibtex\bst\%target%
if "%docdir%"=="" set docdir=%texmf%\doc\latex\%target%
if "%bstdocdir%"=="" set bstdocdir=%texmf%\doc\bibtex\%target%

if "%clsfiles%"=="" set clsfiles=*.cls *.rtx
if "%docfiles%"=="" set docfiles=%target%.dvi %subclass%.pdf %target%.pdf %subclass%.pdf
if "%bstdocfiles%"=="" set bstdocfiles=%bst%.dvi %bst%.pdf
if "%bstfiles%"=="" set bstfiles=%target%.bst

if "%clfiles%"=="" set clfiles=*.rtx *.cls *.log *.out *.aux *.dvi *.ind ^
*.idx *.ilg *.glo *.toc *.ind *.bak *.bbl *.blg *.pdf *.sav *.ps *.bst

if "%latex%"=="" set latex=latex
if "%pdflatex%"=="" set pdflatex=pdflatex
if "%mi%"=="" set mi=makeindex

if "%latexflags%"=="" set latexflags=-src-specials
if "%pdflatexflags%"=="" set pdflatexflags=""

rem Default target
if "%1"=="" (
:default
	call :all
goto :eof
)

:start
if "%1"=="" goto :eof

if "%1"=="all" (
:all
	call :class
	call :doc
goto :eof
)

if "%1"=="class" (
:class
    %latex% %target%.ins
goto :eof
)

if "%1"=="clean" (
:clean
	del %clfiles%
goto :eof
)

if "%1"=="doc" (
:doc
	call :dvi
	call :pdf
goto :eof
)

if "%1"=="dvi" (
:dvi
	%latex% %latexflags% %target%.dtx
	%mi% -r %target%
	%latex% %latexflags% %target%.dtx
	%latex% %latexflags% %subclass%.dtx
	%latex% %latexflags% %subclass%.dtx
	%latex% %latexflags% %bst%.dtx
	%latex% %latexflags% %bst%.dtx
goto :eof
)

if "%1"=="pdf" (
:pdf
	%pdflatex% %pdflatexflags% %target%.dtx
	%mi% -r %target%
	%pdflatex% %pdflatexflags% %target%.dtx
	%pdflatex% %pdflatexflags% %subclass%.dtx
	%pdflatex% %pdflatexflags% %subclass%.dtx
	%pdflatex% %pdflatexflags% %bst%.dtx
	%pdflatex% %pdflatexflags% %bst%.dtx
goto :eof
)

if "%1"=="install" (
:install
	if not exist %target%.cls call :all
	if not exist "%clsdir%" md "%clsdir%"
	if not exist "%docdir%" md "%docdir%"
	if not exist "%bstdir%" md "%bstdir%"
	if not exist "%bstdocdir%" md "%bstdocdir%"
	for %%f in (%clsfiles%) do xcopy /y /f %%f "%clsdir%"
	for %%f in (%docfiles%) do xcopy /y /f %%f "%docdir%"
	for %%f in (%bstfiles%) do xcopy /y /f %%f "%bstdir%"
	for %%f in (%bstdocfiles%) do xcopy /y /f %%f "%bstdocdir%"
goto :eof
)

if "%1"=="help" (
:help
	echo List of targets:
	echo   all       ^(default^) build classes and documentation
	echo   class     build classes
	echo   clean     remove ouptut files
	echo   doc       build documentation
	echo   dvi       build DVI version of documentation
	echo   help      show help
	echo   install   install package and documentation
	echo   pdf       build PDF version of documentation
goto :eof
)

if "%1" neq "" echo Don't know how to make %1
:end
shift & goto :start