Commit 52faf3ac authored by Botond Baranyi's avatar Botond Baranyi
Browse files

Updated user guide Makefile with asciidoc changes



Change-Id: I84420730839ecd9e50f62e9dacbf58eca2932d55
Signed-off-by: Botond Baranyi's avatarBotond Baranyi <botond.baranyi@ericsson.com>
parent 8ecd6580
......@@ -10,6 +10,7 @@
# >
# Baji, Laszlo
# Balasko, Jeno
# Baranyi, Botond
# Forstner, Matyas
# Gecse, Roland
# Gillespie, Raymond
......@@ -33,26 +34,16 @@ include ../Makefile.cfg
.SUFFIXES: .tex .labels .dvi .ps .pdf
DOC2PDF_JAR := ../../titan_playground/jar/doc2pdf.jar
WARNING_TXT := warning.txt
TITAN_DOCS := apiguide.doc userguide.doc installationguide.doc referenceguide.doc releasenotes.doc
TITAN_PDFS := $(TITAN_DOCS:.doc=.pdf)
PDF_GEN_CALL := asciidoctor-pdf --attribute skip-front-matter
ifeq ($(GEN_PDF), yes)
TITAN_PDFS := apiguide/Apiguide.pdf userguide/UserGuide.pdf installationguide/installationguide.pdf referenceguide/ReferenceGuide.pdf releasenotes/releasenotes.pdf
# Install with error handling: Tries to create PDFs and copy the available documents to $(DOCDIR).
# On success (PDF files are successfully created), the PDF files are copied to the $(DOCDIR) directory.
# On failure (if doc2pdf.jar is not available or install_pdf exits with error, so PDFs are not created), the DOC files are copied to the $(DOCDIR) directory instead of the PDF files.
install:
{ make test_doc2pdf_jar && make install_pdf; } || make install_error_handling
ifeq ($(GEN_PDF), yes)
# Checks if $(DOC2PDF_JAR) is present, and exit with error if not.
test_doc2pdf_jar:
@{ test -f $(DOC2PDF_JAR) && echo "$(DOC2PDF_JAR) is present .. OK"; } || { echo "ERROR: $(DOC2PDF_JAR) is missing" && false; };
all run: $(TITAN_PDFS)
# Install PDFs normal case: PDFs are created and copied to the $(DOCDIR) directory.
# PDF creation may fail if doc2pdf.jar fails, which can happen for example if the server, that converts from DOC to PDF, is not available. In this case the target exits with error.
install_pdf: $(TITAN_PDFS)
# On success (PDF files are successfully created), the PDF files are copied to the $(DOCDIR) directory.
install: $(TITAN_PDFS)
ifdef MINGW
$(info Skipped ${CURDIR} for MinGW)
else
......@@ -60,37 +51,35 @@ else
cp $(TITAN_PDFS) $(DOCDIR)
endif
# Copies DOC files to $(DOCDIR) instead of the PDF files, because PDF creation failed. Also a $(WARNING_TXT) is created
install_error_handling:
@echo "Error handling: DOC files are copied to $(DOCDIR) instead of PDF files"
ifdef MINGW
$(info Skipped ${CURDIR} for MinGW)
else
mkdir -p $(DOCDIR)
cp $(TITAN_DOCS) $(DOCDIR)
@echo "Creating $(WARNING_TXT)"
@echo "DOC files are copied to $(DOCDIR) instead of PDF files." >$(WARNING_TXT)
@echo "It is because $(DOC2PDF_JAR) is missing or failed, which can happen for example if the server, that converts from DOC to PDF, is not available." >>$(WARNING_TXT)
cp $(WARNING_TXT) $(DOCDIR)
endif
clean:
rm -f $(TITAN_PDFS)
apiguide/Apiguide.pdf:
$(PDF_GEN_CALL) -o $@ apiguide/README.adoc
userguide/UserGuide.pdf:
$(PDF_GEN_CALL) userguide/UserGuide.adoc
installationguide/installationguide.pdf:
$(PDF_GEN_CALL) installationguide/installationguide.adoc
referenceguide/ReferenceGuide.pdf:
$(PDF_GEN_CALL) referenceguide/ReferenceGuide.adoc
# Converts DOC to PDF
# $@ : target name, for example: apiguide.pdf
# $(basename $@) : target name without extension, for example: apiguide
%.pdf : %.doc
@java -jar $(DOC2PDF_JAR) $(basename $@).doc $@ || { echo "ERROR: doc2pdf.jar failed with $(basename $@).doc" && false; }
releasenotes/releasenotes.pdf:
$(PDF_GEN_CALL) releasenotes/releasenotes.adoc
else
# GEN_PDF == no
all run:
install:
clean:
endif
release:
$(MAKE) install GEN_PDF=yes
all run:
clean:
distclean:clean
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment