-
Notifications
You must be signed in to change notification settings - Fork 12
/
makefile.windows
113 lines (91 loc) · 4.25 KB
/
makefile.windows
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
# --------------------------------------------------------------------------------
# makefile for windows platform
#
# this makefile is only intended to serve as a starting point on windows platforms
# you may copy the file to 'makefile' and adapt it according to your needs
# --------------------------------------------------------------------------------
# export TEXINPUTS:=.:local
# Root Paths
BIN=c:\latex
LATEXROOT=${BIN}\MiKTeX 2.9\miktex\bin\x64
# PDFLATEX = pdflatex -file-line-error
PDFLATEX = "${LATEXROOT}\pdflatex.exe" -file-line-error
MAKEINDEX = "${LATEXROOT}\makeindex.exe" -s book_index_style.ist
HTLATEX = "${LATEXROOT}\htlatex.exe"
TEX = "${LATEXROOT}\tex.exe"
EBOOKCONVERT = "${BIN}\Calibre2\ebook-convert.exe"
ZIP = "C:\Program Files\7-Zip\7z.exe" a -r
UNZIP = "C:\Program Files\7-Zip\7z.exe" x -r -y
COPY =copy
HTMLOUTPARAM = "html,2,info" # use "html,3,next" to produce output on section level
HTMLOUTPARAMSIMPLE = "html" # for homepage files
HTMLOUTPARAMHELP = "html,4,next,NoFonts"
BOOKCSS= "scoutbook.css"
HOMEPAGECSS= "scouthomepage.css"
HELPBOOKCSS= "scouthelp.css"
# TO-DO: get referenced scout project right
# TO-DO: properly copy images for html (and epub?)
# TO-DO: do some meaningful splitting of html into individual files
BOOK=scout_intro
FILE=scout_install
HELPBOOK=scout_help
# --------------------------------------------------------------------------------
all: pdf html epub
# NB?: be sure to use texlive and to set the TEXINPUTS variable accordingly
# See README.txt
pdf: cleanworking
-cd tex & ${PDFLATEX} ${BOOK}.tex
-cd tex & ${PDFLATEX} ${BOOK}.tex
cd tex & ${MAKEINDEX} ${BOOK}
-cd tex & ${PDFLATEX} ${BOOK}.tex
copy tex\${BOOK}.pdf out\pdf\${BOOK}.pdf
html: cleanworking
-cd tex & ${HTLATEX} ${BOOK}.tex ${HTMLOUTPARAM}
-cd tex & ${TEX} "\def\filename{{${BOOK}}{idx}{4dx}{ind}} \input idxmake.4ht"
-cd tex & ${MAKEINDEX} -o ${BOOK}.ind ${BOOK}.4dx
-cd tex & ${HTLATEX} ${BOOK}.tex ${HTMLOUTPARAM}
copy tex\${BOOKCSS} tex\${BOOK}.css
cd tex & ${ZIP} ${BOOK}.zip *.html ${BOOK}.css *.png css\*
copy tex\${BOOK}.zip out\html\${BOOK}.zip
cd out\html & ${UNZIP} ${BOOK}.zip
epub: cleanworking
-cd tex & ${HTLATEX} ${BOOK}.tex html
-cd tex & ${TEX} "\def\filename{{${BOOK}}{idx}{4dx}{ind}} \input idxmake.4ht"
-cd tex & ${MAKEINDEX} -o ${BOOK}.ind ${BOOK}.4dx
-cd tex & ${HTLATEX} ${BOOK}.tex html
-cd tex & ${EBOOKCONVERT} ${BOOK}.html ${BOOK}.epub
copy tex\${BOOK}.epub out\epub\${BOOK}.epub
# --------------------------------------------------------------------------------
file-pdf: cleanworking
-cd tex & ${PDFLATEX} ${FILE}.tex
-cd tex & ${PDFLATEX} ${FILE}.tex
-cd tex & ${PDFLATEX} ${FILE}.tex
copy tex\${FILE}.pdf out\pdf\${FILE}.pdf
file-html: cleanworking
-cd tex & ${HTLATEX} ${FILE}.tex ${HTMLOUTPARAMSIMPLE}
copy tex\${HOMEPAGECSS} tex\${FILE}.css
cd tex & ${ZIP} ${FILE}.zip *.html ${FILE}.css modules\figures\*.png fonts\*
copy tex\${FILE}.zip out\html\${FILE}.zip
cd out\html & ${UNZIP} ${FILE}.zip
# --------------------------------------------------------------------------------
help-html: cleanworking
-cd tex & ${HTLATEX} ${HELPBOOK}.tex ${HTMLOUTPARAMHELP}
-cd tex & ${TEX} "\def\filename{{${HELPBOOK}}{idx}{4dx}{ind}} \input idxmake.4ht"
-cd tex & ${MAKEINDEX} -o ${HELPBOOK}.ind ${HELPBOOK}.4dx
-cd tex & ${HTLATEX} ${HELPBOOK}.tex ${HTMLOUTPARAMHELP}
copy tex\${HELPBOOKCSS} tex\${HELPBOOK}.css
cd tex & ${ZIP} ${HELPBOOK}.zip *.html ${HELPBOOK}.css *.png
copy tex\${HELPBOOK}.zip out\html\${HELPBOOK}.zip
cd out\html & ${UNZIP} ${HELPBOOK}.zip
# --------------------------------------------------------------------------------
clean: cleanworking
if exist out\ (rmdir /s /q out)
mkdir out\pdf
mkdir out\html
mkdir out\epub
cleanworking:
cd tex & del /S *.dvi *.aux *.log *.out *.glo *.toc *.ilg *.blg *.idx *.idv *.ind
cd tex & del ${BOOK}.pdf ${BOOK}*.html ${BOOK}*.zip ${BOOK}.css ${BOOK}.epub ${BOOK}.xref ${BOOK}.tmp ${BOOK}.4* ${BOOK}.l*
cd tex & del ${FILE}.pdf ${FILE}*.html ${FILE}*.zip ${FILE}.css ${FILE}.epub ${FILE}.xref ${FILE}.tmp ${FILE}.4* ${FILE}.l*
cd tex & del ${HELPBOOK}.pdf ${HELPBOOK}*.html ${HELPBOOK}*.zip ${HELPBOOK}.css ${HELPBOOK}.epub ${HELPBOOK}.xref ${HELPBOOK}.tmp ${HELPBOOK}.4* ${HELPBOOK}.l*
# --------------------------------------------------------------------------------