Created
November 20, 2014 15:39
-
-
Save jmini/03197dd1b38a4439f8b2 to your computer and use it in GitHub Desktop.
my makefile for the scoutbook https://github.com/BSI-Business-Systems-Integration-AG/scoutbook/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -------------------------------------------------------------------------------- | |
# intro comments | |
# -------------------------------------------------------------------------------- | |
# export TEXINPUTS:=.:local | |
# PDFLATEX = pdflatex -file-line-error | |
PDFLATEX = "C:\Tools\MiKTeX2.9\miktex\bin\pdflatex.exe" -file-line-error | |
MAKEINDEX = "C:\Tools\MiKTeX2.9\miktex\bin\makeindex.exe" -s book_index_style.ist | |
HTLATEX = "C:\Tools\MiKTeX2.9\miktex\bin\htlatex.exe" | |
TEX = "C:\Tools\MiKTeX2.9\miktex\bin\tex.exe" | |
EBOOKCONVERT = "C:\Program Files (x86)\Calibre2\ebook-convert.exe" | |
ZIP = "C:\Program Files\7-Zip\7z.exe" a -r | |
UNZIP = "C:\Program Files\7-Zip\7z.exe" x -r | |
COPY =copy | |
HTMLOUTPARAM = "html,2,info,NoFonts" # use "html,3,next,NoFonts" to produce output on section level | |
HTMLOUTPARAMSIMPLE = "html" # use "html,3,next,NoFonts" to produce output on section level | |
BOOKCSS= "scoutbook.css" | |
HOMEPAGECSS= "scouthomepage.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 | |
# -------------------------------------------------------------------------------- | |
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\${FILE}.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 | |
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 | |
homepage: 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 | |
# -------------------------------------------------------------------------------- | |
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* | |
# -------------------------------------------------------------------------------- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment