Example 'how to make archive' created
[deliverable/titan.core.git] / usrguide / Makefile
CommitLineData
d44e3c4f 1##############################################################################
2# Copyright (c) 2000-2016 Ericsson Telecom AB
970ed795
EL
3# All rights reserved. This program and the accompanying materials
4# are made available under the terms of the Eclipse Public License v1.0
5# which accompanies this distribution, and is available at
6# http://www.eclipse.org/legal/epl-v10.html
d44e3c4f 7#
8# Contributors:
9#
10# >
11# Baji, Laszlo
12# Balasko, Jeno
13# Forstner, Matyas
14# Gecse, Roland
15# Gillespie, Raymond
16# Kremer, Peter
17# Lovassy, Arpad
18# Ormandi, Matyas
19# Pandi, Krisztian
20# Raduly, Csaba
21# Szabados, Kristof
22# Szabo, Janos Zoltan – initial implementation
23# Szalai, Gabor
24# Tatarka, Gabor
25# Torpis, Zsolt
26# Zalanyi, Balazs Andor
27#
28##############################################################################
970ed795
EL
29# Makefile for the TITAN User Guide
30
31TOP := ..
32include ../Makefile.cfg
33
34.SUFFIXES: .tex .labels .dvi .ps .pdf
35
af710487 36DOC2PDF_JAR := ../../titan_playground/jar/doc2pdf.jar
37WARNING_TXT := warning.txt
970ed795 38TITAN_DOCS := apiguide.doc userguide.doc installationguide.doc referenceguide.doc releasenotes.doc
970ed795
EL
39TITAN_PDFS := $(TITAN_DOCS:.doc=.pdf)
40
41ifeq ($(GEN_PDF), yes)
42
af710487 43# Install with error handling: Tries to create PDFs and copy the available documents to $(DOCDIR).
44# On success (PDF files are successfully created), the PDF files are copied to the $(DOCDIR) directory.
45# 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.
46install:
47 { make test_doc2pdf_jar && make install_pdf; } || make install_error_handling
48
49# Checks if $(DOC2PDF_JAR) is present, and exit with error if not.
50test_doc2pdf_jar:
51 @{ test -f $(DOC2PDF_JAR) && echo "$(DOC2PDF_JAR) is present .. OK"; } || { echo "ERROR: $(DOC2PDF_JAR) is missing" && false; };
52
53# Install PDFs normal case: PDFs are created and copied to the $(DOCDIR) directory.
54# 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.
55install_pdf: $(TITAN_PDFS)
970ed795
EL
56ifdef MINGW
57$(info Skipped ${CURDIR} for MinGW)
58else
59 mkdir -p $(DOCDIR)
60 cp $(TITAN_PDFS) $(DOCDIR)
61endif
62
af710487 63# Copies DOC files to $(DOCDIR) instead of the PDF files, because PDF creation failed. Also a $(WARNING_TXT) is created
64install_error_handling:
65 @echo "Error handling: DOC files are copied to $(DOCDIR) instead of PDF files"
66ifdef MINGW
67$(info Skipped ${CURDIR} for MinGW)
68else
69 mkdir -p $(DOCDIR)
70 cp $(TITAN_DOCS) $(DOCDIR)
71 @echo "Creating $(WARNING_TXT)"
72 @echo "DOC files are copied to $(DOCDIR) instead of PDF files." >$(WARNING_TXT)
73 @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)
74 cp $(WARNING_TXT) $(DOCDIR)
75endif
76
77# Converts DOC to PDF
78# $@ : target name, for example: apiguide.pdf
79# $(basename $@) : target name without extension, for example: apiguide
970ed795 80%.pdf : %.doc
af710487 81 @java -jar $(DOC2PDF_JAR) $(basename $@).doc $@ || { echo "ERROR: doc2pdf.jar failed with $(basename $@).doc" && false; }
970ed795
EL
82
83else
af710487 84# GEN_PDF == no
970ed795
EL
85install:
86endif
87
88release:
89 $(MAKE) install GEN_PDF=yes
90
91all run:
92
93clean:
94
95distclean:clean
96
97dep:
af710487 98
This page took 0.027423 seconds and 5 git commands to generate.