doc build with .OBJDIR
Simon L. Nielsen
simon at nitro.dk
Fri May 23 14:13:54 UTC 2003
On 2003.05.23 04:37:42 +0200, Dag-Erling Smorgrav wrote:
> Dag-Erling Smorgrav <des at ofug.org> writes:
> > "Simon L. Nielsen" <simon at nitro.dk> writes:
> > > I think the correct solution is to use .PATH in the makefiles.
> > No, the correct solution is to not use ${.OBJDIR} [...]
>
> Ah, sorry, I replied without really understanding what you were
> saying. Yes, of course, part of the solution is to use .PATH to
> specify where the sources for the images are found. Once that is done
> you can eliminate most of the ${.OBJDIR} use from doc.images.mk.
I have a patch that almost works now...
The only problem is with the console server article which use a
.png image that is not generated, and therefore is not put in
the object directory. That causes the install to fail. I'm currently
trying to find the right way to fix this.
--
Simon L. Nielsen
-------------- next part --------------
Index: share/mk/doc.images.mk
===================================================================
RCS file: /home/ncvs/doc/share/mk/doc.images.mk,v
retrieving revision 1.22
diff -u -d -r1.22 doc.images.mk
--- share/mk/doc.images.mk 11 Apr 2003 09:21:15 -0000 1.22
+++ share/mk/doc.images.mk 23 May 2003 15:57:34 -0000
@@ -3,13 +3,15 @@
#
# This include file <doc.images.mk> handles image processing.
#
-# There are two types of images that must be handled:
+# There are three types of images that must be handled:
#
# 1. Images from the library directory, that are shared across multiple
# documents.
#
# 2. Images that are document specific.
#
+# 3. Images that are document specific, but language neutral.
+#
# For library images this file ensures that they are copied in to the
# documents directory so that they can be reference properly.
#
@@ -54,11 +56,18 @@
# The name of the directory that contains all the library images for this
# language and encoding
#
-IMAGES_EN_DIR?= ${.CURDIR}/../../../share/images
-.for _curimage in ${IMAGES_EN}
-LOCAL_IMAGES_EN += ${IMAGES_EN_DIR}/${DOC}s/${.CURDIR:T}/${_curimage}
-.endfor
+# The document type (book|article)
+DOC_TYPE?= ${.CURDIR:H:T:S|s$||}
+
+# The name of the document. Should be the name of the directory the
+# document is stored in.
+DOC_NAME?= ${.CURDIR:T}
+
+# Tell make where to find the language neutral images
+.PATH: ${DOC_PREFIX}/share/images/${DOC_TYPE}s/${DOC_NAME}
+
+LOCAL_IMAGES_EN+= ${IMAGES_EN}
_IMAGES_PNG= ${IMAGES:M*.png}
_IMAGES_PNG+= ${LOCAL_IMAGES_EN:M*.png}
@@ -91,28 +100,10 @@
IMAGES_EPS= ${_IMAGES_EPS} ${IMAGES_GEN_EPS} ${IMAGES_SCR_EPS} ${IMAGES_PIC_EPS}
IMAGES_TXT= ${_IMAGES_TXT} ${IMAGES_SCR_TXT}
-.if ${.OBJDIR} != ${.CURDIR}
-LOCAL_IMAGES= ${IMAGES:S|^|${.OBJDIR}/|}
-CLEANFILES+= ${LOCAL_IMAGES}
-
-.if !empty(_IMAGES_PNG)
-LOCAL_IMAGES_PNG= ${_IMAGES_PNG:S|^|${.OBJDIR}/|}
-.endif
-
-.if !empty(_IMAGES_EPS)
-LOCAL_IMAGES_EPS= ${_IMAGES_EPS:S|^|${.OBJDIR}/|}
-.endif
-
-.if !empty(_IMAGES_TXT)
-LOCAL_IMAGES_TXT= ${_IMAGES_TXT:S|^|${.OBJDIR}/|}
-.endif
-
-.else
LOCAL_IMAGES= ${IMAGES}
LOCAL_IMAGES_PNG= ${_IMAGES_PNG}
LOCAL_IMAGES_EPS= ${_IMAGES_EPS}
LOCAL_IMAGES_TXT= ${_IMAGES_TXT}
-.endif
LOCAL_IMAGES_PNG+= ${IMAGES_GEN_PNG} ${IMAGES_SCR_PNG} ${IMAGES_PIC_PNG}
LOCAL_IMAGES_EPS+= ${IMAGES_GEN_EPS} ${IMAGES_SCR_EPS} ${IMAGES_PIC_EPS}
@@ -171,6 +162,7 @@
`${REALPATH} ${.TARGET:S/.png$/.eps/}`
.pic.eps:
+ ${MKDIR} ${.TARGET:H}
${PIC2PS} ${.ALLSRC} > ${.TARGET:S/.eps$/.ps/}
${PS2EPS} ${.TARGET:S/.eps$/.ps/} ${.TARGET}
@@ -181,17 +173,20 @@
.for _curimage in ${IMAGES_GEN_PNG}
${_curimage}: ${_curimage:S/.png$/.eps/}
+ ${MKDIR} ${.TARGET:H}
${EPS2PNG} ${EPS2PNGOPTS} -o ${.TARGET} `${REALPATH} ${.ALLSRC}`
.endfor
.for _curimage in ${IMAGES_GEN_EPS}
${_curimage}: ${_curimage:S/.eps$/.png/}
+ ${MKDIR} ${.TARGET:H}
${PNGTOPNM} ${PNGTOPNMOPTS} ${.ALLSRC} | \
${PNMTOPS} ${PNMTOPSOPTS} > ${.TARGET}
.endfor
.for _curimage in ${IMAGES_GEN_PDF}
${_curimage}: ${_curimage:S/.pdf$/.eps/}
+ ${MKDIR} ${.TARGET:H}
${EPSTOPDF} ${EPSTOPDFOPTS} --outfile=${.TARGET} ${.ALLSRC}
.endfor
@@ -225,7 +220,7 @@
# The name of the directory that contains all the library images for this
# language and encoding
#
-IMAGES_LIB_DIR?= ${.CURDIR}/../../../share/images
+IMAGES_LIB_DIR?= ${DOC_PREFIX}/share/images
#
# The name of the directory *in* the document directory where files and
Index: en_US.ISO8859-1/books/handbook/txtfiles.ent
===================================================================
RCS file: /home/ncvs/doc/en_US.ISO8859-1/books/handbook/txtfiles.ent,v
retrieving revision 1.2
diff -u -d -r1.2 txtfiles.ent
--- en_US.ISO8859-1/books/handbook/txtfiles.ent 11 Apr 2003 09:21:15 -0000 1.2
+++ en_US.ISO8859-1/books/handbook/txtfiles.ent 23 May 2003 03:08:36 -0000
@@ -66,6 +66,6 @@
<!ENTITY txt.install.timezone1 SYSTEM "install/timezone1.txt">
<!ENTITY txt.install.timezone2 SYSTEM "install/timezone2.txt">
<!ENTITY txt.install.timezone3 SYSTEM "install/timezone3.txt">
-<!ENTITY txt.install.userconfig SYSTEM "../../../share/images/books/handbook/install/userconfig.txt">
-<!ENTITY txt.install.userconfig2 SYSTEM "../../../share/images/books/handbook/install/userconfig2.txt">
+<!ENTITY txt.install.userconfig SYSTEM "install/userconfig.txt">
+<!ENTITY txt.install.userconfig2 SYSTEM "install/userconfig2.txt">
<!ENTITY txt.install.xf86setup SYSTEM "install/xf86setup.txt">
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-doc/attachments/20030523/81fde8df/attachment.sig>
More information about the freebsd-doc
mailing list