Changeset View
Changeset View
Standalone View
Standalone View
Mk/bsd.port.subdir.mk
Show First 20 Lines • Show All 58 Lines • ▼ Show 20 Lines | |||||
STRIP?= -s | STRIP?= -s | ||||
.endif | .endif | ||||
# These are variables that are invariant for the lifetime of a recursive port traversal | # These are variables that are invariant for the lifetime of a recursive port traversal | ||||
# (index build, etc), so it is more efficient to precompute them here and pass them in | # (index build, etc), so it is more efficient to precompute them here and pass them in | ||||
# to child makes explicitly, instead of recomputing them tens of thousands of times. | # to child makes explicitly, instead of recomputing them tens of thousands of times. | ||||
.if !defined(NOPRECIOUSMAKEVARS) | .if !defined(NOPRECIOUSMAKEVARS) | ||||
.if !defined(ARCH) | . if !defined(ARCH) | ||||
ARCH!= ${UNAME} -p | ARCH!= ${UNAME} -p | ||||
.endif | . endif | ||||
_EXPORTED_VARS+= ARCH | _EXPORTED_VARS+= ARCH | ||||
.if !defined(OSVERSION) | . if !defined(OSVERSION) | ||||
.if exists(/usr/include/sys/param.h) | . if exists(/usr/include/sys/param.h) | ||||
OSVERSION!= ${AWK} '/^\#define[[:blank:]]__FreeBSD_version/ {print $$3}' < /usr/include/sys/param.h | OSVERSION!= ${AWK} '/^\#define[[:blank:]]__FreeBSD_version/ {print $$3}' < /usr/include/sys/param.h | ||||
.elif exists(${SRC_BASE}/sys/sys/param.h) | . elif exists(${SRC_BASE}/sys/sys/param.h) | ||||
OSVERSION!= ${AWK} '/^\#define[[:blank:]]__FreeBSD_version/ {print $$3}' < ${SRC_BASE}/sys/sys/param.h | OSVERSION!= ${AWK} '/^\#define[[:blank:]]__FreeBSD_version/ {print $$3}' < ${SRC_BASE}/sys/sys/param.h | ||||
.else | . else | ||||
OSVERSION!= ${SYSCTL} -n kern.osreldate | OSVERSION!= ${SYSCTL} -n kern.osreldate | ||||
.endif | . endif | ||||
.endif | . endif | ||||
_EXPORTED_VARS+= OSVERSION | _EXPORTED_VARS+= OSVERSION | ||||
WITH_PKG= yes | WITH_PKG= yes | ||||
WITH_PKGNG= yes | WITH_PKGNG= yes | ||||
.if !defined(_OSRELEASE) | . if !defined(_OSRELEASE) | ||||
_OSRELEASE!= ${UNAME} -r | _OSRELEASE!= ${UNAME} -r | ||||
.endif | . endif | ||||
_EXPORTED_VARS+= _OSRELEASE | _EXPORTED_VARS+= _OSRELEASE | ||||
.if !defined(OSREL) | . if !defined(OSREL) | ||||
OSREL= ${_OSRELEASE:C/[-(].*//} | OSREL= ${_OSRELEASE:C/[-(].*//} | ||||
.endif | . endif | ||||
_EXPORTED_VARS+= OSREL | _EXPORTED_VARS+= OSREL | ||||
.if !defined(OPSYS) | . if !defined(OPSYS) | ||||
OPSYS!= ${UNAME} -s | OPSYS!= ${UNAME} -s | ||||
.endif | . endif | ||||
_EXPORTED_VARS+= OPSYS | _EXPORTED_VARS+= OPSYS | ||||
.if ${ARCH} == "amd64" | . if ${ARCH} == "amd64" | ||||
.if !defined(HAVE_COMPAT_IA32_KERN) | . if !defined(HAVE_COMPAT_IA32_KERN) | ||||
HAVE_COMPAT_IA32_KERN!= if ${SYSCTL} -n compat.ia32.maxvmem >/dev/null 2>&1; then echo YES; fi; echo | HAVE_COMPAT_IA32_KERN!= if ${SYSCTL} -n compat.ia32.maxvmem >/dev/null 2>&1; then echo YES; fi; echo | ||||
.if empty(HAVE_COMPAT_IA32_KERN) | . if empty(HAVE_COMPAT_IA32_KERN) | ||||
.undef HAVE_COMPAT_IA32_KERN | .undef HAVE_COMPAT_IA32_KERN | ||||
.endif | . endif | ||||
.endif | . endif | ||||
.endif | . endif | ||||
_EXPORTED_VARS+= HAVE_COMPAT_IA32_KERN | _EXPORTED_VARS+= HAVE_COMPAT_IA32_KERN | ||||
.if !defined(CONFIGURE_MAX_CMD_LEN) | . if !defined(CONFIGURE_MAX_CMD_LEN) | ||||
CONFIGURE_MAX_CMD_LEN!= ${SYSCTL} -n kern.argmax | CONFIGURE_MAX_CMD_LEN!= ${SYSCTL} -n kern.argmax | ||||
.endif | . endif | ||||
_EXPORTED_VARS+= CONFIGURE_MAX_CMD_LEN | _EXPORTED_VARS+= CONFIGURE_MAX_CMD_LEN | ||||
.if !defined(_JAVA_VERSION_LIST_REGEXP) | . if !defined(_JAVA_VERSION_LIST_REGEXP) | ||||
_JAVA_VERSION_LIST_REGEXP!= ${MAKE} -V _JAVA_VERSION_LIST_REGEXP USE_JAVA=1 -f ${PORTSDIR}/Mk/bsd.port.mk | _JAVA_VERSION_LIST_REGEXP!= ${MAKE} -V _JAVA_VERSION_LIST_REGEXP USE_JAVA=1 -f ${PORTSDIR}/Mk/bsd.port.mk | ||||
.endif | . endif | ||||
_EXPORTED_VARS+= _JAVA_VERSION_LIST_REGEXP | _EXPORTED_VARS+= _JAVA_VERSION_LIST_REGEXP | ||||
.if !defined(_JAVA_VENDOR_LIST_REGEXP) | . if !defined(_JAVA_VENDOR_LIST_REGEXP) | ||||
_JAVA_VENDOR_LIST_REGEXP!= ${MAKE} -V _JAVA_VENDOR_LIST_REGEXP USE_JAVA=1 -f ${PORTSDIR}/Mk/bsd.port.mk | _JAVA_VENDOR_LIST_REGEXP!= ${MAKE} -V _JAVA_VENDOR_LIST_REGEXP USE_JAVA=1 -f ${PORTSDIR}/Mk/bsd.port.mk | ||||
.endif | . endif | ||||
_EXPORTED_VARS+= _JAVA_VENDOR_LIST_REGEXP | _EXPORTED_VARS+= _JAVA_VENDOR_LIST_REGEXP | ||||
.if !defined(_JAVA_OS_LIST_REGEXP) | . if !defined(_JAVA_OS_LIST_REGEXP) | ||||
_JAVA_OS_LIST_REGEXP!= ${MAKE} -V _JAVA_OS_LIST_REGEXP USE_JAVA=1 -f ${PORTSDIR}/Mk/bsd.port.mk | _JAVA_OS_LIST_REGEXP!= ${MAKE} -V _JAVA_OS_LIST_REGEXP USE_JAVA=1 -f ${PORTSDIR}/Mk/bsd.port.mk | ||||
.endif | . endif | ||||
_EXPORTED_VARS+= _JAVA_OS_LIST_REGEXP | _EXPORTED_VARS+= _JAVA_OS_LIST_REGEXP | ||||
.if !defined(_JAVA_PORTS_INSTALLED) | . if !defined(_JAVA_PORTS_INSTALLED) | ||||
_JAVA_PORTS_INSTALLED!= ${MAKE} -V _JAVA_PORTS_INSTALLED USE_JAVA=1 -f ${PORTSDIR}/Mk/bsd.port.mk | _JAVA_PORTS_INSTALLED!= ${MAKE} -V _JAVA_PORTS_INSTALLED USE_JAVA=1 -f ${PORTSDIR}/Mk/bsd.port.mk | ||||
.endif | . endif | ||||
_EXPORTED_VARS+= _JAVA_PORTS_INSTALLED | _EXPORTED_VARS+= _JAVA_PORTS_INSTALLED | ||||
.if !defined(UID) | . if !defined(UID) | ||||
UID!= ${ID} -u | UID!= ${ID} -u | ||||
.endif | . endif | ||||
_EXPORTED_VARS+= UID | _EXPORTED_VARS+= UID | ||||
.endif | .endif | ||||
INDEXDIR?= ${PORTSDIR} | INDEXDIR?= ${PORTSDIR} | ||||
INDEXFILE?= INDEX-${OSVERSION:C/([0-9]*)[0-9]{5}/\1/} | INDEXFILE?= INDEX-${OSVERSION:C/([0-9]*)[0-9]{5}/\1/} | ||||
# local customization of the ports tree | # local customization of the ports tree | ||||
Show All 21 Lines | |||||
TARGETS+= maintainer | TARGETS+= maintainer | ||||
TARGETS+= package | TARGETS+= package | ||||
TARGETS+= package-recursive | TARGETS+= package-recursive | ||||
TARGETS+= realinstall | TARGETS+= realinstall | ||||
TARGETS+= reinstall | TARGETS+= reinstall | ||||
TARGETS+= tags | TARGETS+= tags | ||||
.for __target in ${TARGETS} | .for __target in ${TARGETS} | ||||
.if !target(${__target}) | . if !target(${__target}) | ||||
.if defined(SUBDIR) && !empty(SUBDIR) | . if defined(SUBDIR) && !empty(SUBDIR) | ||||
${__target}: ${SUBDIR:S/^/_/:S/$/.${__target}/} | ${__target}: ${SUBDIR:S/^/_/:S/$/.${__target}/} | ||||
.else | . else | ||||
${__target}: | ${__target}: | ||||
.endif | . endif | ||||
.endif | . endif | ||||
.endfor | .endfor | ||||
.if defined(SUBDIR) && !empty(SUBDIR) | .if defined(SUBDIR) && !empty(SUBDIR) | ||||
.for __target in ${TARGETS} checksubdirs describe readmes | . for __target in ${TARGETS} checksubdirs describe readmes | ||||
${SUBDIR:S/^/_/:S/$/.${__target}/}: _SUBDIRUSE | ${SUBDIR:S/^/_/:S/$/.${__target}/}: _SUBDIRUSE | ||||
.endfor | . endfor | ||||
_SUBDIRUSE: .USE | _SUBDIRUSE: .USE | ||||
@OK=""; sub=${.TARGET:S/^_//:R}; \ | @OK=""; sub=${.TARGET:S/^_//:R}; \ | ||||
for dud in $$DUDS; do \ | for dud in $$DUDS; do \ | ||||
if [ $${dud} = $$sub ]; then \ | if [ $${dud} = $$sub ]; then \ | ||||
OK="false"; \ | OK="false"; \ | ||||
${ECHO_MSG} "===> ${DIRPRFX}$$sub skipped"; \ | ${ECHO_MSG} "===> ${DIRPRFX}$$sub skipped"; \ | ||||
fi; \ | fi; \ | ||||
done; \ | done; \ | ||||
if test -d ${.CURDIR}/$${sub}.${MACHINE_ARCH}; then \ | if test -d ${.CURDIR}/$${sub}.${MACHINE_ARCH}; then \ | ||||
edir=$${sub}.${MACHINE_ARCH}; \ | edir=$${sub}.${MACHINE_ARCH}; \ | ||||
elif test -d ${.CURDIR}/$${sub}; then \ | elif test -d ${.CURDIR}/$${sub}; then \ | ||||
edir=$${sub}; \ | edir=$${sub}; \ | ||||
else \ | else \ | ||||
OK="false"; \ | OK="false"; \ | ||||
${ECHO_MSG} "===> ${DIRPRFX}$${sub} non-existent"; \ | ${ECHO_MSG} "===> ${DIRPRFX}$${sub} non-existent"; \ | ||||
fi; \ | fi; \ | ||||
if [ "$$OK" = "" ]; then \ | if [ "$$OK" = "" ]; then \ | ||||
${ECHO_MSG} "===> ${DIRPRFX}$${edir}"; \ | ${ECHO_MSG} "===> ${DIRPRFX}$${edir}"; \ | ||||
cd ${.CURDIR}/$${edir}; \ | cd ${.CURDIR}/$${edir}; \ | ||||
${MAKE} -B ${.TARGET:E:realinstall=install} \ | ${MAKE} -B ${.TARGET:E:realinstall=install} \ | ||||
DIRPRFX=${DIRPRFX}$$edir/; \ | DIRPRFX=${DIRPRFX}$$edir/; \ | ||||
fi | fi | ||||
.for _subdir in ${SUBDIR:S/^/_/} | . for _subdir in ${SUBDIR:S/^/_/} | ||||
${_subdir}:: ${_subdir:S/$/.all/} | ${_subdir}:: ${_subdir:S/$/.all/} | ||||
.endfor | . endfor | ||||
.endif | .endif | ||||
.if !target(install) | .if !target(install) | ||||
.if !target(beforeinstall) | . if !target(beforeinstall) | ||||
beforeinstall: | beforeinstall: | ||||
.endif | . endif | ||||
.if !target(afterinstall) | . if !target(afterinstall) | ||||
afterinstall: | afterinstall: | ||||
.endif | . endif | ||||
install: afterinstall | install: afterinstall | ||||
afterinstall: realinstall | afterinstall: realinstall | ||||
realinstall: beforeinstall ${SUBDIR:S/^/_/:S/$/.realinstall/} | realinstall: beforeinstall ${SUBDIR:S/^/_/:S/$/.realinstall/} | ||||
.endif | .endif | ||||
IGNOREDIR= Mk Templates Tools distfiles packages pkg Keywords | IGNOREDIR= Mk Templates Tools distfiles packages pkg Keywords | ||||
.if !target(checksubdirs) | .if !target(checksubdirs) | ||||
.if defined(PORTSTOP) | . if defined(PORTSTOP) | ||||
checksubdirs: checksubdir ${SUBDIR:S/^/_/:S/$/.checksubdirs/} | checksubdirs: checksubdir ${SUBDIR:S/^/_/:S/$/.checksubdirs/} | ||||
.else | . else | ||||
checksubdirs: checksubdir | checksubdirs: checksubdir | ||||
.endif | . endif | ||||
.endif | .endif | ||||
.if !target(checksubdir) | .if !target(checksubdir) | ||||
checksubdir: | checksubdir: | ||||
@for d in *; do \ | @for d in *; do \ | ||||
if [ -d "$$d" ]; then \ | if [ -d "$$d" ]; then \ | ||||
found=0; \ | found=0; \ | ||||
for s in ${SUBDIR} ${IGNOREDIR}; do \ | for s in ${SUBDIR} ${IGNOREDIR}; do \ | ||||
Show All 10 Lines | checksubdir: | ||||
@for s in ${SUBDIR}; do \ | @for s in ${SUBDIR}; do \ | ||||
if ! [ -d ${.CURDIR}/$$s ]; then \ | if ! [ -d ${.CURDIR}/$$s ]; then \ | ||||
${ECHO_MSG} "Warning: directory $$s in SUBDIR does not exist"; \ | ${ECHO_MSG} "Warning: directory $$s in SUBDIR does not exist"; \ | ||||
fi \ | fi \ | ||||
done | done | ||||
.endif | .endif | ||||
.if !target(describe) | .if !target(describe) | ||||
.if defined(PORTSTOP) | . if defined(PORTSTOP) | ||||
# This is a bit convoluted to deal with the fact that make will overlap I/O from child make processes | # This is a bit convoluted to deal with the fact that make will overlap I/O from child make processes | ||||
# if they write more than 2k: this will corrupt the INDEX file. make -P does not do this, but it adds | # if they write more than 2k: this will corrupt the INDEX file. make -P does not do this, but it adds | ||||
# extraneous output and redirects stderr, so we lose error reporting from child makes. Instead we have | # extraneous output and redirects stderr, so we lose error reporting from child makes. Instead we have | ||||
# to roll our own implementation of make -P and make sure that each child make writes to their own file, | # to roll our own implementation of make -P and make sure that each child make writes to their own file, | ||||
# which we will combine at the end. This gives substantial performance benefits over doing a make -j1 | # which we will combine at the end. This gives substantial performance benefits over doing a make -j1 | ||||
.if defined(BUILDING_INDEX) | . if defined(BUILDING_INDEX) | ||||
describe: ${SUBDIR:S/^/describe./} | describe: ${SUBDIR:S/^/describe./} | ||||
.for i in ${SUBDIR} | . for i in ${SUBDIR} | ||||
describe.$i: | describe.$i: | ||||
@cd ${.CURDIR}; ${MAKE} -B ${i:S/^/_/:S/$/.describe/} > ${INDEX_TMPDIR}/${INDEXFILE}.desc.${i} | @cd ${.CURDIR}; ${MAKE} -B ${i:S/^/_/:S/$/.describe/} > ${INDEX_TMPDIR}/${INDEXFILE}.desc.${i} | ||||
.endfor | . endfor | ||||
.else | . else | ||||
describe: ${SUBDIR:S/^/_/:S/$/.describe/} | describe: ${SUBDIR:S/^/_/:S/$/.describe/} | ||||
.endif | . endif | ||||
.else | . else | ||||
describe: | describe: | ||||
@for sub in ${SUBDIR}; do \ | @for sub in ${SUBDIR}; do \ | ||||
if ${TEST} -d ${.CURDIR}/$${sub}; then \ | if ${TEST} -d ${.CURDIR}/$${sub}; then \ | ||||
${ECHO_MSG} "===> ${DIRPRFX}$${sub}"; \ | ${ECHO_MSG} "===> ${DIRPRFX}$${sub}"; \ | ||||
cd ${.CURDIR}/$${sub}; \ | cd ${.CURDIR}/$${sub}; \ | ||||
${MAKE} -B describe || \ | ${MAKE} -B describe || \ | ||||
(${ECHO_CMD} "===> ${DIRPRFX}$${sub} failed" >&2; \ | (${ECHO_CMD} "===> ${DIRPRFX}$${sub} failed" >&2; \ | ||||
exit 1) ;\ | exit 1) ;\ | ||||
else \ | else \ | ||||
${ECHO_MSG} "===> ${DIRPRFX}$${sub} non-existent"; \ | ${ECHO_MSG} "===> ${DIRPRFX}$${sub} non-existent"; \ | ||||
fi; \ | fi; \ | ||||
done | done | ||||
.endif | . endif | ||||
.endif | .endif | ||||
.if !target(readmes) | .if !target(readmes) | ||||
.if defined(PORTSTOP) | . if defined(PORTSTOP) | ||||
readmes: readme ${SUBDIR:S/^/_/:S/$/.readmes/} | readmes: readme ${SUBDIR:S/^/_/:S/$/.readmes/} | ||||
@${ECHO_MSG} "===> Creating README.html for all ports" | @${ECHO_MSG} "===> Creating README.html for all ports" | ||||
@perl ${PORTSDIR}/Tools/make_readmes < ${INDEXDIR}/${INDEXFILE} | @perl ${PORTSDIR}/Tools/make_readmes < ${INDEXDIR}/${INDEXFILE} | ||||
.else | . else | ||||
readmes: readme | readmes: readme | ||||
.endif | . endif | ||||
.endif | .endif | ||||
.if !target(readme) | .if !target(readme) | ||||
readme: | readme: | ||||
@${RM} README.html | @${RM} README.html | ||||
@${MAKE} README.html | @${MAKE} README.html | ||||
.endif | .endif | ||||
HTMLIFY= ${SED} -e 's/&/\&/g' -e 's/>/\>/g' -e 's/</\</g' | HTMLIFY= ${SED} -e 's/&/\&/g' -e 's/>/\>/g' -e 's/</\</g' | ||||
package-name: | package-name: | ||||
@${ECHO_CMD} ${.CURDIR} | ${SED} -e 's^.*/^^' | @${ECHO_CMD} ${.CURDIR} | ${SED} -e 's^.*/^^' | ||||
README.html: | README.html: | ||||
@${ECHO_CMD} "===> Creating README.html" | @${ECHO_CMD} "===> Creating README.html" | ||||
@> $@.tmp | @> $@.tmp | ||||
.for entry in ${SUBDIR} | .for entry in ${SUBDIR} | ||||
.if exists(${entry}) | . if exists(${entry}) | ||||
.if defined(PORTSTOP) | . if defined(PORTSTOP) | ||||
@${ECHO_CMD} -n '<a href="'${entry}/README.html'">'"`${ECHO_CMD} ${entry} | ${HTMLIFY}`"'</a>: ' >> $@.tmp | @${ECHO_CMD} -n '<a href="'${entry}/README.html'">'"`${ECHO_CMD} ${entry} | ${HTMLIFY}`"'</a>: ' >> $@.tmp | ||||
.else | . else | ||||
@${ECHO_CMD} -n '<a href="'${entry}/README.html'">'"`cd ${entry}; ${MAKE} package-name | ${HTMLIFY}`</a>: " >> $@.tmp | @${ECHO_CMD} -n '<a href="'${entry}/README.html'">'"`cd ${entry}; ${MAKE} package-name | ${HTMLIFY}`</a>: " >> $@.tmp | ||||
.endif | . endif | ||||
@${ECHO_CMD} `cd ${entry}; ${MAKE} -V COMMENT` | ${HTMLIFY} >> $@.tmp | @${ECHO_CMD} `cd ${entry}; ${MAKE} -V COMMENT` | ${HTMLIFY} >> $@.tmp | ||||
.endif | . endif | ||||
.endfor | .endfor | ||||
@${SORT} -t '>' +1 -2 $@.tmp > $@.tmp2 | @${SORT} -t '>' +1 -2 $@.tmp > $@.tmp2 | ||||
.if exists(${DESCR}) | .if exists(${DESCR}) | ||||
@${HTMLIFY} ${DESCR} > $@.tmp3 | @${HTMLIFY} ${DESCR} > $@.tmp3 | ||||
.else | .else | ||||
@> $@.tmp3 | @> $@.tmp3 | ||||
.endif | .endif | ||||
.if defined(COMMENT) | .if defined(COMMENT) | ||||
Show All 9 Lines | ${SED} -e 's/%%CATEGORY%%/'"`basename ${.CURDIR}`"'/g' \ | ||||
-e '/%%DESCR%%/d' \ | -e '/%%DESCR%%/d' \ | ||||
-e '/%%SUBDIR%%/r$@.tmp2' \ | -e '/%%SUBDIR%%/r$@.tmp2' \ | ||||
-e '/%%SUBDIR%%/d' \ | -e '/%%SUBDIR%%/d' \ | ||||
> $@ | > $@ | ||||
@${RM} $@.tmp $@.tmp2 $@.tmp3 $@.tmp4 | @${RM} $@.tmp $@.tmp2 $@.tmp3 $@.tmp4 | ||||
# Pass in the cached invariant variables to child makes. | # Pass in the cached invariant variables to child makes. | ||||
.if !defined(NOPRECIOUSMAKEVARS) | .if !defined(NOPRECIOUSMAKEVARS) | ||||
.for var in ${_EXPORTED_VARS} | . for var in ${_EXPORTED_VARS} | ||||
.if empty(.MAKEFLAGS:M${var}=*) && !empty(${var}) | . if empty(.MAKEFLAGS:M${var}=*) && !empty(${var}) | ||||
.MAKEFLAGS: ${var}=${${var}:Q} | .MAKEFLAGS: ${var}=${${var}:Q} | ||||
.endif | . endif | ||||
.endfor | . endfor | ||||
.endif | .endif | ||||
PORTSEARCH_DISPLAY_FIELDS?=name,path,info,maint,index,bdeps,rdeps,www | PORTSEARCH_DISPLAY_FIELDS?=name,path,info,maint,index,bdeps,rdeps,www | ||||
PORTSEARCH_KEYLIM?=0 | PORTSEARCH_KEYLIM?=0 | ||||
PORTSEARCH_XKEYLIM?=0 | PORTSEARCH_XKEYLIM?=0 | ||||
PORTSEARCH_IGNORECASE?=1 | PORTSEARCH_IGNORECASE?=1 | ||||
PORTSEARCH_MOVED?=1 | PORTSEARCH_MOVED?=1 | ||||
▲ Show 20 Lines • Show All 147 Lines • Show Last 20 Lines |