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
|
2006-11-13 08:55:10 -05:00
|
|
|
|
# $OpenBSD: bsd.port.subdir.mk,v 1.78 2006/11/13 13:55:10 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)
|
|
|
|
|
STRIP?= -s
|
|
|
|
|
.endif
|
|
|
|
|
|
1999-11-20 12:56:57 -05:00
|
|
|
|
.if !defined(OPSYS) # XXX !!
|
|
|
|
|
OPSYS= OpenBSD
|
|
|
|
|
.endif
|
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
|
|
|
|
|
1996-06-03 18:47:10 -04:00
|
|
|
|
ECHO_MSG?= echo
|
|
|
|
|
|
2003-08-02 05:53:27 -04:00
|
|
|
|
# create a full list of SUBDIRS...
|
|
|
|
|
.if empty(PKGPATH)
|
2003-08-02 05:58:11 -04:00
|
|
|
|
_FULLSUBDIR:=${SUBDIR}
|
2003-08-02 05:53:27 -04:00
|
|
|
|
.else
|
2003-08-02 05:58:11 -04:00
|
|
|
|
_FULLSUBDIR:=${SUBDIR:S@^@${PKGPATH}/@g}
|
2001-03-28 05:55:52 -05:00
|
|
|
|
.endif
|
|
|
|
|
|
2003-08-02 05:58:11 -04:00
|
|
|
|
_SKIPPED=
|
2003-08-02 05:53:27 -04:00
|
|
|
|
.for i in ${SKIPDIR}
|
2003-08-04 11:05:24 -04:00
|
|
|
|
_SKIPPED:+=${_FULLSUBDIR:M$i}
|
2003-08-02 05:58:11 -04:00
|
|
|
|
_FULLSUBDIR:=${_FULLSUBDIR:N$i}
|
2003-08-02 05:53:27 -04:00
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
|
|
|
2003-08-04 11:05:24 -04: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; \
|
2005-11-02 15:30:12 -05:00
|
|
|
|
for subdir in ${_FULLSUBDIR}; do \
|
2003-08-04 10:37:48 -04:00
|
|
|
|
${_flavor_fragment}; \
|
2005-11-02 15:30:12 -05:00
|
|
|
|
eval $${echo_msg} "===\> $$subdir"; \
|
2003-08-04 10:37:48 -04:00
|
|
|
|
set +e; \
|
2003-08-04 11:05:24 -04:00
|
|
|
|
if ! eval $$toset ${MAKE} $$target; then \
|
2003-08-04 10:37:48 -04:00
|
|
|
|
${REPORT_PROBLEM}; \
|
|
|
|
|
fi; \
|
2003-08-04 11:05:24 -04:00
|
|
|
|
done; set -e
|
2003-08-04 10:37:48 -04:00
|
|
|
|
|
2004-09-26 05:59:14 -04:00
|
|
|
|
.for __target in all fetch package fake extract patch configure \
|
2006-11-13 08:55:10 -05:00
|
|
|
|
build distclean deinstall install update \
|
|
|
|
|
reinstall checksum fetch-makefile \
|
2003-08-04 10:16:53 -04:00
|
|
|
|
link-categories unlink-categories regress lib-depends-check \
|
2006-11-13 08:55:10 -05:00
|
|
|
|
newlib-depends-check manpages-check license-check \
|
|
|
|
|
print-package-signature
|
2000-04-09 08:04:13 -04:00
|
|
|
|
|
2003-08-04 11:05:24 -04:00
|
|
|
|
${__target}:
|
|
|
|
|
@${_subdir_fragment}
|
1996-06-03 18:47:10 -04:00
|
|
|
|
.endfor
|
|
|
|
|
|
2006-11-13 08:55:10 -05:00
|
|
|
|
.for __target in describe show verbose-show dump-vars \
|
|
|
|
|
homepage-links print-plist print-plist-contents \
|
|
|
|
|
print-plist-all
|
|
|
|
|
${__target}:
|
|
|
|
|
@DESCRIBE_TARGET=Yes; export DESCRIBE_TARGET; ${_subdir_fragment}
|
|
|
|
|
.endfor
|
|
|
|
|
|
2006-11-05 10:46:51 -05:00
|
|
|
|
.for __target in all-dir-depends build-dir-depends run-dir-depends regress-dir-depends
|
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=:; \
|
2005-11-02 15:30:12 -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}
|
2003-08-04 09:25:36 -04:00
|
|
|
|
rm -f ${.CURDIR}/README.html
|
|
|
|
|
.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}
|
2003-08-04 09:25:36 -04:00
|
|
|
|
@rm -f ${.CURDIR}/README.html
|
2003-08-02 05:58:11 -04:00
|
|
|
|
@cd ${.CURDIR} && exec ${MAKE} README.html
|
1996-06-03 18:47:10 -04:00
|
|
|
|
|
1999-07-28 08:40:56 -04:00
|
|
|
|
TEMPLATES ?= ${PORTSDIR}/infrastructure/templates
|
1996-06-03 18:47:10 -04:00
|
|
|
|
.if defined(PORTSTOP)
|
|
|
|
|
README= ${TEMPLATES}/README.top
|
|
|
|
|
.else
|
|
|
|
|
README= ${TEMPLATES}/README.category
|
|
|
|
|
.endif
|
|
|
|
|
|
|
|
|
|
README.html:
|
2003-08-02 05:53:27 -04:00
|
|
|
|
@>$@.tmp
|
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}; \
|
2003-08-02 05:53:27 -04:00
|
|
|
|
name=`eval $$toset ${MAKE} _print-packagename`; \
|
|
|
|
|
case $$name in \
|
|
|
|
|
README) comment='';; \
|
|
|
|
|
*) comment=`eval $$toset ${MAKE} show=_COMMENT|sed -e 's,^",,' -e 's,"$$,,' |${HTMLIFY}`;; \
|
|
|
|
|
esac; \
|
|
|
|
|
cd ${.CURDIR}; \
|
2003-08-02 05:58:11 -04:00
|
|
|
|
echo "<dt><a href=\"${PKGDEPTH}$$dir/$$name.html\">$d</a><dd>$$comment" >>$@.tmp
|
1996-06-03 18:47:10 -04:00
|
|
|
|
.endfor
|
|
|
|
|
@cat ${README} | \
|
|
|
|
|
sed -e 's%%CATEGORY%%'`echo ${.CURDIR} | sed -e 's.*/\([^/]*\)$$\1'`'g' \
|
2000-03-26 11:57:42 -05:00
|
|
|
|
-e '/%%DESCR%%/r${.CURDIR}/pkg/DESCR' -e '//d' \
|
2003-08-02 05:53:27 -04:00
|
|
|
|
-e '/%%SUBDIR%%/r$@.tmp' -e '//d' \
|
1996-06-03 18:47:10 -04:00
|
|
|
|
> $@
|
2003-08-02 05:53:27 -04:00
|
|
|
|
@rm $@.tmp
|
1999-10-29 16:28:33 -04:00
|
|
|
|
|
2003-02-16 10:16:17 -05:00
|
|
|
|
_print-packagename:
|
2003-08-02 05:53:27 -04:00
|
|
|
|
@echo "README"
|
2003-02-16 10:16:17 -05:00
|
|
|
|
|
2003-08-14 20:35:10 -04:00
|
|
|
|
.PHONY: all fetch package fake extract configure \
|
2004-11-15 08:53:43 -05:00
|
|
|
|
build describe distclean deinstall install update \
|
2006-07-09 07:10:16 -04:00
|
|
|
|
reinstall checksum show verbose-show dump-vars fetch-makefile \
|
2003-08-14 20:35:10 -04:00
|
|
|
|
link-categories unlink-categories regress lib-depends-check \
|
2004-11-21 06:28:31 -05:00
|
|
|
|
newlib-depends-check \
|
2003-08-14 20:35:10 -04:00
|
|
|
|
homepage-links manpages-check license-check \
|
2006-11-05 10:46:51 -05:00
|
|
|
|
all-dir-depends build-dir-depends run-dir-depends regress-dir-depends \
|
2005-09-23 04:26:21 -04:00
|
|
|
|
clean readmes _print-packagename print-package-signature
|