2002-02-16 18:48:23 +01:00
# $FreeBSD$
#
# Documentation release building. These are used to create
# distributions of the documentation files only. These recipes are
# intended to mimic src/release/Makefile; the principal difference is
# that much of the complexity brought about by the chroot environment
# is unneeded.
#
DOC_PREFIX ?= ${ .CURDIR } /..
2002-03-07 17:59:21 +01:00
HOSTNAME ?= /bin/hostname
2002-02-16 18:48:23 +01:00
MKISOFS ?= mkisofs
TAR ?= /usr/bin/tar
TOUCH ?= /usr/bin/touch
#
# Targets:
#
# release Create a clean build of the documentation files,
# obeying the usual specifications such as FORMATS=,
# DOC_LANG=, etc.
#
# rerelease Similar to release, except that existing documentation
# renderings are preserved and installed.
#
# Configuration variables:
#
# BUILDNAME Identification string to be placed in BUILDNAME file
# in the top directory of the release.
#
# DOCROOTDIR Top directory to use for document release building.
# This directory need not exist, and will be created
# if necessary. This variable MUST be defined.
#
# MAKE_ISOS If defined, this will enable creation of an ISO image
# from the document release. Creation of ISO images
# requires a mkisofs binary in the invoking user's path.
#
DATE != date +%Y%m%d
BUILDNAME ?= ${ DATE }
#
2002-04-29 06:47:20 +02:00
# Set defaults for FORMATS, DOC_LANG, and INSTALL_COMPRESSED.
2002-02-16 18:48:23 +01:00
#
2002-04-29 06:47:20 +02:00
FORMATS ?= ps pdf html html-split html-split.tar txt pdb
#DOC_LANG?= en_US.ISO8859-1
INSTALL_COMPRESSED ?= zip gz
2002-02-16 18:48:23 +01:00
#
2002-04-29 06:47:20 +02:00
# Miscellaneous options for the build get set here.
#
2002-02-16 18:48:23 +01:00
# The Japanese translation team has a set of manual pages; we turn
# these off (at least for now) because we have not worked their
# install target into our scheme.
#
2002-04-29 06:47:20 +02:00
# Turn on RLE encoding and indexing.
#
MISCOPTIONS += NO_JPMAN = yes RLE = yes GEN_INDEX = 1
2002-02-16 18:48:23 +01:00
2002-06-27 17:00:21 +02:00
DOCOBJDIR = ${ DOCROOTDIR } /obj
DOCBUILDFILE = ${ DOCOBJDIR } /build.txt
DOCKEYFILE = ${ DOCOBJDIR } /pgpkeyring.txt
2002-02-16 18:48:23 +01:00
DOCSTAGEDIR = ${ DOCROOTDIR } /doc
2002-06-27 17:00:21 +02:00
DOCFTPSTAGEDIR = ${ DOCSTAGEDIR } /ftp
DOCCDROMSTAGEDIR = ${ DOCSTAGEDIR } /cdrom
2002-02-16 18:48:23 +01:00
2002-06-27 17:00:21 +02:00
rerelease release : release .1 ftp .1 cdrom .1
@${ ECHO } " >>> make ${ .TARGET } finished on `LC_ALL=C TZ=GMT date` "
release.1 :
2002-02-16 18:48:23 +01:00
. i f ! d e f i n e d ( D O C R O O T D I R )
@${ ECHO } "To make a release you must define DOCROOTDIR" && false
. e n d i f
@${ ECHO } " >>> make ${ .TARGET } started on `LC_ALL=C TZ=GMT date` "
# If we're doing a release (from scratch), clean out DOCROOTDIR
# (this is the equivalent of CHROOTDIR for src/release).
. i f m a k e ( r e l e a s e )
${ RM } -rf ${ DOCROOTDIR }
${ MKDIR } ${ DOCROOTDIR }
2002-06-28 07:04:42 +02:00
${ MKDIR } ${ DOCOBJDIR }
find ${ DOC_PREFIX } -type d -a \! -name CVS | sed -e s,^,${ DOCOBJDIR } , | xargs ${ MKDIR }
2002-02-16 18:48:23 +01:00
${ MKDIR } ${ DOCSTAGEDIR }
. e n d i f
2002-06-27 17:00:21 +02:00
# Build documents in the obj area.
2002-02-16 18:48:23 +01:00
# We do this so as to avoid interference with any built documents that
# happen to be sitting under ${DOC_PREFIX}, which might be built with
# different options, etc.
2002-06-27 17:00:21 +02:00
cd ${ DOC_PREFIX } && \
env MAKEOBJDIRPREFIX = ${ DOCOBJDIR } ${ MAKE } all FORMATS = " ${ FORMATS } " INSTALL_COMPRESSED = " ${ INSTALL_COMPRESSED } " ${ MISCOPTIONS }
# Build PGP key ring
${ RM } -f ${ DOCKEYFILE }
cd ${ DOC_PREFIX } /en_US.ISO8859-1/books/handbook && env ${ MAKE } pgpkeyring > ${ DOCKEYFILE }
# Construct the build.txt file with the documentation build info.
2002-02-16 18:48:23 +01:00
${ RM } -f ${ DOCBUILDFILE }
${ TOUCH } ${ DOCBUILDFILE }
${ ECHO } " FreeBSD Documentation ${ BUILDNAME } " >> ${ DOCBUILDFILE }
${ ECHO } "Generated on: `LC_ALL=C TZ=GMT date`" >> ${ DOCBUILDFILE }
2002-03-07 17:59:21 +01:00
${ ECHO } " Generated by: ${ USER } @` ${ HOSTNAME } ` " >> ${ DOCBUILDFILE }
2002-02-16 18:48:23 +01:00
${ ECHO } " Formats: ${ FORMATS } " >> ${ DOCBUILDFILE }
${ ECHO } " Languages: ${ DOC_LANG } " >> ${ DOCBUILDFILE }
2002-06-27 17:00:21 +02:00
# Make FTP staging area
ftp.1 :
${ RM } -rf ${ DOCFTPSTAGEDIR }
${ MKDIR } ${ DOCFTPSTAGEDIR }
cd ${ DOC_PREFIX } && \
env MAKEOBJDIRPREFIX = ${ DOCOBJDIR } ${ MAKE } all install DOCDIR = ${ DOCFTPSTAGEDIR } FORMATS = " ${ FORMATS } " INSTALL_COMPRESSED = " ${ INSTALL_COMPRESSED } " ${ MISCOPTIONS }
# Copy newly generated files to staging area
${ CP } ${ DOCBUILDFILE } ${ DOCKEYFILE } ${ DOCFTPSTAGEDIR }
# Copy any files in our texts/ directory to staging area
${ TAR } --exclude CVS -cf - -C ${ .CURDIR } /texts . | \
${ TAR } xf - -C ${ DOCFTPSTAGEDIR }
# Make CDROM staging area, optionally do ISO images too
cdrom.1 :
${ RM } -rf ${ DOCCDROMSTAGEDIR }
${ MKDIR } ${ DOCCDROMSTAGEDIR }
cd ${ DOC_PREFIX } && \
env MAKEOBJDIRPREFIX = ${ DOCOBJDIR } ${ MAKE } all install DOCDIR = ${ DOCCDROMSTAGEDIR } FORMATS = " ${ FORMATS } " INSTALL_COMPRESSED = "" ${ MISCOPTIONS }
# Copy newly generated files to staging area
${ CP } ${ DOCBUILDFILE } ${ DOCKEYFILE } ${ DOCCDROMSTAGEDIR }
# Copy any files in our texts/ directory to the staging area.
${ TAR } --exclude CVS -cf - -C ${ .CURDIR } /texts . | \
${ TAR } xf - -C ${ DOCCDROMSTAGEDIR }
2002-02-16 18:48:23 +01:00
# Make ISO images if desired.
. i f d e f i n e d ( M A K E _ I S O S )
2002-06-27 17:00:21 +02:00
cd ${ DOCROOTDIR } && ${ MKISOFS } -r -J -V fbsd_doc -o ${ DOCSTAGEDIR } /doc.iso ${ DOCCDROMSTAGEDIR }
2002-02-16 18:48:23 +01:00
. e n d i f
. i n c l u d e "${DOC_PREFIX}/share/mk/doc.project.mk"