Makefile 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. #Author: Jaime Irving Davila
  2. #Date: 23/09/2001
  3. #Modified on 15/04/2002
  4. #Given to the public domain
  5. #Variables useful for the customization of the makefile
  6. #Name of the document (without the sgml extension)
  7. DOC = synfig-studio
  8. #Name of the file used for the index (without the sgml extension)
  9. INDEX = index
  10. #Name of the compiler of the sgml, could be jade, openjade, ..
  11. COMPILER = openjade
  12. #Location of the stylesheet for the html output
  13. DBSTYLESHEET = /usr/share/sgml/docbook/stylesheet/dsssl/ldp/ldp.dsl
  14. #Options for generating multiple HTML output
  15. MULTIPLEHTMLOPT = -t sgml -ihtml -d${DBSTYLESHEET}\#html
  16. #Name of the directory for the source sgml
  17. SGMLDIR = en
  18. #Name of the directory for the "others" files
  19. OTHERSDIR = ${SGMLDIR}/others
  20. #Name of the directory for the png files
  21. PNGDIR = png
  22. RESULTDIR = result/${SGMLDIR}
  23. #Name of the directory for the output of the multiple html
  24. MULTIPLEHTMLDIR = ${RESULTDIR}/out-htmls
  25. #Name of the directory for the output the ps file
  26. PSDIR = ${RESULTDIR}/out-ps
  27. #Name of the script which generates the ps file, in RedHat it's db2ps
  28. SCRIPTPS = db2ps
  29. #Name of the directory for the temp and tmp-output the pdf file
  30. PDFDIR = ${RESULTDIR}/tmp-pdf
  31. #Name of the script which generates the ps file, in RedHat it's db2ps
  32. SCRIPTPDF = db2pdf
  33. #Variables needed by the rules, should NOT be changed
  34. #Variable for including the sgml source file
  35. VPATH = ${SGMLDIR}
  36. #Variable for knowing if there exists the sgml index file, in case it
  37. #NOT exists its value is empty, otherwise it's the name of the index
  38. ISINDEX = ${findstring ${INDEX}, ${wildcard ${SGMLDIR}/*.sgml}}
  39. #Variable for knowing if the tag init will be needed
  40. ifneq (${ISINDEX}, ${INDEX})
  41. USEINIT = init
  42. endif
  43. #Variable for storing the name of all the sgml source files directory
  44. SRCFILES = $(patsubst ${SGMLDIR}/${INDEX}.sgml,,$(wildcard ${SGMLDIR}/*))
  45. #Variable for storing the name of all the files in the "others" directory
  46. OTHERFILES = $(wildcard ${OTHERSDIR}/*)
  47. #Variable for storing the names of the "others" files placed in the
  48. #Variable for storing the names of the "others" files placed in the
  49. #multiple-html directory
  50. OTHERMULTIPLE = $(patsubst ${SGMLDIR}/others/%, ${MULTIPLEHTMLDIR}/%, ${OTHERFILES} )
  51. #Variable for storing the names of the png's pictures
  52. PNGFILES = $(wildcard ${PNGDIR}/*.png)
  53. #Variable for storing the names of the png's files placed on the
  54. #Variable for storing the names of the png's files placed on the
  55. #single-html directory
  56. PNGMULTIPLE = $(patsubst ${PNGDIR}/%, ${MULTIPLEHTMLDIR}/%, ${PNGFILES})
  57. #Variable for storing the names of the eps files
  58. FIGEPS = $(patsubst ${PNGDIR}/%.png, ${PSDIR}/%.eps, ${PNGFILES})
  59. PATH_LANG = ${CURDIR}/${SGMLDIR}
  60. all: multiple-html ps pdf
  61. .PHONY: all clean init cpfilessingle multiple-html cpfilesmultiple distsource ps
  62. #Rules needed for generating multiple html files
  63. multiple-html: ${MULTIPLEHTMLDIR}/${DOC}.html cpfilesmultiple
  64. ${MULTIPLEHTMLDIR}/${DOC}.html: ${MULTIPLEHTMLDIR} ${INDEX}.sgml.m ${SGMLDIR}/${DOC}.tmp.sgml
  65. #cp -f ${SGMLDIR}/${INDEX}.sgml.m ${SGMLDIR}/${INDEX}.sgml
  66. ${COMPILER} ${MULTIPLEHTMLOPT} ${SGMLDIR}/${DOC}.tmp.sgml
  67. mv *.html ${MULTIPLEHTMLDIR}
  68. ${SGMLDIR}/${DOC}.tmp.sgml: ${SGMLDIR}/${DOC}.sgml
  69. sed "s:##PATHLANG##:${PATH_LANG}:" ${SGMLDIR}/${DOC}.sgml > ${SGMLDIR}/${DOC}.tmp.sgml
  70. HTML.index.m: ${DOC}.sgml ${SRCFILES} ${USEINIT} ${SGMLDIR}/${DOC}.tmp.sgml
  71. ${COMPILER} ${MULTIPLEHTMLOPT} -V html-index ${SGMLDIR}/${DOC}.tmp.sgml > /dev/null
  72. mv HTML.index ${SGMLDIR}/HTML.index.m
  73. rm *.html
  74. ${INDEX}.sgml.m: HTML.index.m
  75. perl -S collateindex.pl -o ${SGMLDIR}/${INDEX}.sgml.m ${SGMLDIR}/HTML.index.m
  76. ${MULTIPLEHTMLDIR}:
  77. mkdir -p ${MULTIPLEHTMLDIR}
  78. cpfilesmultiple: ${PNGMULTIPLE} ${OTHERMULTIPLE}
  79. ${MULTIPLEHTMLDIR}/%.png: ${PNGDIR}/%.png
  80. cp -rf $< $@
  81. ${MULTIPLEHTMLDIR}/%: ${OTHERSDIR}/%
  82. cp -rf $< $@
  83. #Rules needed for generating the ps file
  84. ps: ${PSDIR}/${DOC}.ps
  85. ${PSDIR}/${DOC}.ps: ${PSDIR} ${FIGEPS} ${INDEX}.sgml.m
  86. cp -rf ${SGMLDIR}/*.sgml ${PSDIR}
  87. cd ${PSDIR}; ${SCRIPTPS} ${DOC}.tmp.sgml ; mv ${DOC}.tmp.ps ${DOC}.ps
  88. cd ..
  89. ${PSDIR}/%.eps: ${PNGDIR}/%.png ${PSDIR}
  90. convert $< $@
  91. ${PSDIR}:
  92. mkdir -p ${PSDIR}
  93. #Rules needed for generating the pdf file
  94. pdf: ${PDFDIR}/${DOC}.pdf
  95. ${PDFDIR}/${DOC}.pdf: ${PDFDIR} ${INDEX}.sgml.m
  96. cp -rf ${PNGDIR}/* ${PDFDIR}
  97. cp -rf ${SGMLDIR}/*.sgml ${PDFDIR}
  98. cp -rf ${SGMLDIR}/* ${PDFDIR}
  99. mv ${PDFDIR}/${DOC}.tmp.sgml ${PDFDIR}/${DOC}.sgml
  100. cd ${PDFDIR};${SCRIPTPDF} ${DOC}.sgml
  101. cd ..
  102. ${PDFDIR}:
  103. mkdir -p ${PDFDIR}
  104. #Some additional and standard tags
  105. init:
  106. perl -S collateindex.pl -N -o ${SGMLDIR}/${INDEX}.sgml
  107. distsource: clean
  108. tar cvfz ${DOC}.tar.gz *
  109. clean:
  110. rm -rf ${MULTIPLEHTMLDIR} ${SGMLDIR}/*.index.* ${SGMLDIR}/${INDEX}.sgml* nil ${PSDIR} ${PDFDIR}