diff options
author | jlam <jlam@pkgsrc.org> | 2006-07-05 06:09:15 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2006-07-05 06:09:15 +0000 |
commit | e31200b87c973f65d2a1f7c8949cc1891040e67e (patch) | |
tree | 5cda57cdca85b18146d681fc321900e0b05b7666 /mk/wrapper/bsd.wrapper.mk | |
parent | 00478b39e6c53023f76627af6ffacebafc9db9d6 (diff) | |
download | pkgsrc-e31200b87c973f65d2a1f7c8949cc1891040e67e.tar.gz |
Refactor configure, build, test and wrapper phases out of bsd.pkg.mk
and into their own directories. Also do some cleanups with build/_build
and pkginstall -- we get rid of _build and simply run pkginstall as
part of the "build" target.
Introduce a new mechanism to handle varying directory depths under
${WRKSRC} in which we find files to override, e.g. configure, config.*,
libtool, etc. OVERRIDE_DIRDEPTH is a package-settable variable that
specifies how far under ${WRKSRC} the various targets should look,
and it defaults to "2". We preserve the
meaning of the various *_OVERRIDE variables, so if they are defined,
then their values supersede the OVERRIDE_DIRDEPTH mechanism.
devel/tla will need to specially set OVERRIDE_DIRDEPTH to 3 (see log
for revision 1.1857 for bsd.pkg.mk -- to be done in a separate commit.
Diffstat (limited to 'mk/wrapper/bsd.wrapper.mk')
-rw-r--r-- | mk/wrapper/bsd.wrapper.mk | 67 |
1 files changed, 59 insertions, 8 deletions
diff --git a/mk/wrapper/bsd.wrapper.mk b/mk/wrapper/bsd.wrapper.mk index c70d393ca2f..cf76bc799ef 100644 --- a/mk/wrapper/bsd.wrapper.mk +++ b/mk/wrapper/bsd.wrapper.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.wrapper.mk,v 1.42 2006/07/05 04:32:10 jlam Exp $ +# $NetBSD: bsd.wrapper.mk,v 1.43 2006/07/05 06:09:15 jlam Exp $ # # Copyright (c) 2005 The NetBSD Foundation, Inc. # All rights reserved. @@ -45,7 +45,7 @@ ECHO_WRAPPER_MSG?= ${ECHO} ECHO_WRAPPER_MSG?= ${TRUE} .endif -.PHONY: do-wrapper +.PHONY: generate-wrappers .include "../../mk/buildlink3/bsd.buildlink3.mk" @@ -192,7 +192,7 @@ _WRAP_UNTRANSFORM_SEDFILE?= ${WRAPPER_TMPDIR}/untransform.sed # Generate the transformation sedfiles if we need them. .if !empty(_WRAP_TRANSFORM_CMDS) -do-wrapper: ${_WRAP_TRANSFORM_SEDFILE} ${_WRAP_UNTRANSFORM_SEDFILE} +generate-wrappers: ${_WRAP_TRANSFORM_SEDFILE} ${_WRAP_UNTRANSFORM_SEDFILE} _WRAP_TRANSFORM_SED+= -f ${_WRAP_TRANSFORM_SEDFILE} _UNWRAP_SED= -f ${_WRAP_UNTRANSFORM_SEDFILE} .endif @@ -377,7 +377,7 @@ _WRAP_COOKIE.${_wrappee_}= ${WRAPPER_DIR}/.wrapper_${_wrappee_}_done .for _wrappee_ in ${_WRAPPEES_UNIQUE} PKG_${_wrappee_}?= ${${_wrappee_}} -do-wrapper: ${_WRAP_COOKIE.${_wrappee_}} +generate-wrappers: ${_WRAP_COOKIE.${_wrappee_}} ${_WRAP_COOKIE.${_wrappee_}}: \ ${_WRAPPER_SH.${_wrappee_}} \ ${_WRAP_ARG_PP.${_wrappee_}} \ @@ -417,7 +417,7 @@ ${_WRAP_COOKIE.${_wrappee_}}: \ IFS="$$save_IFS"; \ if ${TEST} ! -x "$$wrappee"; then \ gen_wrapper=no; \ - ${ECHO_WRAPPER_MSG} "Warning: unable to create ${_wrappee_} wrapper script: \`$$wrappee'"; \ + ${ECHO_WRAPPER_MSG} "Warning: unable to generate ${_wrappee_} wrapper script: \`$$wrappee'"; \ fi; \ ;; \ esac; \ @@ -436,7 +436,7 @@ ${_WRAP_COOKIE.${_wrappee_}}: \ . for _alias_ in ${_WRAP_ALIASES.${_wrappee_}:S/^/${WRAPPER_BINDIR}\//} . if !target(${_alias_}) -do-wrapper: ${_alias_} +generate-wrappers: ${_alias_} ${_alias_}: ${_WRAP_COOKIE.${_wrappee_}} ${_PKG_SILENT}${_PKG_DEBUG} \ wrapper="${WRAPPER_${_wrappee_}:C/^/_asdf_/1:M_asdf_*:S/^_asdf_//}"; \ @@ -449,7 +449,7 @@ ${_alias_}: ${_WRAP_COOKIE.${_wrappee_}} .endfor # _WRAPPEES_UNIQUE .for _target_ in ${WRAPPER_TARGETS} -do-wrapper: ${_target_} +generate-wrappers: ${_target_} .endfor ${WRAPPER_TMPDIR}/transform-solaris-gcc: \ @@ -769,7 +769,58 @@ SUBST_POSTCMD.unwrap= ${DO_NADA} ### END: after "wrapper" phase ### +###################################################################### +###################################################################### +###################################################################### + +_WRAPPER_COOKIE= ${WRKDIR}/.wrapper_done + +.PHONY: wrapper +.if !target(wrapper) +. if defined(NO_BUILD) +wrapper: patch wrapper-cookie +. else +wrapper: patch acquire-wrapper-lock ${_WRAPPER_COOKIE} release-wrapper-lock +. endif +.endif + +.PHONY: acquire-wrapper-lock release-wrapper-lock +acquire-wrapper-lock: acquire-lock +release-wrapper-lock: release-lock + +.if !exists(${_WRAPPER_COOKIE}) +${_WRAPPER_COOKIE}: + ${_PKG_SILENT}${_PKG_DEBUG}cd ${.CURDIR} && ${SETENV} ${BUILD_ENV} ${MAKE} ${MAKEFLAGS} real-wrapper PKG_PHASE=wrapper +.else +${_WRAPPER_COOKIE}: + @${DO_NADA} +.endif + +.PHONY: real-wrapper +real-wrapper: wrapper-message wrapper-vars pre-wrapper do-wrapper post-wrapper wrapper-cookie error-check + +.PHONY: wrapper-message +wrapper-message: + @${PHASE_MSG} "Creating toolchain wrappers for ${PKGNAME}" + +.PHONY: pre-wrapper do-wrapper post-wrapper + .if !target(do-wrapper) -do-wrapper: +do-wrapper: generate-wrappers + @${DO_NADA} +.endif + +.if !target(pre-wrapper) +pre-wrapper: @${DO_NADA} .endif + +.if !target(post-wrapper) +post-wrapper: + @${DO_NADA} +.endif + +.PHONY: wrapper-cookie +wrapper-cookie: + ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${_WRAPPER_COOKIE:H} + ${_PKG_SILENT}${_PKG_DEBUG}${ECHO} ${PKGNAME} >> ${_WRAPPER_COOKIE} |