2003-11-24 19:26:35 +01:00
|
|
|
#
|
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
# This include file <doc.common.mk> provides targets and variables for
|
|
|
|
# documents commonly used in doc/ and www/ tree.
|
|
|
|
#
|
|
|
|
|
|
|
|
# ------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Work out the language and encoding used for this document.
|
|
|
|
#
|
|
|
|
# Liberal default of maximum of 10 directories below to find it.
|
|
|
|
#
|
|
|
|
|
2004-01-07 00:57:46 +01:00
|
|
|
.if defined(DOC_PREFIX) && !empty(DOC_PREFIX)
|
2004-05-11 12:35:19 +02:00
|
|
|
DOC_PREFIX_NAME!= ${REALPATH} ${DOC_PREFIX}
|
2004-01-07 00:57:46 +01:00
|
|
|
DOC_PREFIX_NAME:= ${DOC_PREFIX_NAME:T}
|
|
|
|
.else
|
2012-05-17 05:23:15 +02:00
|
|
|
DOC_PREFIX_NAME?= head
|
2004-01-07 00:57:46 +01:00
|
|
|
.endif
|
2003-11-24 19:26:35 +01:00
|
|
|
|
2012-05-17 05:23:15 +02:00
|
|
|
.if (!defined(LANGCODE) || empty(LANGCODE))
|
2013-05-17 21:56:43 +02:00
|
|
|
LANGCODE!= echo ${.CURDIR} | grep -o '[a-z]*_[A-Z]*\.[-A-Za-z0-9]*' || echo "."
|
2013-05-15 15:40:06 +02:00
|
|
|
.endif
|
2003-11-24 19:26:35 +01:00
|
|
|
|
2012-05-17 05:23:15 +02:00
|
|
|
# normalize DOC_PREFIX
|
2004-05-11 12:35:19 +02:00
|
|
|
DOC_PREFIX!= ${REALPATH} ${DOC_PREFIX}
|
2006-08-21 20:27:43 +02:00
|
|
|
|
2012-05-17 22:21:00 +02:00
|
|
|
# Used for &base;
|
2012-05-17 23:57:53 +02:00
|
|
|
DOC_PREFIX_REL= ${.CURDIR:S,^${DOC_PREFIX}/${LANGCODE},,:C,/[^/]+,/..,g:S,^/..,,:S,^/,,:S,^$,.,}
|
2012-05-17 22:21:00 +02:00
|
|
|
|
2004-07-06 17:09:55 +02:00
|
|
|
.if !defined(URL_RELPREFIX)
|
|
|
|
URLS_ABSOLUTE= YES
|
|
|
|
.elif !defined(URLS_ABSOLUTE)
|
|
|
|
_URL_RELPREFIX_LEVEL!= set -- ${URL_RELPREFIX:S,/$,,:S,/, ,g}; echo "$$\#"
|
|
|
|
URL_RELPREFIX_ENT= freebsd.urls.relprefix.${_URL_RELPREFIX_LEVEL}
|
|
|
|
.endif
|
|
|
|
|
2004-05-05 14:52:48 +02:00
|
|
|
#
|
2004-05-11 12:59:48 +02:00
|
|
|
# when URLS_ABSOLUTE is specified, make
|
|
|
|
# %freebsd.urls.absolute; "INCLUDE".
|
2004-05-05 14:52:48 +02:00
|
|
|
#
|
2004-05-11 12:59:48 +02:00
|
|
|
.if defined(URLS_ABSOLUTE)
|
|
|
|
HTMLFLAGS+= -ifreebsd.urls.absolute
|
|
|
|
SGMLNORMFLAGS+= -ifreebsd.urls.absolute
|
|
|
|
NSGMLSFLAGS+= -ifreebsd.urls.absolute
|
2004-07-06 17:09:55 +02:00
|
|
|
.elif defined(URL_RELPREFIX_ENT) && !empty(URL_RELPREFIX_ENT)
|
|
|
|
HTMLFLAGS+= -i${URL_RELPREFIX_ENT}
|
|
|
|
SGMLNORMFLAGS+= -i${URL_RELPREFIX_ENT}
|
|
|
|
NSGMLSFLAGS+= -i${URL_RELPREFIX_ENT}
|
2004-05-05 14:52:48 +02:00
|
|
|
.endif
|
2004-05-12 14:58:12 +02:00
|
|
|
|
|
|
|
# for ascii and printable format, always use URLS_ABSOLUTE.
|
|
|
|
PRINTFLAGS+= -ifreebsd.urls.absolute
|
|
|
|
HTMLTXTFLAGS+= -ifreebsd.urls.absolute
|
2004-07-07 13:23:16 +02:00
|
|
|
OTHERFLAGS+= -ifreebsd.urls.absolute
|
2004-05-12 14:58:12 +02:00
|
|
|
|
|
|
|
# for packages, always use URLS_ABSOLUTE.
|
|
|
|
PKGMAKEFLAGS+= URLS_ABSOLUTE=yes
|