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
|
2011-09-24 03:36:02 -04:00
|
|
|
|
# $OpenBSD: bsd.port.subdir.mk,v 1.100 2011/09/24 07:36:03 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].
|
|
|
|
|
#
|
|
|
|
|
# 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
|
|
|
|
|
|
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
|
|
|
|
|
2011-09-24 03:36:02 -04:00
|
|
|
|
FULLPATH ?= No
|
|
|
|
|
.if ${FULLPATH:L} == "yes"
|
|
|
|
|
_FULLPATH = true
|
|
|
|
|
.else
|
|
|
|
|
_FULLPATH = false
|
|
|
|
|
.endif
|
|
|
|
|
|
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
|
2010-05-01 06:27:56 -04:00
|
|
|
|
.if defined(STARTAFTER)
|
|
|
|
|
STARTDIR = ${STARTAFTER}
|
|
|
|
|
SKIPDIR += ${STARTAFTER}
|
|
|
|
|
.endif
|
2001-03-28 05:55:52 -05:00
|
|
|
|
|
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}
|
2009-01-24 06:32:43 -05:00
|
|
|
|
_SKIP_STUFF += $i) eval $${echo_msg} "===\> $${subdir} 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
|
|
|
|
|
2009-04-11 10:56:31 -04:00
|
|
|
|
.if defined(MATCHDIR)
|
|
|
|
|
_SKIP_STUFF+= ; case "$${subdir}" in \
|
|
|
|
|
${MATCHDIR}) ;; \
|
|
|
|
|
*) continue ;; esac
|
|
|
|
|
.endif
|
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}}; \
|
2010-07-24 06:35:38 -04:00
|
|
|
|
for i in ${_SKIPPED:QL}; 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}; \
|
2010-05-09 17:41:40 -04:00
|
|
|
|
unset SUBDIR SUBDIRLIST || true; \
|
2007-04-07 05:55:13 -04:00
|
|
|
|
export _STARTDIR_SEEN; \
|
2011-09-24 03:36:02 -04:00
|
|
|
|
_fullpath=${_FULLPATH}; \
|
2010-07-24 06:35:38 -04:00
|
|
|
|
for subdir in ${_FULLSUBDIR:QL}; 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}; \
|
2011-09-24 03:36:02 -04:00
|
|
|
|
if ${_pflavor_fragment}; then \
|
2011-03-20 15:28:07 -04:00
|
|
|
|
eval $${echo_msg} "===\> $$subdir"; \
|
|
|
|
|
if ! (eval $$toset exec ${MAKE} $$target); then \
|
|
|
|
|
eval $${echo_msg} "===\> Exiting $$subdir with an error"; \
|
|
|
|
|
${REPORT_PROBLEM}; \
|
|
|
|
|
fi; \
|
|
|
|
|
else \
|
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
|
|
|
|
|
2009-07-26 08:14:05 -04:00
|
|
|
|
.if ${DANGEROUS:L} == "yes"
|
|
|
|
|
. for __target in ${_recursive_targets} ${_dangerous_recursive_targets}
|
2003-08-04 11:05:24 -04:00
|
|
|
|
${__target}:
|
|
|
|
|
@${_subdir_fragment}
|
2009-07-26 08:14:05 -04:00
|
|
|
|
. endfor
|
|
|
|
|
.else
|
|
|
|
|
. for __target in ${_recursive_targets}
|
|
|
|
|
${__target}:
|
|
|
|
|
@${_subdir_fragment}
|
|
|
|
|
. endfor
|
|
|
|
|
|
|
|
|
|
${_dangerous_recursive_targets}:
|
|
|
|
|
@echo "Target $@ generally invoked in a single port dir"
|
|
|
|
|
@echo "If you really want to do it recursively"
|
|
|
|
|
@echo "make $@ DANGEROUS=Yes"
|
|
|
|
|
@exit 1
|
|
|
|
|
.endif
|
1996-06-03 18:47:10 -04:00
|
|
|
|
|
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:
|
some important improvements to bsd.port.mk
- simplify IGNORE handling, always define it, even when NO_IGNORE is set,
and only use it for the targets it's meant to influence.
- make it possible to multiply-IGNORE a port, so stuff that's BROKEN and
NOT_FOR_ARCH will show up as both.
- DESCRIBE_TARGETs can die, since we no longer need special IGNORE dance
for them.
- add an IGNORE_IS_FATAL tweak, so that ignored ports can actually error out.
- reorg dump-vars to choose what to show, including new IGNORE, and COMES_WITH.
- name an explicit prepare step, which does check build dependencies and
install them (useful for build timing purposes)
- move the do-fetch test out, so that we can add pre-extract and do-extract
there eventually.
2010-02-12 07:00:19 -05:00
|
|
|
|
@${_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}
|
some important improvements to bsd.port.mk
- simplify IGNORE handling, always define it, even when NO_IGNORE is set,
and only use it for the targets it's meant to influence.
- make it possible to multiply-IGNORE a port, so stuff that's BROKEN and
NOT_FOR_ARCH will show up as both.
- DESCRIBE_TARGETs can die, since we no longer need special IGNORE dance
for them.
- add an IGNORE_IS_FATAL tweak, so that ignored ports can actually error out.
- reorg dump-vars to choose what to show, including new IGNORE, and COMES_WITH.
- name an explicit prepare step, which does check build dependencies and
install them (useful for build timing purposes)
- move the do-fetch test out, so that we can add pre-extract and do-extract
there eventually.
2010-02-12 07:00:19 -05:00
|
|
|
|
@subdir=$d; \
|
2006-11-13 08:55:10 -05:00
|
|
|
|
${_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
|
|
|
|
|
some important improvements to bsd.port.mk
- simplify IGNORE handling, always define it, even when NO_IGNORE is set,
and only use it for the targets it's meant to influence.
- make it possible to multiply-IGNORE a port, so stuff that's BROKEN and
NOT_FOR_ARCH will show up as both.
- DESCRIBE_TARGETs can die, since we no longer need special IGNORE dance
for them.
- add an IGNORE_IS_FATAL tweak, so that ignored ports can actually error out.
- reorg dump-vars to choose what to show, including new IGNORE, and COMES_WITH.
- name an explicit prepare step, which does check build dependencies and
install them (useful for build timing purposes)
- move the do-fetch test out, so that we can add pre-extract and do-extract
there eventually.
2010-02-12 07:00:19 -05:00
|
|
|
|
.PHONY: ${_recursive_targets} \
|
2007-06-03 08:51:59 -04:00
|
|
|
|
${_recursive_depends_targets} clean readmes
|