1999-09-03 19:07:19 +02:00
|
|
|
# Taken from:
|
|
|
|
# Id: bsd.subdir.mk,v 1.27 1999/03/21 06:43:40 bde
|
|
|
|
#
|
2001-10-29 10:21:53 +01:00
|
|
|
# $FreeBSD$
|
1999-09-03 19:07:19 +02:00
|
|
|
#
|
|
|
|
# This include file <doc.subdir.mk> contains the default targets
|
|
|
|
# for building subdirectories in the FreeBSD Documentation Project.
|
|
|
|
#
|
|
|
|
# For all of the directories listed in the variable SUBDIR, the
|
|
|
|
# specified directory will be visited and the target made. There is
|
|
|
|
# also a default target which allows the command "make subdir" where
|
|
|
|
# subdir is any directory listed in the variable SUBDIR.
|
|
|
|
#
|
|
|
|
|
|
|
|
# ------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Document-specific variables:
|
|
|
|
#
|
|
|
|
# SUBDIR A list of subdirectories that should be
|
|
|
|
# built as well. Each of the targets will
|
|
|
|
# execute the same target in the
|
|
|
|
# subdirectories.
|
|
|
|
#
|
|
|
|
# COMPAT_SYMLINK Create a symlink named in this variable
|
|
|
|
# to this directory, when installed.
|
|
|
|
#
|
|
|
|
# ROOT_SYMLINKS Create symlinks to the named directories
|
|
|
|
# in the document root, if the current
|
|
|
|
# language is the primary language (the
|
|
|
|
# PRI_LANG variable).
|
|
|
|
#
|
|
|
|
|
|
|
|
# ------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Provided targets:
|
|
|
|
#
|
|
|
|
# install:
|
|
|
|
# package:
|
|
|
|
# Go down subdirectories and call these targets
|
|
|
|
# along the way, and then call the real target
|
|
|
|
# here.
|
|
|
|
#
|
|
|
|
# clean:
|
2001-12-14 00:51:26 +01:00
|
|
|
# Remove files created by the build process (using
|
|
|
|
# defaults specified by environment)
|
1999-09-03 19:07:19 +02:00
|
|
|
#
|
|
|
|
# cleandir:
|
|
|
|
# Remove the object directory, if any.
|
|
|
|
#
|
2001-12-14 00:51:26 +01:00
|
|
|
# cleanall:
|
|
|
|
# Remove all possible generated files (all predictable
|
|
|
|
# combinations of ${FORMAT} values)
|
|
|
|
#
|
1999-09-03 19:07:19 +02:00
|
|
|
|
2001-11-05 11:33:38 +01:00
|
|
|
.if !target(__initialized__)
|
|
|
|
__initialized__:
|
1999-09-03 19:07:19 +02:00
|
|
|
.if exists(${.CURDIR}/../Makefile.inc)
|
|
|
|
.include "${.CURDIR}/../Makefile.inc"
|
|
|
|
.endif
|
2001-11-05 11:33:38 +01:00
|
|
|
.endif
|
1999-09-03 19:07:19 +02:00
|
|
|
|
|
|
|
.if !target(install)
|
|
|
|
install: afterinstall symlinks
|
|
|
|
afterinstall: realinstall
|
2006-11-09 05:23:14 +01:00
|
|
|
realinstall: beforeinstall
|
1999-09-03 19:07:19 +02:00
|
|
|
.endif
|
|
|
|
|
|
|
|
package: realpackage symlinks
|
|
|
|
realpackage: _SUBDIRUSE
|
|
|
|
|
|
|
|
.if !defined(IGNORE_COMPAT_SYMLINK) && defined(COMPAT_SYMLINK)
|
2005-10-05 15:57:35 +02:00
|
|
|
SYMLINKS+= ${DOCDIR} ${.CURDIR:T} ${COMPAT_SYMLINK}
|
1999-09-03 19:07:19 +02:00
|
|
|
.endif
|
|
|
|
|
|
|
|
.if defined(PRI_LANG) && defined(ROOT_SYMLINKS) && !empty(ROOT_SYMLINKS)
|
|
|
|
.if ${PRI_LANG} == ${LANGCODE}
|
|
|
|
.for _tmp in ${ROOT_SYMLINKS}
|
2005-10-05 15:57:35 +02:00
|
|
|
SYMLINKS+= ${DOCDIR} ${LANGCODE}/${.CURDIR:T}/${_tmp} ${_tmp}
|
1999-09-03 19:07:19 +02:00
|
|
|
.endfor
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if !target(symlinks)
|
|
|
|
symlinks:
|
|
|
|
.if defined(SYMLINKS) && !empty(SYMLINKS)
|
2001-10-29 10:21:53 +01:00
|
|
|
@set $$(${ECHO_CMD} ${SYMLINKS}); \
|
1999-09-03 19:07:19 +02:00
|
|
|
while : ; do \
|
|
|
|
case $$# in \
|
|
|
|
0) break;; \
|
2001-10-29 10:21:53 +01:00
|
|
|
[12]) ${ECHO_CMD} "warn: empty SYMLINKS: $$1 $$2"; break;; \
|
1999-09-03 19:07:19 +02:00
|
|
|
esac; \
|
|
|
|
d=$$1; shift; \
|
|
|
|
l=$$1; shift; \
|
|
|
|
t=$$1; shift; \
|
|
|
|
if [ ! -e $${d}/$${l} ]; then \
|
|
|
|
${ECHO} "$${d}/$${l} doesn't exist, not linking"; \
|
|
|
|
else \
|
|
|
|
${ECHO} $${d}/$${t} -\> $${d}/$${l}; \
|
2001-10-29 10:21:53 +01:00
|
|
|
(cd $${d} && ${RM} -rf $${t}); \
|
|
|
|
(cd $${d} && ${LN} -s $${l} $${t}); \
|
1999-09-03 19:07:19 +02:00
|
|
|
fi; \
|
|
|
|
done
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.for __target in beforeinstall afterinstall realinstall realpackage
|
|
|
|
.if !target(${__target})
|
|
|
|
${__target}:
|
|
|
|
.endif
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
_SUBDIRUSE: .USE
|
|
|
|
.for entry in ${SUBDIR}
|
2001-10-29 10:21:53 +01:00
|
|
|
@${ECHODIR} "===> ${DIRPRFX}${entry}"
|
|
|
|
@cd ${.CURDIR}/${entry} && \
|
|
|
|
${MAKE} ${.TARGET:S/realpackage/package/:S/realinstall/install/} \
|
|
|
|
DIRPRFX=${DIRPRFX}${entry}/
|
1999-09-03 19:07:19 +02:00
|
|
|
.endfor
|
|
|
|
|
|
|
|
.if !defined(NOINCLUDEMK)
|
|
|
|
|
|
|
|
.include <bsd.obj.mk>
|
|
|
|
|
|
|
|
.else
|
|
|
|
|
|
|
|
.MAIN: all
|
|
|
|
|
|
|
|
${SUBDIR}::
|
2001-10-29 10:21:53 +01:00
|
|
|
@cd ${.CURDIR}/${.TARGET} && ${MAKE} all
|
1999-09-03 19:07:19 +02:00
|
|
|
|
|
|
|
.for __target in all cleandir lint objlink install
|
|
|
|
.if !target(${__target})
|
|
|
|
${__target}: _SUBDIRUSE
|
|
|
|
.endif
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
.if !target(obj)
|
|
|
|
obj: _SUBDIRUSE
|
2001-10-29 10:21:53 +01:00
|
|
|
@if ! [ -d ${CANONICALOBJDIR}/ ]; then \
|
|
|
|
${MKDIR} -p ${CANONICALOBJDIR}; \
|
|
|
|
if ! [ -d ${CANONICALOBJDIR}/ ]; then \
|
|
|
|
${ECHO_CMD} "Unable to create ${CANONICALOBJDIR}."; \
|
1999-09-03 19:07:19 +02:00
|
|
|
exit 1; \
|
|
|
|
fi; \
|
|
|
|
${ECHO} "${CANONICALOBJDIR} created ${.CURDIR}"; \
|
|
|
|
fi
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if !target(objlink)
|
|
|
|
objlink: _SUBDIRUSE
|
2001-10-29 10:21:53 +01:00
|
|
|
@if [ -d ${CANONICALOBJDIR}/ ]; then \
|
|
|
|
${RM} -f ${.CURDIR}/obj; \
|
|
|
|
${LN} -s ${CANONICALOBJDIR} ${.CURDIR}/obj; \
|
1999-09-03 19:07:19 +02:00
|
|
|
else \
|
2001-10-29 10:21:53 +01:00
|
|
|
${ECHO_CMD} "No ${CANONICALOBJDIR} to link to - do a make obj."; \
|
1999-09-03 19:07:19 +02:00
|
|
|
fi
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if !target(whereobj)
|
|
|
|
whereobj:
|
2001-10-29 10:21:53 +01:00
|
|
|
@${ECHO_CMD} ${.OBJDIR}
|
1999-09-03 19:07:19 +02:00
|
|
|
.endif
|
|
|
|
|
|
|
|
cleanobj:
|
|
|
|
@if [ -d ${CANONICALOBJDIR}/ ]; then \
|
2001-10-29 10:21:53 +01:00
|
|
|
${RM} -rf ${CANONICALOBJDIR}; \
|
1999-09-03 19:07:19 +02:00
|
|
|
else \
|
|
|
|
cd ${.CURDIR} && ${MAKE} clean cleandepend; \
|
|
|
|
fi
|
2001-10-29 10:21:53 +01:00
|
|
|
@if [ -h ${.CURDIR}/obj ]; then ${RM} -f ${.CURDIR}/obj; fi
|
1999-09-03 19:07:19 +02:00
|
|
|
|
|
|
|
.if !target(clean)
|
|
|
|
clean: _SUBDIRUSE
|
|
|
|
.if defined(CLEANFILES) && !empty(CLEANFILES)
|
2001-10-29 10:21:53 +01:00
|
|
|
${RM} -f ${CLEANFILES}
|
1999-09-03 19:07:19 +02:00
|
|
|
.endif
|
|
|
|
.if defined(CLEANDIRS) && !empty(CLEANDIRS)
|
2001-10-29 10:21:53 +01:00
|
|
|
${RM} -rf ${CLEANDIRS}
|
1999-09-03 19:07:19 +02:00
|
|
|
.endif
|
2000-10-29 03:39:10 +01:00
|
|
|
.if defined(IMAGES_LIB) && !empty(LOCAL_IMAGES_LIB_DIR)
|
2001-10-29 10:21:53 +01:00
|
|
|
${RM} -rf ${LOCAL_IMAGES_LIB_DIR}
|
2000-07-16 18:34:08 +02:00
|
|
|
.endif
|
1999-09-03 19:07:19 +02:00
|
|
|
.endif
|
|
|
|
|
|
|
|
cleandir: cleanobj _SUBDIRUSE
|
|
|
|
|
|
|
|
.endif # end of NOINCLUDEMK section
|
2001-10-29 10:21:53 +01:00
|
|
|
|
|
|
|
#
|
|
|
|
# Create /usr/obj image subdirs when ${IMAGES} contains subdir/image.xxx
|
|
|
|
#
|
|
|
|
|
|
|
|
_imagesubdir=
|
|
|
|
.for _imagedir in ${IMAGES:H}
|
|
|
|
.if ${_imagesubdir:M${_imagedir}} == ""
|
|
|
|
_imagesubdir+= ${_imagedir}
|
|
|
|
.endif
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
.if ${_imagesubdir} != ""
|
|
|
|
_IMAGESUBDIR: .USE
|
|
|
|
.for dir in ${_imagesubdir}
|
|
|
|
@if ! [ -d ${CANONICALOBJDIR}/${dir}/ ]; then \
|
|
|
|
${MKDIR} -p ${CANONICALOBJDIR}/${dir}; \
|
|
|
|
if ! [ -d ${CANONICALOBJDIR}/${dir}/ ]; then \
|
|
|
|
${ECHO_CMD} "Unable to create ${CANONICALOBJDIR}/${dir}/."; \
|
|
|
|
exit 1; \
|
|
|
|
fi; \
|
|
|
|
${ECHO} "${CANONICALOBJDIR}/${dir}/ created for ${.CURDIR}"; \
|
|
|
|
fi
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
obj: _IMAGESUBDIR
|
|
|
|
.endif
|
2001-12-14 00:51:26 +01:00
|
|
|
|
|
|
|
cleanall:
|
|
|
|
${MAKE} FORMATS="${ALL_FORMATS}" clean
|
2017-10-12 16:14:41 +02:00
|
|
|
|
|
|
|
# translations
|
|
|
|
po: _SUBDIRUSE
|
|
|
|
|