Fix asterisk.pdf generation if branch name has an underscore in it.
[asterisk/asterisk.git] / doc / tex / Makefile
1 include ../../makeopts
2
3 pdf: asterisk.pdf
4
5 asterisk.pdf: $(wildcard *.tex)
6 ifeq ($(findstring rubber,$(RUBBER)),)
7         @echo "**********************************************"
8         @echo "** You must install the \"rubber\" tool      ***"
9         @echo "** to generate the Asterisk reference PDF. ***"
10         @echo "**********************************************"
11 else
12         @echo "**********************************************"
13         @echo "** The Asterisk reference PDF will now be  ***"
14         @echo "** generated.  When complete, it will be   ***"
15         @echo "** located at asterisk.pdf.                ***"  
16         @echo "**********************************************"
17 ifneq ($(findstring kpsewhich,$(KPATHSEA)),)
18 ifeq ($(findstring fncychap.sty,$(shell find `$(KPATHSEA) --expand-braces='$${TEXMF}'| tr -d \! | sed 's/:/ /g'` -name fncychap.sty -print)),)
19         @echo
20         @echo "WARNING:  The fncychap.sty document was not found"
21         @echo "On Ubuntu, install the texlive-latex-extra package."
22         @echo
23         @exit
24 endif
25 endif
26         @cp asterisk.tex asterisk.tex.orig
27         @sed -e 's/ASTERISKVERSION/$(shell echo $(ASTERISKVERSION) | sed -e 's/\//\\\//g' | sed -e 's/_/\\\\_/g')/' asterisk.tex > asterisk_local.tex
28         @mv asterisk_local.tex asterisk.tex
29         @$(RUBBER) --pdf asterisk.tex
30         @mv asterisk.tex.orig asterisk.tex
31 endif
32
33 html:
34         @echo "**********************************************"
35         @echo "** The Asterisk reference HTML will now be ***"
36         @echo "** generated.  When complete, it will be   ***"
37         @echo "** located in the asterisk/ directory.     ***"  
38         @echo "** Note that the latex2html tool is        ***"  
39         @echo "** required for this to work.              ***"  
40         @echo "**********************************************"
41         @cp asterisk.tex asterisk.tex.orig
42         @sed -e 's/ASTERISKVERSION/$(ASTERISKVERSION)/' asterisk.tex > asterisk_local.tex
43         @mv asterisk_local.tex asterisk.tex
44         @latex2html asterisk.tex
45         @mv asterisk.tex.orig asterisk.tex
46