Skip to content
Snippets Groups Projects
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: default avatarBotond Baranyi <botond.baranyi@ericsson.com>
parent 8ecd6580
No related branches found
No related tags found
No related merge requests found
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
# > # >
# Baji, Laszlo # Baji, Laszlo
# Balasko, Jeno # Balasko, Jeno
# Baranyi, Botond
# Forstner, Matyas # Forstner, Matyas
# Gecse, Roland # Gecse, Roland
# Gillespie, Raymond # Gillespie, Raymond
...@@ -33,26 +34,16 @@ include ../Makefile.cfg ...@@ -33,26 +34,16 @@ include ../Makefile.cfg
.SUFFIXES: .tex .labels .dvi .ps .pdf .SUFFIXES: .tex .labels .dvi .ps .pdf
DOC2PDF_JAR := ../../titan_playground/jar/doc2pdf.jar PDF_GEN_CALL := asciidoctor-pdf --attribute skip-front-matter
WARNING_TXT := warning.txt
TITAN_DOCS := apiguide.doc userguide.doc installationguide.doc referenceguide.doc releasenotes.doc
TITAN_PDFS := $(TITAN_DOCS:.doc=.pdf)
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). ifeq ($(GEN_PDF), yes)
# 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
# Checks if $(DOC2PDF_JAR) is present, and exit with error if not. all run: $(TITAN_PDFS)
test_doc2pdf_jar:
@{ test -f $(DOC2PDF_JAR) && echo "$(DOC2PDF_JAR) is present .. OK"; } || { echo "ERROR: $(DOC2PDF_JAR) is missing" && false; };
# Install PDFs normal case: PDFs are created and copied to the $(DOCDIR) directory. # On success (PDF files are successfully created), the PDF files are 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: $(TITAN_PDFS)
install_pdf: $(TITAN_PDFS)
ifdef MINGW ifdef MINGW
$(info Skipped ${CURDIR} for MinGW) $(info Skipped ${CURDIR} for MinGW)
else else
...@@ -60,37 +51,35 @@ else ...@@ -60,37 +51,35 @@ else
cp $(TITAN_PDFS) $(DOCDIR) cp $(TITAN_PDFS) $(DOCDIR)
endif endif
# Copies DOC files to $(DOCDIR) instead of the PDF files, because PDF creation failed. Also a $(WARNING_TXT) is created clean:
install_error_handling: rm -f $(TITAN_PDFS)
@echo "Error handling: DOC files are copied to $(DOCDIR) instead of PDF files"
ifdef MINGW apiguide/Apiguide.pdf:
$(info Skipped ${CURDIR} for MinGW) $(PDF_GEN_CALL) -o $@ apiguide/README.adoc
else
mkdir -p $(DOCDIR) userguide/UserGuide.pdf:
cp $(TITAN_DOCS) $(DOCDIR) $(PDF_GEN_CALL) userguide/UserGuide.adoc
@echo "Creating $(WARNING_TXT)"
@echo "DOC files are copied to $(DOCDIR) instead of PDF files." >$(WARNING_TXT) installationguide/installationguide.pdf:
@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) $(PDF_GEN_CALL) installationguide/installationguide.adoc
cp $(WARNING_TXT) $(DOCDIR)
endif referenceguide/ReferenceGuide.pdf:
$(PDF_GEN_CALL) referenceguide/ReferenceGuide.adoc
# Converts DOC to PDF releasenotes/releasenotes.pdf:
# $@ : target name, for example: apiguide.pdf $(PDF_GEN_CALL) releasenotes/releasenotes.adoc
# $(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; }
else else
# GEN_PDF == no # GEN_PDF == no
all run:
install: install:
clean:
endif endif
release: release:
$(MAKE) install GEN_PDF=yes $(MAKE) install GEN_PDF=yes
all run:
clean:
distclean:clean distclean:clean
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment