1 #Author: Jaime Irving Davila
3 #Modified on 15/04/2002
4 #Given to the public domain
6 #Variables useful for the customization of the makefile
8 #Name of the document (without the sgml extension)
12 #Name of the file used for the index (without the sgml extension)
15 #Name of the compiler of the sgml, could be jade, openjade, ..
18 #Location of the stylesheet for the html output
20 DBSTYLESHEET = /usr/share/sgml/docbook/stylesheet/dsssl/ldp/ldp.dsl
22 #Options for generating multiple HTML output
23 MULTIPLEHTMLOPT = -t sgml -ihtml -d${DBSTYLESHEET}\#html
25 #Name of the directory for the source sgml
28 #Name of the directory for the "others" files
29 OTHERSDIR = ${SGMLDIR}/others
31 #Name of the directory for the png files
34 RESULTDIR = result/${SGMLDIR}
36 #Name of the directory for the output of the multiple html
37 MULTIPLEHTMLDIR = ${RESULTDIR}/out-htmls
39 #Name of the directory for the output the ps file
40 PSDIR = ${RESULTDIR}/out-ps
42 #Name of the script which generates the ps file, in RedHat it's db2ps
45 #Name of the directory for the temp and tmp-output the pdf file
46 PDFDIR = ${RESULTDIR}/tmp-pdf
47 #Name of the script which generates the ps file, in RedHat it's db2ps
50 #Variables needed by the rules, should NOT be changed
51 #Variable for including the sgml source file
54 #Variable for knowing if there exists the sgml index file, in case it
55 #NOT exists its value is empty, otherwise it's the name of the index
56 ISINDEX = ${findstring ${INDEX}, ${wildcard ${SGMLDIR}/*.sgml}}
58 #Variable for knowing if the tag init will be needed
59 ifneq (${ISINDEX}, ${INDEX})
63 #Variable for storing the name of all the sgml source files directory
64 SRCFILES = $(patsubst ${SGMLDIR}/${INDEX}.sgml,,$(wildcard ${SGMLDIR}/*))
66 #Variable for storing the name of all the files in the "others" directory
67 OTHERFILES = $(wildcard ${OTHERSDIR}/*)
69 #Variable for storing the names of the "others" files placed in the
71 #Variable for storing the names of the "others" files placed in the
72 #multiple-html directory
73 OTHERMULTIPLE = $(patsubst ${SGMLDIR}/others/%, ${MULTIPLEHTMLDIR}/%, ${OTHERFILES} )
75 #Variable for storing the names of the png's pictures
76 PNGFILES = $(wildcard ${PNGDIR}/*.png)
78 #Variable for storing the names of the png's files placed on the
80 #Variable for storing the names of the png's files placed on the
81 #single-html directory
82 PNGMULTIPLE = $(patsubst ${PNGDIR}/%, ${MULTIPLEHTMLDIR}/%, ${PNGFILES})
84 #Variable for storing the names of the eps files
85 FIGEPS = $(patsubst ${PNGDIR}/%.png, ${PSDIR}/%.eps, ${PNGFILES})
87 PATH_LANG = ${CURDIR}/${SGMLDIR}
89 all: multiple-html ps pdf
91 .PHONY: all clean init cpfilessingle multiple-html cpfilesmultiple distsource ps
93 #Rules needed for generating multiple html files
95 multiple-html: ${MULTIPLEHTMLDIR}/${DOC}.html cpfilesmultiple
97 ${MULTIPLEHTMLDIR}/${DOC}.html: ${MULTIPLEHTMLDIR} ${INDEX}.sgml.m ${SGMLDIR}/${DOC}.tmp.sgml
98 #cp -f ${SGMLDIR}/${INDEX}.sgml.m ${SGMLDIR}/${INDEX}.sgml
99 ${COMPILER} ${MULTIPLEHTMLOPT} ${SGMLDIR}/${DOC}.tmp.sgml
100 mv *.html ${MULTIPLEHTMLDIR}
102 ${SGMLDIR}/${DOC}.tmp.sgml: ${SGMLDIR}/${DOC}.sgml
103 sed "s:##PATHLANG##:${PATH_LANG}:" ${SGMLDIR}/${DOC}.sgml > ${SGMLDIR}/${DOC}.tmp.sgml
105 HTML.index.m: ${DOC}.sgml ${SRCFILES} ${USEINIT} ${SGMLDIR}/${DOC}.tmp.sgml
106 ${COMPILER} ${MULTIPLEHTMLOPT} -V html-index ${SGMLDIR}/${DOC}.tmp.sgml > /dev/null
107 mv HTML.index ${SGMLDIR}/HTML.index.m
110 ${INDEX}.sgml.m: HTML.index.m
111 perl -S collateindex.pl -o ${SGMLDIR}/${INDEX}.sgml.m ${SGMLDIR}/HTML.index.m
114 mkdir -p ${MULTIPLEHTMLDIR}
116 cpfilesmultiple: ${PNGMULTIPLE} ${OTHERMULTIPLE}
118 ${MULTIPLEHTMLDIR}/%.png: ${PNGDIR}/%.png
121 ${MULTIPLEHTMLDIR}/%: ${OTHERSDIR}/%
124 #Rules needed for generating the ps file
126 ps: ${PSDIR}/${DOC}.ps
128 ${PSDIR}/${DOC}.ps: ${PSDIR} ${FIGEPS} ${INDEX}.sgml.m
129 cp -rf ${SGMLDIR}/*.sgml ${PSDIR}
130 cd ${PSDIR}; ${SCRIPTPS} ${DOC}.tmp.sgml ; mv ${DOC}.tmp.ps ${DOC}.ps
133 ${PSDIR}/%.eps: ${PNGDIR}/%.png ${PSDIR}
139 #Rules needed for generating the pdf file
141 pdf: ${PDFDIR}/${DOC}.pdf
143 ${PDFDIR}/${DOC}.pdf: ${PDFDIR} ${INDEX}.sgml.m
144 cp -rf ${PNGDIR}/* ${PDFDIR}
145 cp -rf ${SGMLDIR}/*.sgml ${PDFDIR}
146 cp -rf ${SGMLDIR}/* ${PDFDIR}
147 mv ${PDFDIR}/${DOC}.tmp.sgml ${PDFDIR}/${DOC}.sgml
148 cd ${PDFDIR};${SCRIPTPDF} ${DOC}.sgml
154 #Some additional and standard tags
156 perl -S collateindex.pl -N -o ${SGMLDIR}/${INDEX}.sgml
159 tar cvfz ${DOC}.tar.gz *
162 rm -rf ${MULTIPLEHTMLDIR} ${SGMLDIR}/*.index.* ${SGMLDIR}/${INDEX}.sgml* nil ${PSDIR} ${PDFDIR}