X-Git-Url: https://pere.pagekite.me/gitweb/text-mekanikerord.git/blobdiff_plain/09b0cc579c82da1af73d7f27113c6d3c73a7ae3a..6f024dc94d27ecd51887ed1f1dbff2f3637dc4e7:/Makefile diff --git a/Makefile b/Makefile index 5421581..e8123be 100644 --- a/Makefile +++ b/Makefile @@ -1,23 +1,61 @@ -all: book.pdf +SOURCE = pdf.xsl +SOURCE_NB = $(SOURCE) book.xml glossary-nb.xml +SOURCE_SME = $(SOURCE) book-sme.xml glossary-sme.xml + +GENERATED = \ + mekaniker-ordbok-nb.pdf mekaniker-ordbok-nb.epub mekaniker-ordbok-nb.html \ + mekaniker-ordbok-sme.pdf mekaniker-ordbok-sme.epub mekaniker-ordbok-sme.html + +all: $(GENERATED) clean: $(RM) *~ distclean: clean + $(RM) glossary.xml $(GENERATED) XMLLINTOPTS = --nonet --noout --xinclude --postvalid -lint: book.xml glossary.xml +lint: book.xml glossary-nb.xml xmllint $(XMLLINTOPTS) book.xml -glossary.xml: make-glossary meksme-utf8.xml - ./make-glossary > glossary.rst +epubcheck: book.epub + epubcheck book.epub + +check: lint epubcheck + +glossary-nb.xml: make-glossary meksme-utf8.xml + LC_COLLATE=nb_NO.UTF-8 ./make-glossary --output $@ nb + +glossary-sme.xml: make-glossary meksme-utf8.xml + LC_COLLATE=nb_NO.UTF-8 ./make-glossary --output $@ sme DBLATEX_OPTS = \ - -T simple \ -b xetex \ --indexstyle=myindexstyle.ist \ -V \ -P latex.index.tool=xindy \ -p pdf.xsl -book.pdf: book.xml glossary.xml - dblatex $(DBLATEX_OPTS) book.xml + +mekaniker-ordbok-nb.pdf: $(SOURCE_NB) + dblatex $(DBLATEX_OPTS) -o $@ book.xml + +mekaniker-ordbok-nb.epub: $(SOURCE_NB) + dbtoepub -s epub.xsl book.xml -o $@ + +mekaniker-ordbok-nb.html: $(SOURCE_NB) + xmlto -m pdf.xsl html-nochunks book.xml + mv book.html $@ + +book-sme.xml: book.xml +# dblatex do not understand lang="sme", use "nn" with workarounds in pdf.xsl + sed -e 's/-nb/-sme/' -e 's/"nb"/"nn"/' < $^ >$@ + +mekaniker-ordbok-sme.pdf: $(SOURCE_SME) + dblatex $(DBLATEX_OPTS) -o $@ book-sme.xml + +mekaniker-ordbok-sme.epub: $(SOURCE_SME) + dbtoepub -s epub.xsl book-sme.xml -o $@ + +mekaniker-ordbok-sme.html: $(SOURCE_SME) + xmlto -m pdf.xsl html-nochunks book-sme.xml + mv book-sme.html $@