diff options
author | asami <asami@FreeBSD.org> | 1998-10-30 08:28:02 +0000 |
---|---|---|
committer | asami <asami@FreeBSD.org> | 1998-10-30 08:28:02 +0000 |
commit | 31c8a98d46ace56ccd07e6e55f03a88b933b30a5 (patch) | |
tree | 22143fd96c21d3c678c6c67c03e049a7e7a1f162 /share | |
parent | d53d7e4461b7295b7ca941b9959533d0d6e32e19 (diff) | |
download | FreeBSD-src-31c8a98d46ace56ccd07e6e55f03a88b933b30a5.zip FreeBSD-src-31c8a98d46ace56ccd07e6e55f03a88b933b30a5.tar.gz |
(1) Add new variables LOOP_VAR and LOOP_OPTIONS to implement building several
packages from a single port. LOOP_VAR is the name of the variable
and LOOP_OPTIONS is a space-separated list of values it should
take. When these are set, the target "package-loop" will go
through a clean and package loop for all the options. The
"package-loop" target is defined as "package" when LOOP_VAR is not
defined, so if you are in the business for building packages, you
should use "package-loop" all the time. (This target is added to
bsd.port.subdir.mk too.)
Also, the "describe" target prints out multiple lines so that all
options will go into the INDEX. (In other words, if you define
these variables, INDEX is going to look real silly if you don't
put ${${LOOP_VAR}} in PKGNAME.)
Seconded by: obrien ("ANYTHING")
(2) Turn off regexp support for LIB_DEPENDS. It is a fixed string of
the form <NAME>.<VER> now.
Tested by: several rounds of complete package builds
(3) Check checksum even if NO_EXTRACT is defined.
(4) Cosmetic fix for message in MANUAL_PACKAGE_BUILD case.
Diffstat (limited to 'share')
-rw-r--r-- | share/mk/bsd.port.mk | 55 | ||||
-rw-r--r-- | share/mk/bsd.port.subdir.mk | 6 |
2 files changed, 54 insertions, 7 deletions
diff --git a/share/mk/bsd.port.mk b/share/mk/bsd.port.mk index 39eafd6..c16fcd4 100644 --- a/share/mk/bsd.port.mk +++ b/share/mk/bsd.port.mk @@ -1,7 +1,7 @@ #-*- mode: Fundamental; tab-width: 4; -*- # ex:ts=4 # -# $Id: bsd.port.mk,v 1.292 1998/10/06 21:12:14 asami Exp $ +# $Id: bsd.port.mk,v 1.293 1998/10/09 01:27:21 asami Exp $ # $NetBSD: $ # # bsd.port.mk - 940820 Jordan K. Hubbard. @@ -246,6 +246,18 @@ OpenBSD_MAINTAINER= imp@OpenBSD.ORG # is set and NO_INSTALL_MANPAGES is not set, and # "no" otherwise. # +# If your port wants the package to be built with several options, +# set the following variables. +# +# LOOP_VAR - The name of the variable. +# LOOP_OPTIONS - The value of the options. +# +# If they are set, there will be a target "package-loop" which will +# iterate several times, each time cleaning up afterwards, with the +# value of ${LOOP_VAR} set to one of ${LOOP_OPTIONS}. In addition, +# the "describe" target will print out multiple lines with the variable +# set accordingly. +# # Default targets and their behaviors: # # fetch - Retrieves ${DISTFILES} (and ${PATCHFILES} if defined) @@ -1034,7 +1046,7 @@ IGNORE= "is marked as broken: ${BROKEN}" .endif .if (defined(MANUAL_PACKAGE_BUILD) && defined(PACKAGE_BUILDING)) -IGNORE= "package has to be built manually: ${MANUAL_PACKAGE_BUILD}" +IGNORE= "has to be built manually: ${MANUAL_PACKAGE_BUILD}" clean: @${IGNORECMD} .endif @@ -1109,6 +1121,7 @@ checksum: fetch # Disable extract .if defined(NO_EXTRACT) && !target(extract) extract: fetch + @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} checksum REAL_EXTRACT=yes @${TOUCH} ${TOUCH_FLAGS} ${EXTRACT_COOKIE} .endif @@ -1761,6 +1774,26 @@ package-noinstall: @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} PACKAGE_NOINSTALL=yes real-package .endif +# Loop through several options for package building + +.if !target(package-loop) +.if defined(LOOP_VAR) +package-loop: +.if !exists(${PACKAGE_COOKIE}) +.for option in ${LOOP_OPTIONS} + @cd ${.CURDIR} && ${SETENV} ${LOOP_VAR}=${option} LOOP=yes \ + ${MAKE} ${.MAKEFLAGS} clean + @cd ${.CURDIR} && ${SETENV} ${LOOP_VAR}=${option} LOOP=yes \ + ${MAKE} ${.MAKEFLAGS} package +.endfor +.else + @${DO_NADA} +.endif +.else +package-loop: package +.endif +.endif + ################################################################ # Dependency checking ################################################################ @@ -1843,7 +1876,7 @@ lib-depends: else \ target=${DEPENDS_TARGET}; \ fi; \ - if ${LDCONFIG} -r | ${GREP} -q -e "-l$$lib"; then \ + if ${LDCONFIG} -r | ${GREP} -qwF -e "-l$$lib"; then \ ${ECHO_MSG} "===> ${PKGNAME} depends on shared library: $$lib - found"; \ else \ ${ECHO_MSG} "===> ${PKGNAME} depends on shared library: $$lib - not found"; \ @@ -1853,7 +1886,7 @@ lib-depends: else \ (cd $$dir; ${MAKE} ${.MAKEFLAGS} $$target) ; \ ${ECHO_MSG} "===> Returning to build of ${PKGNAME}"; \ - if ${LDCONFIG} -r | ${GREP} -q -e "-l$$lib"; then \ + if ${LDCONFIG} -r | ${GREP} -qwF -e "-l$$lib"; then \ ${TRUE}; \ else \ ${ECHO_MSG} "Error: shared library \"$$lib\" does not exist"; \ @@ -1934,8 +1967,22 @@ depends-list: # distribution-name|port-path|installation-prefix|comment| \ # description-file|maintainer|categories|build deps|run deps # +# If LOOP_VAR is set, multiple lines will be printed with the +# variable set to each value of LOOP_OPTIONS. + .if !target(describe) describe: +.if !defined(LOOP_VAR) + @cd ${.CURDIR} && ${MAKE} do-describe +.else +.for option in ${LOOP_OPTIONS} + @cd ${.CURDIR} && ${SETENV} ${LOOP_VAR}=${option} ${MAKE} do-describe +.endfor +.endif +.endif + +.if !target(do-describe) +do-describe: @${ECHO} -n "${PKGNAME}|${.CURDIR}|"; \ ${ECHO} -n "${PREFIX}|"; \ if [ -f ${COMMENT} ]; then \ diff --git a/share/mk/bsd.port.subdir.mk b/share/mk/bsd.port.subdir.mk index 72a97b2..ba16c9e 100644 --- a/share/mk/bsd.port.subdir.mk +++ b/share/mk/bsd.port.subdir.mk @@ -1,5 +1,5 @@ # from: @(#)bsd.subdir.mk 5.9 (Berkeley) 2/1/91 -# $Id: bsd.port.subdir.mk,v 1.23 1997/11/20 05:31:44 asami Exp $ +# $Id: bsd.port.subdir.mk,v 1.24 1998/08/26 23:46:13 asami Exp $ # # The include file <bsd.port.subdir.mk> contains the default targets # for building ports subdirectories. @@ -29,7 +29,7 @@ # # afterinstall, all, beforeinstall, build, checksum, clean, # configure, deinstall, depend, describe, extract, fetch, fetch-list, -# install, package, readmes, realinstall, reinstall, tags +# install, package, package-loop, readmes, realinstall, reinstall, tags # @@ -78,7 +78,7 @@ ${SUBDIR}:: fi; \ ${MAKE} all -.for __target in all fetch fetch-list package extract configure \ +.for __target in all fetch fetch-list package package-loop extract configure \ build clean deinstall depend describe distclean \ reinstall tags checksum .if !target(${__target}) |