2003-08-02 05:53:27 -04:00
|
|
|
|
#-*- mode: Makefile; tab-width: 4; -*-
|
|
|
|
|
# ex:ts=4 sw=4 filetype=make:
|
1997-09-09 11:11:28 -04:00
|
|
|
|
# from: @(#)bsd.subdir.mk 5.9 (Berkeley) 2/1/91
|
2007-08-25 03:56:04 -04:00
|
|
|
|
# $OpenBSD: bsd.port.subdir.mk,v 1.89 2007/08/25 07:56:04 espie Exp $
|
1997-09-09 11:11:28 -04:00
|
|
|
|
# FreeBSD Id: bsd.port.subdir.mk,v 1.20 1997/08/22 11:16:15 asami Exp
|
|
|
|
|
#
|
|
|
|
|
# The include file <bsd.port.subdir.mk> contains the default targets
|
|
|
|
|
# for building ports subdirectories.
|
|
|
|
|
#
|
|
|
|
|
#
|
|
|
|
|
# +++ variables +++
|
|
|
|
|
#
|
|
|
|
|
# STRIP The flag passed to the install program to cause the binary
|
|
|
|
|
# to be stripped. This is to be used when building your
|
|
|
|
|
# own install script so that the entire system can be made
|
|
|
|
|
# stripped/not-stripped using a single knob. [-s]
|
|
|
|
|
#
|
|
|
|
|
# ECHO_MSG Used to print all the '===>' style prompts - override this
|
|
|
|
|
# to turn them off [echo].
|
|
|
|
|
#
|
|
|
|
|
# OPSYS Get the operating system type [`uname -s`]
|
|
|
|
|
#
|
|
|
|
|
# SUBDIR A list of subdirectories that should be built as well.
|
|
|
|
|
# Each of the targets will execute the same target in the
|
|
|
|
|
# subdirectories.
|
|
|
|
|
#
|
|
|
|
|
#
|
|
|
|
|
# +++ targets +++
|
|
|
|
|
#
|
|
|
|
|
# README.html:
|
|
|
|
|
# Creating README.html for package.
|
|
|
|
|
#
|
|
|
|
|
# afterinstall, all, beforeinstall, build, checksum, clean,
|
|
|
|
|
# configure, depend, describe, extract, fetch, fetch-list,
|
2003-07-18 14:18:15 -04:00
|
|
|
|
# install, package, readmes, deinstall, reinstall,
|
1999-07-30 04:57:39 -04:00
|
|
|
|
# tags
|
1997-09-09 11:11:28 -04:00
|
|
|
|
#
|
|
|
|
|
|
2000-03-31 13:05:28 -05:00
|
|
|
|
# recent /usr/share/mk/* should include bsd.own.mk, guard for older versions
|
|
|
|
|
.if !defined(BSD_OWN_MK)
|
|
|
|
|
. include <bsd.own.mk>
|
|
|
|
|
.endif
|
1996-06-03 18:47:10 -04:00
|
|
|
|
|
2006-07-09 07:10:16 -04:00
|
|
|
|
.if defined(verbose-show)
|
|
|
|
|
.MAIN: verbose-show
|
|
|
|
|
.elif defined(show)
|
2001-04-18 10:43:55 -04:00
|
|
|
|
.MAIN: show
|
2001-08-16 10:49:31 -04:00
|
|
|
|
.elif defined(clean)
|
|
|
|
|
.MAIN: clean
|
2001-04-18 10:43:55 -04:00
|
|
|
|
.else
|
1996-06-03 18:47:10 -04:00
|
|
|
|
.MAIN: all
|
2001-04-18 10:43:55 -04:00
|
|
|
|
.endif
|
1996-06-03 18:47:10 -04:00
|
|
|
|
|
|
|
|
|
.if !defined(DEBUG_FLAGS)
|
2006-11-27 10:38:01 -05:00
|
|
|
|
STRIP ?= -s
|
1996-06-03 18:47:10 -04:00
|
|
|
|
.endif
|
|
|
|
|
|
1999-11-20 12:56:57 -05:00
|
|
|
|
.if !defined(OPSYS) # XXX !!
|
2006-11-27 10:38:01 -05:00
|
|
|
|
OPSYS = OpenBSD
|
1999-11-20 12:56:57 -05:00
|
|
|
|
.endif
|
2007-07-08 13:57:56 -04:00
|
|
|
|
ARCH ?!= uname -m
|
1996-06-03 18:47:10 -04:00
|
|
|
|
|
2003-08-02 05:53:27 -04:00
|
|
|
|
.include "${PORTSDIR}/infrastructure/mk/pkgpath.mk"
|
2000-07-14 19:01:11 -04:00
|
|
|
|
|
2006-11-27 10:38:01 -05:00
|
|
|
|
ECHO_MSG ?= echo
|
1996-06-03 18:47:10 -04:00
|
|
|
|
|
2003-08-02 05:53:27 -04:00
|
|
|
|
# create a full list of SUBDIRS...
|
|
|
|
|
.if empty(PKGPATH)
|
2006-11-27 10:38:01 -05:00
|
|
|
|
_FULLSUBDIR := ${SUBDIR}
|
2003-08-02 05:53:27 -04:00
|
|
|
|
.else
|
2006-11-27 10:38:01 -05:00
|
|
|
|
_FULLSUBDIR := ${SUBDIR:S@^@${PKGPATH}/@g}
|
2001-03-28 05:55:52 -05:00
|
|
|
|
.endif
|
|
|
|
|
|
2007-06-30 10:31:00 -04:00
|
|
|
|
_SKIP_STUFF = case "$${subdir}" in
|
2003-08-02 05:53:27 -04:00
|
|
|
|
.for i in ${SKIPDIR}
|
2007-06-30 10:31:00 -04:00
|
|
|
|
_SKIP_STUFF += $i) eval $${echo_msg} "===\> $i skipped"; continue;;
|
2003-08-02 05:53:27 -04:00
|
|
|
|
.endfor
|
2007-06-30 10:31:00 -04:00
|
|
|
|
_SKIP_STUFF += *) ;; esac
|
|
|
|
|
|
2007-04-07 05:55:13 -04:00
|
|
|
|
.if defined(STARTDIR) && !empty(STARTDIR)
|
|
|
|
|
_STARTDIR_SEEN ?= false
|
|
|
|
|
.else
|
|
|
|
|
_STARTDIR_SEEN ?= true
|
|
|
|
|
.endif
|
2003-08-02 05:53:27 -04:00
|
|
|
|
|
2006-11-27 10:38:01 -05:00
|
|
|
|
TEMPLATES ?= ${PORTSDIR}/infrastructure/templates
|
|
|
|
|
.if defined(PORTSTOP)
|
|
|
|
|
README = ${TEMPLATES}/README.top
|
|
|
|
|
.else
|
|
|
|
|
README = ${TEMPLATES}/README.category
|
|
|
|
|
.endif
|
2003-08-02 05:53:27 -04:00
|
|
|
|
|
2006-11-27 10:38:01 -05:00
|
|
|
|
_subdir_fragment = \
|
2003-08-08 19:56:13 -04:00
|
|
|
|
: $${echo_msg:=${ECHO_MSG:Q}}; \
|
2003-08-04 11:05:24 -04:00
|
|
|
|
: $${target:=${.TARGET}}; \
|
|
|
|
|
for i in ${_SKIPPED}; do \
|
2003-08-08 19:56:13 -04:00
|
|
|
|
eval $${echo_msg} "===\> $$i skipped"; \
|
2003-08-04 11:05:24 -04:00
|
|
|
|
done; \
|
2007-04-07 05:55:13 -04:00
|
|
|
|
_STARTDIR_SEEN=${_STARTDIR_SEEN}; \
|
|
|
|
|
export _STARTDIR_SEEN; \
|
2005-11-02 15:30:12 -05:00
|
|
|
|
for subdir in ${_FULLSUBDIR}; do \
|
2007-04-07 05:55:13 -04:00
|
|
|
|
if ! $${_STARTDIR_SEEN}; then \
|
|
|
|
|
case "${STARTDIR}" in \
|
2007-04-28 06:19:41 -04:00
|
|
|
|
$$subdir) \
|
|
|
|
|
_STARTDIR_SEEN=true;; \
|
2007-04-07 05:55:13 -04:00
|
|
|
|
$$subdir*) \
|
|
|
|
|
;; \
|
|
|
|
|
*) \
|
|
|
|
|
continue;; \
|
|
|
|
|
esac; \
|
|
|
|
|
fi; \
|
2007-06-30 10:31:00 -04:00
|
|
|
|
${_SKIP_STUFF}; \
|
2003-08-04 10:37:48 -04:00
|
|
|
|
${_flavor_fragment}; \
|
2005-11-02 15:30:12 -05:00
|
|
|
|
eval $${echo_msg} "===\> $$subdir"; \
|
2006-12-18 07:52:34 -05:00
|
|
|
|
if ! (eval $$toset exec ${MAKE} $$target); then \
|
2007-08-25 03:56:04 -04:00
|
|
|
|
eval $${echo_msg} "===\> Exiting $$subdir with an error"; \
|
2003-08-04 10:37:48 -04:00
|
|
|
|
${REPORT_PROBLEM}; \
|
|
|
|
|
fi; \
|
2007-04-07 05:55:13 -04:00
|
|
|
|
_STARTDIR_SEEN=true; \
|
2006-12-18 07:52:34 -05:00
|
|
|
|
done
|
2003-08-04 10:37:48 -04:00
|
|
|
|
|
2007-06-03 08:51:59 -04:00
|
|
|
|
.for __target in ${_recursive_targets}
|
2003-08-04 11:05:24 -04:00
|
|
|
|
${__target}:
|
|
|
|
|
@${_subdir_fragment}
|
1996-06-03 18:47:10 -04:00
|
|
|
|
.endfor
|
|
|
|
|
|
2007-06-03 08:51:59 -04:00
|
|
|
|
.for __target in ${_recursive_describe_targets}
|
2006-11-13 08:55:10 -05:00
|
|
|
|
${__target}:
|
|
|
|
|
@DESCRIBE_TARGET=Yes; export DESCRIBE_TARGET; ${_subdir_fragment}
|
|
|
|
|
.endfor
|
|
|
|
|
|
2007-06-03 08:51:59 -04:00
|
|
|
|
.for __target in ${_recursive_depends_targets}
|
2003-08-04 10:37:48 -04:00
|
|
|
|
|
2003-08-04 11:05:24 -04:00
|
|
|
|
${__target}:
|
2004-04-07 09:06:33 -04:00
|
|
|
|
@${_depfile_fragment}; echo_msg=:; ${_subdir_fragment}
|
2003-08-04 10:37:48 -04:00
|
|
|
|
.endfor
|
|
|
|
|
|
2003-08-04 10:45:31 -04:00
|
|
|
|
clean:
|
2003-08-04 11:05:24 -04:00
|
|
|
|
.if defined(clean) && ${clean:L:Mdepends}
|
|
|
|
|
@{ target=all-dir-depends; echo_msg=:; \
|
2006-11-27 10:38:01 -05:00
|
|
|
|
${_depfile_fragment}; ${_subdir_fragment}; }| tsort -r| \
|
|
|
|
|
while read subdir; do \
|
2003-08-04 10:45:31 -04:00
|
|
|
|
${_flavor_fragment}; \
|
|
|
|
|
eval $$toset ${MAKE} _CLEANDEPENDS=No clean; \
|
|
|
|
|
done
|
|
|
|
|
.else
|
2003-08-04 11:05:24 -04:00
|
|
|
|
@${_subdir_fragment}
|
2003-08-04 10:45:31 -04:00
|
|
|
|
.endif
|
2003-08-04 09:31:26 -04:00
|
|
|
|
.if defined(clean) && ${clean:L:Mreadmes}
|
2007-03-19 17:32:35 -04:00
|
|
|
|
rm -f ${READMES_TOP}/${PKGPATH}/README.html
|
2003-08-04 09:25:36 -04:00
|
|
|
|
.endif
|
1996-06-03 18:47:10 -04:00
|
|
|
|
|
2003-08-04 11:05:24 -04:00
|
|
|
|
readmes:
|
2006-11-13 08:55:10 -05:00
|
|
|
|
@DESCRIBE_TARGET=Yes; export DESCRIBE_TARGET; ${_subdir_fragment}
|
2006-12-02 06:27:46 -05:00
|
|
|
|
@tmpdir=`mktemp -d ${TMPDIR}/readme.XXXXXX`; \
|
|
|
|
|
trap 'rm -r $$tmpdir' 0 1 2 3 13 15; \
|
|
|
|
|
cd ${.CURDIR} && ${MAKE} TMPDIR=$$tmpdir \
|
|
|
|
|
${READMES_TOP}/${PKGPATH}/README.html
|
|
|
|
|
|
|
|
|
|
${READMES_TOP}/${PKGPATH}/README.html:
|
|
|
|
|
@mkdir -p ${@D}
|
|
|
|
|
@>${TMPDIR}/subdirs
|
2003-08-02 05:58:11 -04:00
|
|
|
|
.for d in ${_FULLSUBDIR}
|
2006-11-13 08:55:10 -05:00
|
|
|
|
@subdir=$d; DESCRIBE_TARGET=yes; export DESCRIBE_TARGET; \
|
|
|
|
|
${_flavor_fragment}; \
|
2007-03-19 17:32:35 -04:00
|
|
|
|
if name=`eval $$toset ${MAKE} _print-packagename`; then \
|
|
|
|
|
comment=`eval $$toset ${MAKE} show=_COMMENT|sed -e 's,^",,' -e 's,"$$,,' |${HTMLIFY}`; \
|
|
|
|
|
else \
|
|
|
|
|
comment=''; \
|
|
|
|
|
fi; \
|
2003-08-02 05:53:27 -04:00
|
|
|
|
cd ${.CURDIR}; \
|
2006-12-02 06:27:46 -05:00
|
|
|
|
echo "<dt><a href=\"${PKGDEPTH}$$dir/$$name.html\">$d</a><dd>$$comment" >>${TMPDIR}/subdirs
|
1996-06-03 18:47:10 -04:00
|
|
|
|
.endfor
|
2006-12-02 06:27:46 -05:00
|
|
|
|
@sed -e 's%%CATEGORY%%'`echo ${.CURDIR} | sed -e 's.*/\([^/]*\)$$\1'`'g' \
|
|
|
|
|
-e '/%%DESCR%%/r${.CURDIR}/pkg/DESCR' -e '//d' \
|
|
|
|
|
-e '/%%SUBDIR%%/r${TMPDIR}/subdirs' -e '//d' \
|
|
|
|
|
${README} > $@
|
|
|
|
|
@rm ${TMPDIR}/subdirs
|
1999-10-29 16:28:33 -04:00
|
|
|
|
|
2007-06-03 08:51:59 -04:00
|
|
|
|
.PHONY: ${_recursive_targets} ${_recursive_describe_targets} \
|
|
|
|
|
${_recursive_depends_targets} clean readmes
|