LIB_IMAGES -> IMAGES_LIB, to be consistent with IMAGES_PNG and IMAGES_EPS

Extend the image support.  Now handles the "install" part for HTML, PS, and
PDF, as well as packaging.

Better support for images in the PDF output.  I'm still trying to figure out
how to get good quality PDF from EPS source though.
This commit is contained in:
Nik Clayton 2000-10-29 02:39:10 +00:00
parent 1791773737
commit 324f84d204
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=8230
3 changed files with 74 additions and 34 deletions

View file

@ -1,5 +1,5 @@
#
# $FreeBSD: doc/share/mk/doc.docbook.mk,v 1.21 2000/10/08 19:19:09 nik Exp $
# $FreeBSD: doc/share/mk/doc.docbook.mk,v 1.22 2000/10/10 06:16:56 kuriyama Exp $
#
# This include file <doc.docbook.mk> handles building and installing of
# DocBook documentation in the FreeBSD Documentation Project.
@ -65,7 +65,7 @@ LANGUAGECATALOG=${DOC_PREFIX}/${LANGCODE}/share/sgml/catalog
DOCBOOKCATALOG= ${PREFIX}/share/sgml/docbook/catalog
DSSSLCATALOG= ${PREFIX}/share/sgml/docbook/dsssl/modular/catalog
LIB_IMAGES?=
IMAGES_LIB?=
JADEOPTS= ${JADEFLAGS} -c ${LANGUAGECATALOG} -c ${FREEBSDCATALOG} -c ${DSSSLCATALOG} -c ${DOCBOOKCATALOG} -c ${JADECATALOG} ${EXTRA_CATALOGS:S/^/-c /g}
@ -172,21 +172,21 @@ CLEANFILES+= ${DOC}.${_curformat}.${_curcomp}
.endfor
.endif
.for _curimage in ${LIB_IMAGES}
LOCAL_LIB_IMAGES += ${LOCAL_LIB_IMAGES_DIR}/${_curimage}
.for _curimage in ${IMAGES_LIB}
LOCAL_IMAGES_LIB += ${LOCAL_IMAGES_LIB_DIR}/${_curimage}
.endfor
.MAIN: all
all: ${_docs}
index.html HTML.manifest: ${SRCS} ${LOCAL_LIB_IMAGES} ${IMAGES_PNG}
index.html HTML.manifest: ${SRCS} ${LOCAL_IMAGES_LIB} ${IMAGES_PNG}
${JADE} -V html-manifest -ioutput.html -ioutput.html.images ${JADEOPTS} -d ${DSLHTML} -t sgml ${MASTERDOC}
.if !defined(NO_TIDY)
-tidy -i -m -f /dev/null ${TIDYFLAGS} `xargs < HTML.manifest`
.endif
${DOC}.html: ${SRCS} ${LOCAL_LIB_IMAGES} ${IMAGES_PNG}
${DOC}.html: ${SRCS} ${LOCAL_IMAGES_LIB} ${IMAGES_PNG}
${JADE} -ioutput.html -ioutput.html.images -V nochunks ${JADEOPTS} -d ${DSLHTML} -t sgml ${MASTERDOC} > ${.TARGET}
.if !defined(NO_TIDY)
-tidy -i -m -f /dev/null ${TIDYFLAGS} ${.TARGET}
@ -198,12 +198,12 @@ ${DOC}.html-text: ${SRCS}
${DOC}.html-split.tar: HTML.manifest
tar cf ${.TARGET} `xargs < HTML.manifest`
tar uf ${.TARGET} ${LIB_IMAGES}
tar uf ${.TARGET} ${IMAGES_LIB}
tar uf ${.TARGET} ${IMAGES_PNG}
${DOC}.html.tar: ${DOC}.html
tar cf ${.TARGET} ${DOC}.html
tar uf ${.TARGET} ${LIB_IMAGES}
tar uf ${.TARGET} ${IMAGES_LIB}
tar uf ${.TARGET} ${IMAGES_PNG}
${DOC}.txt: ${DOC}.html-text
@ -227,8 +227,9 @@ ${DOC}.rtf: ${SRCS}
${DOC}.tex-ps: ${SRCS} ${IMAGES_EPS}
${JADE} -Vtex-backend -ioutput.print ${JADEOPTS} -d ${DSLPRINT} -t tex -o ${.TARGET} ${MASTERDOC}
${DOC}.tex-pdf: ${SRCS} ${IMAGES_PNG}
${JADE} -Vtex-backend -ioutput.print -ioutput.print.pdf ${JADEOPTS} -d ${DSLPRINT} -t tex -o ${.TARGET} ${MASTERDOC}
${DOC}.tex-pdf: ${SRCS} ${IMAGES_PDF}
cp ${DOC_PREFIX}/share/web2c/pdftex.def ${.TARGET}
${JADE} -Vtex-backend -ioutput.print -ioutput.print.pdf ${JADEOPTS} -d ${DSLPRINT} -t tex -o /dev/stdout ${MASTERDOC} >> ${.TARGET}
${DOC}.dvi: ${DOC}.tex-ps
@echo "==> TeX pass 1/3"
@ -351,9 +352,12 @@ install-${_cf}: index.html
@if [ -f ${.OBJDIR}/${DOC}.ln ]; then \
(cd ${DESTDIR}; sh ${.OBJDIR}/${DOC}.ln); \
fi
.for _curimage in ${LIB_IMAGES}
@[ -d ${DESTDIR}/${LOCAL_LIB_IMAGES_DIR}/${_curimage:H} ] || mkdir -p ${DESTDIR}/${LOCAL_LIB_IMAGES_DIR}/${_curimage:H}
${INSTALL_DOCS} ${LOCAL_LIB_IMAGES_DIR}/${_curimage} ${DESTDIR}/${LOCAL_LIB_IMAGES_DIR}/${_curimage:H}
.for _curimage in ${IMAGES_LIB}
@[ -d ${DESTDIR}/${LOCAL_IMAGES_LIB_DIR}/${_curimage:H} ] || mkdir -p ${DESTDIR}/${LOCAL_IMAGES_LIB_DIR}/${_curimage:H}
${INSTALL_DOCS} ${LOCAL_IMAGES_LIB_DIR}/${_curimage} ${DESTDIR}/${LOCAL_IMAGES_LIB_DIR}/${_curimage:H}
.endfor
.for _curimage in ${IMAGES_PNG}
${INSTALL_DOCS} ${_curimage} ${DESTDIR}
.endfor
.for _compressext in ${KNOWN_COMPRESS}
install-${_cf}.tar.${_compressext}: ${DOC}.${_cf}.tar.${_compressext}
@ -364,9 +368,12 @@ install-${_cf}.tar.${_compressext}: ${DOC}.${_cf}.tar.${_compressext}
install-${_cf}: ${DOC}.${_cf}
@[ -d ${DESTDIR} ] || mkdir -p ${DESTDIR}
${INSTALL_DOCS} ${.ALLSRC} ${DESTDIR}
.for _curimage in ${LIB_IMAGES}
@[ -d ${DESTDIR}/${LOCAL_LIB_IMAGES_DIR}/${_curimage:H} ] || mkdir -p ${DESTDIR}/${LOCAL_LIB_IMAGES_DIR}/${_curimage:H}
${INSTALL_DOCS} ${LOCAL_LIB_IMAGES_DIR}/${_curimage} ${DESTDIR}/${LOCAL_LIB_IMAGES_DIR}/${_curimage:H}
.for _curimage in ${IMAGES_LIB}
@[ -d ${DESTDIR}/${LOCAL_IMAGES_LIB_DIR}/${_curimage:H} ] || mkdir -p ${DESTDIR}/${LOCAL_IMAGES_LIB_DIR}/${_curimage:H}
${INSTALL_DOCS} ${LOCAL_IMAGES_LIB_DIR}/${_curimage} ${DESTDIR}/${LOCAL_IMAGES_LIB_DIR}/${_curimage:H}
.endfor
.for _curimage in ${IMAGES_PNG}
${INSTALL_DOCS} ${_curimage} ${DESTDIR}
.endfor
.else
install-${_cf}: ${DOC}.${_cf}
@ -410,9 +417,17 @@ _cf=${_curformat}
package-${_curformat}: install-${_curformat}
.if ${_cf} == "html-split"
@cp HTML.manifest PLIST
@for images_png in ${IMAGES_PNG}; do \
echo $$images_png >> PLIST; \
done
.elif ${_cf} == "html"
@echo ${DOC}.${_curformat} > PLIST
@for images_png in ${IMAGES_PNG}; do \
echo $$images_png >> PLIST; \
done
.else
@echo ${DOC}.${_curformat} > PLIST
@for lib_images in ${LIB_IMAGES}; do \
@for lib_images in ${IMAGES_LIB5}; do \
echo $$lib_images >> PLIST; \
done
.endif

View file

@ -1,5 +1,5 @@
#
# $FreeBSD: doc/share/mk/doc.images.mk,v 1.3 2000/09/28 23:29:47 nbm Exp $
# $FreeBSD: doc/share/mk/doc.images.mk,v 1.4 2000/10/08 19:17:42 nik Exp $
#
# This include file <doc.images.mk> handles image processing.
#
@ -41,15 +41,26 @@
# of all the .eps images listed, but with a .png extension. This is the
# list of files we need to generate if we need PNG format images.
#
# The PDF generation, when it's looking for file 'foo', will first try
# foo.pdf, and it will try foo.png. There's no point converting PNG files
# to PDF, as they'll be used directly. However, we can convert the EPS files
# to PDF, and hopefully get better quality.
#
IMAGES_GEN_PNG=${IMAGES:M*.eps:S/.eps$/.png/}
IMAGES_GEN_EPS=${IMAGES:M*.png:S/.png$/.eps/}
IMAGES_GEN_PDF=${IMAGES:M*.eps:S/.eps$/.pdf/}
CLEANFILES+= ${IMAGES_GEN_PNG} ${IMAGES_GEN_EPS}
CLEANFILES+= ${IMAGES_GEN_PNG} ${IMAGES_GEN_EPS} ${IMAGES_GEN_PDF}
IMAGES_PNG=${IMAGES:M*.png} ${IMAGES_GEN_PNG}
IMAGES_EPS=${IMAGES:M*.eps} ${IMAGES_GEN_EPS}
# We only need to list ${IMAGES_GEN_PDF} here. If all the source files are
# EPS then they'll be in this variable; if any of the source files are PNG
# then we can use them directly, and don't need to list them.
IMAGES_PDF=${IMAGES_GEN_PDF}
# We can't use suffix rules to generate the rules to convert EPS to PNG and
# PNG to EPS. This is because a .png file can depend on a .eps file, and
# vice versa, leading to a loop in the dependency graph. Instead, build
@ -57,25 +68,39 @@ IMAGES_EPS=${IMAGES:M*.eps} ${IMAGES_GEN_EPS}
.for _curimage in ${IMAGES_GEN_PNG}
${_curimage}: ${_curimage:S/.png$/.eps/}
convert -antialias ${_curimage:S/.png$/.eps/} ${_curimage}
convert -antialias -density 108x108 ${_curimage:S/.png$/.eps/} ${_curimage}
.endfor
.for _curimage in ${IMAGES_GEN_EPS}
${_curimage}: ${_curimage:S/.eps$/.png/}
convert -antialias ${_curimage:S/.eps$/.png/} ${_curimage}
convert -antialias -density 108x108 ${_curimage:S/.eps$/.png/} ${_curimage}
.endfor
.SUFFIXES: .pdf .eps .png
#
# Trial and error here with the options to ImageMagick.
#
# -density seems to smooth out the images. Something to do with the source
# images being different from the 72dpi that ImageMagick wants.
#
# -crop 0x0 forces the images to be trimmed to the minimum size. Otherwise
# each image takes up a full page, which is bad.
#
# epdf: forces the output format to be encapsulated PDF
#
.for _curimage in ${IMAGES_GEN_PDF}
${_curimage}: ${_curimage:S/.pdf$/.eps/}
convert -antialias -crop 0x0 ${_curimage:S/.pdf$/.eps/} epdf:${_curimage}
.endfor
#
# Using library images
# --------------------
#
# Each document that wants to use one or more library images has to
# list them in the LIB_IMAGES variable. For example, a document that wants
# list them in the IMAGES_LIB variable. For example, a document that wants
# to use callouts 1 thru 4 has to list
#
# LIB_IMAGES= callouts/1.png callouts/2.png callouts/3.png callouts/4.png
# IMAGES_LIB= callouts/1.png callouts/2.png callouts/3.png callouts/4.png
#
# in the controlling Makefile.
#
@ -87,7 +112,7 @@ ${_curimage}: ${_curimage:S/.eps$/.png/}
# The name of the directory that contains all the library images for this
# language and encoding
#
LIB_IMAGES_DIR?= ${.CURDIR}/../../share/images
IMAGES_LIB_DIR?= ${.CURDIR}/../../share/images
#
# The name of the directory *in* the document directory where files and
@ -96,7 +121,7 @@ LIB_IMAGES_DIR?= ${.CURDIR}/../../share/images
# instead. If you redefine this then you must also update the
# %callout-graphics-path% variable in the .dsl file.
#
LOCAL_LIB_IMAGES_DIR?= imagelib
LOCAL_IMAGES_LIB_DIR?= imagelib
CP?= /bin/cp
MKDIR?= /bin/mkdir
@ -104,10 +129,10 @@ MKDIR?= /bin/mkdir
#
# Create a target for each image used from the library. This target just
# ensures that each image required is copied from its location in
# ${LIB_IMAGES_DIR} to the same place in ${LOCAL_LIB_IMAGES_DIR}.
# ${IMAGES_LIB_DIR} to the same place in ${LOCAL_IMAGES_LIB_DIR}.
#
.for _curimage in ${LIB_IMAGES}
${LOCAL_LIB_IMAGES_DIR}/${_curimage}: ${LIB_IMAGES_DIR}/${_curimage}
@[ -d ${LOCAL_LIB_IMAGES_DIR}/${_curimage:H} ] || ${MKDIR} -p ${LOCAL_LIB_IMAGES_DIR}/${_curimage:H}
${INSTALL} -C -c ${LIB_IMAGES_DIR}/${_curimage} ${LOCAL_LIB_IMAGES_DIR}/${_curimage}
.for _curimage in ${IMAGES_LIB}
${LOCAL_IMAGES_LIB_DIR}/${_curimage}: ${IMAGES_LIB_DIR}/${_curimage}
@[ -d ${LOCAL_IMAGES_LIB_DIR}/${_curimage:H} ] || ${MKDIR} -p ${LOCAL_IMAGES_LIB_DIR}/${_curimage:H}
${INSTALL} -C -c ${IMAGES_LIB_DIR}/${_curimage} ${LOCAL_IMAGES_LIB_DIR}/${_curimage}
.endfor

View file

@ -1,7 +1,7 @@
# Taken from:
# Id: bsd.subdir.mk,v 1.27 1999/03/21 06:43:40 bde
#
# $FreeBSD: doc/share/mk/doc.subdir.mk,v 1.3 1999/10/06 14:00:17 jesusr Exp $
# $FreeBSD: doc/share/mk/doc.subdir.mk,v 1.4 2000/07/16 16:34:08 nik Exp $
#
# This include file <doc.subdir.mk> contains the default targets
# for building subdirectories in the FreeBSD Documentation Project.
@ -188,8 +188,8 @@ clean: _SUBDIRUSE
.if defined(CLEANDIRS) && !empty(CLEANDIRS)
rm -rf ${CLEANDIRS}
.endif
.if defined(LIB_IMAGES) && !empty(LOCAL_LIB_IMAGES_DIR)
rm -rf ${LOCAL_LIB_IMAGES_DIR}
.if defined(IMAGES_LIB) && !empty(LOCAL_IMAGES_LIB_DIR)
rm -rf ${LOCAL_IMAGES_LIB_DIR}
.endif
.endif