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

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

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

setlocal enabledelayedexpansion

set target=disser
set subclass=gost732
set bst=gost705
set manual=manual

set clsfiles=*.cls *.rtx
set bstfiles=gost705.bst gost705s.bst
set csffiles=*.csf
set docfiles=%target%.pdf %subclass%.pdf %bst%.pdf %manual%.pdf
set textfiles=..\README ..\README.ru ..\ChangeLog
set srcfiles=*.dtx %target%.ins dtx.ist %manual%.tex Makefile nomake.cmd

if "!texmf!"==""   set texmf=%allusersprofile%\Application Data\MiKTeX\2.9
if "!destdir!"=="" set destdir=!texmf!
if "!clsdir!"==""  set clsdir=!destdir!\tex\latex\%target%
if "!bstdir!"==""  set bstdir=!destdir!\bibtex\bst\%target%
if "!csfdir!"==""  set csfdir=!destdir!\bibtex\csf\%target%
if "!docdir!"==""  set docdir=!destdir!\doc\latex\%target%
if "!srcdir!"==""  set srcdir=!destdir!\source\latex\%target%

if "!clext!"=="" set clext=*.aux *.toc *.idx *.ind *.ilg *.log *.out *.lof ^
*.lot *.lol *.bbl *.blg *.bak *.dvi *.ps *.pdf
if "!clfiles!"=="" set clfiles=!clext! %clsfiles% %bstfiles%

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=--shell-escape
if "!miflags!"==""       set miflags=-r -s dtx.ist


if "%1"=="" (
	call :all
) else (
	for %%f in (%*) do call :%%f
)

exit /b

:all
	call :package
	call :doc
goto :eof

:clean
	del !clfiles!
goto :eof

:doc
	call :pdf
goto :eof

:dvi
	!latex! !latexflags! %target%.dtx
	!mi! !miflags! %target%
	!latex! !latexflags! %target%.dtx
	!latex! !latexflags! %target%.dtx

	!latex! !latexflags! %subclass%.dtx
	!latex! !latexflags! %subclass%.dtx

	!latex! !latexflags! %bst%.dtx
	!mi! !miflags! %bst%
	!latex! !latexflags! %bst%.dtx
	!latex! !latexflags! %bst%.dtx

	!latex! !latexflags! %manual%.tex
	!latex! !latexflags! %manual%.tex
goto :eof

:help
	echo   all        ^(default^) build package and documentation
	echo   clean      remove output files
	echo   doc        alias for pdf target
	echo   dvi        build documentation in DVI format
	echo   help       show description of targets
	echo   install    install package and documentation
	echo   package    build package
	echo   pdf        build documentation in PDF format
	echo   reinstall  reinstall package and documentation
	echo   uninstall  uninstall package and documentation
goto :eof

:install
	if not exist %target%.cls call :all
	if not exist "!clsdir!" mkdir "!clsdir!"
	if not exist "!bstdir!" mkdir "!bstdir!"
	if not exist "!csfdir!" mkdir "!csfdir!"
	if not exist "!docdir!" mkdir "!docdir!"
	if not exist "!srcdir!" mkdir "!srcdir!"
	for %%f in (%clsfiles%)  do xcopy /y /i /f %%f "!clsdir!"
	for %%f in (%bstfiles%)  do xcopy /y /i /f %%f "!bstdir!"
	for %%f in (%csffiles%)  do xcopy /y /i /f %%f "!csfdir!"
	for %%f in (%docfiles%)  do xcopy /y /i /f %%f "!docdir!"
	for %%f in (%textfiles%) do xcopy /y /i /f %%f "!docdir!"
	for %%f in (%srcfiles%)  do xcopy /y /i /f %%f "!srcdir!"
goto :eof

:package
    %latex% %target%.ins
goto :eof

:pdf
	!pdflatex! !pdflatexflags! %target%.dtx
	!mi! !miflags! %target%
	!pdflatex! !pdflatexflags! %target%.dtx
	!pdflatex! !pdflatexflags! %target%.dtx

	!pdflatex! !pdflatexflags! %subclass%.dtx
	!pdflatex! !pdflatexflags! %subclass%.dtx

	!pdflatex! !pdflatexflags! %bst%.dtx
	!mi! !miflags! %bst%
	!pdflatex! !pdflatexflags! %bst%.dtx
	!pdflatex! !pdflatexflags! %bst%.dtx

	!pdflatex! !pdflatexflags! %manual%.tex
	!pdflatex! !pdflatexflags! %manual%.tex
goto :eof

:reinstall
	call :uninstall
	call :install
goto :eof

:uninstall
	rmdir /s /q "!clsdir!"
	rmdir /s /q "!bstdir!"
	rmdir /s /q "!csfdir!"
	rmdir /s /q "!docdir!"
	rmdir /s /q "!srcdir!"
goto :eof