2010-02-24 23:53:34 +01:00
|
|
|
# $NetBSD: bsd.pkg.barrier.mk,v 1.18 2010/02/24 22:53:34 joerg Exp $
|
Flatten out recursive makes into a single re-invocation of make by
introducing the concept of a "barrier". We separate the user-invokable
targets into ones that must happen before the barrier, and ones that
must happen after the barrier. The ones that happen after the barrier
are run in a sub-make process. In this case, the targets that must
be run after the barrier are from the "wrapper" step and beyond. We
rewrite the various "flow" targets, e.g. wrapper, configure, build,
etc., so that they of the right form to use the barrier target.
This now completely removes the concept of PKG_PHASE from pkgsrc. It
is replaced with the concept of "before" and "after" the barrier, and
this state can be checked by testing for the existence of the barrier
cookie file. Because we've removed most of the recursive makes, there
is now nowhere to hook the PKG_ERROR_HANDLER.* commands, so remove
them for now.
As part of this commit, put back the logic that conditionalized the
sources for the various cookie files. Because the sources are all
"phony" targets, they were always run, regardless of whether or not
the cookie file already existed. Now, if a cookie file exists, then
that entire phase associated with that cookie file is skipped.
Lastly, fix a thinko in configure/bsd.configure.mk where setting
NO_CONFIGURE in a package Makefile would manage to skip the "wrapper"
step altogether. Fix this by correctly noting "wrapper" and not
"patch" as the preceding step to "configure".
2006-07-06 00:21:02 +02:00
|
|
|
|
2006-07-07 23:24:27 +02:00
|
|
|
_COOKIE.barrier= ${WRKDIR}/.barrier_cookie
|
Flatten out recursive makes into a single re-invocation of make by
introducing the concept of a "barrier". We separate the user-invokable
targets into ones that must happen before the barrier, and ones that
must happen after the barrier. The ones that happen after the barrier
are run in a sub-make process. In this case, the targets that must
be run after the barrier are from the "wrapper" step and beyond. We
rewrite the various "flow" targets, e.g. wrapper, configure, build,
etc., so that they of the right form to use the barrier target.
This now completely removes the concept of PKG_PHASE from pkgsrc. It
is replaced with the concept of "before" and "after" the barrier, and
this state can be checked by testing for the existence of the barrier
cookie file. Because we've removed most of the recursive makes, there
is now nowhere to hook the PKG_ERROR_HANDLER.* commands, so remove
them for now.
As part of this commit, put back the logic that conditionalized the
sources for the various cookie files. Because the sources are all
"phony" targets, they were always run, regardless of whether or not
the cookie file already existed. Now, if a cookie file exists, then
that entire phase associated with that cookie file is skipped.
Lastly, fix a thinko in configure/bsd.configure.mk where setting
NO_CONFIGURE in a package Makefile would manage to skip the "wrapper"
step altogether. Fix this by correctly noting "wrapper" and not
"patch" as the preceding step to "configure".
2006-07-06 00:21:02 +02:00
|
|
|
|
2006-07-06 17:33:19 +02:00
|
|
|
# _BARRIER_PRE_TARGETS is a list of the targets that must be built before
|
Flatten out recursive makes into a single re-invocation of make by
introducing the concept of a "barrier". We separate the user-invokable
targets into ones that must happen before the barrier, and ones that
must happen after the barrier. The ones that happen after the barrier
are run in a sub-make process. In this case, the targets that must
be run after the barrier are from the "wrapper" step and beyond. We
rewrite the various "flow" targets, e.g. wrapper, configure, build,
etc., so that they of the right form to use the barrier target.
This now completely removes the concept of PKG_PHASE from pkgsrc. It
is replaced with the concept of "before" and "after" the barrier, and
this state can be checked by testing for the existence of the barrier
cookie file. Because we've removed most of the recursive makes, there
is now nowhere to hook the PKG_ERROR_HANDLER.* commands, so remove
them for now.
As part of this commit, put back the logic that conditionalized the
sources for the various cookie files. Because the sources are all
"phony" targets, they were always run, regardless of whether or not
the cookie file already existed. Now, if a cookie file exists, then
that entire phase associated with that cookie file is skipped.
Lastly, fix a thinko in configure/bsd.configure.mk where setting
NO_CONFIGURE in a package Makefile would manage to skip the "wrapper"
step altogether. Fix this by correctly noting "wrapper" and not
"patch" as the preceding step to "configure".
2006-07-06 00:21:02 +02:00
|
|
|
# the "barrier" target invokes a new make.
|
|
|
|
#
|
2007-08-31 18:30:11 +02:00
|
|
|
_BARRIER_PRE_TARGETS= checksum-phase makedirs depends
|
Flatten out recursive makes into a single re-invocation of make by
introducing the concept of a "barrier". We separate the user-invokable
targets into ones that must happen before the barrier, and ones that
must happen after the barrier. The ones that happen after the barrier
are run in a sub-make process. In this case, the targets that must
be run after the barrier are from the "wrapper" step and beyond. We
rewrite the various "flow" targets, e.g. wrapper, configure, build,
etc., so that they of the right form to use the barrier target.
This now completely removes the concept of PKG_PHASE from pkgsrc. It
is replaced with the concept of "before" and "after" the barrier, and
this state can be checked by testing for the existence of the barrier
cookie file. Because we've removed most of the recursive makes, there
is now nowhere to hook the PKG_ERROR_HANDLER.* commands, so remove
them for now.
As part of this commit, put back the logic that conditionalized the
sources for the various cookie files. Because the sources are all
"phony" targets, they were always run, regardless of whether or not
the cookie file already existed. Now, if a cookie file exists, then
that entire phase associated with that cookie file is skipped.
Lastly, fix a thinko in configure/bsd.configure.mk where setting
NO_CONFIGURE in a package Makefile would manage to skip the "wrapper"
step altogether. Fix this by correctly noting "wrapper" and not
"patch" as the preceding step to "configure".
2006-07-06 00:21:02 +02:00
|
|
|
|
2006-07-06 17:33:19 +02:00
|
|
|
# _BARRIER_POST_TARGETS is a list of the targets that must be built after
|
|
|
|
# the "barrier" target invokes a new make. This list is specially
|
|
|
|
# ordered so that if more than one is specified on the command-line,
|
|
|
|
# then pkgsrc will still do the right thing.
|
Flatten out recursive makes into a single re-invocation of make by
introducing the concept of a "barrier". We separate the user-invokable
targets into ones that must happen before the barrier, and ones that
must happen after the barrier. The ones that happen after the barrier
are run in a sub-make process. In this case, the targets that must
be run after the barrier are from the "wrapper" step and beyond. We
rewrite the various "flow" targets, e.g. wrapper, configure, build,
etc., so that they of the right form to use the barrier target.
This now completely removes the concept of PKG_PHASE from pkgsrc. It
is replaced with the concept of "before" and "after" the barrier, and
this state can be checked by testing for the existence of the barrier
cookie file. Because we've removed most of the recursive makes, there
is now nowhere to hook the PKG_ERROR_HANDLER.* commands, so remove
them for now.
As part of this commit, put back the logic that conditionalized the
sources for the various cookie files. Because the sources are all
"phony" targets, they were always run, regardless of whether or not
the cookie file already existed. Now, if a cookie file exists, then
that entire phase associated with that cookie file is skipped.
Lastly, fix a thinko in configure/bsd.configure.mk where setting
NO_CONFIGURE in a package Makefile would manage to skip the "wrapper"
step altogether. Fix this by correctly noting "wrapper" and not
"patch" as the preceding step to "configure".
2006-07-06 00:21:02 +02:00
|
|
|
#
|
2006-10-06 21:04:37 +02:00
|
|
|
|
|
|
|
# FIXME: why is wrapper before extract?
|
2006-07-25 20:04:25 +02:00
|
|
|
_BARRIER_POST_TARGETS= tools
|
|
|
|
_BARRIER_POST_TARGETS+= wrapper
|
2006-07-21 16:21:28 +02:00
|
|
|
_BARRIER_POST_TARGETS+= extract
|
|
|
|
_BARRIER_POST_TARGETS+= patch
|
2006-07-06 17:33:19 +02:00
|
|
|
_BARRIER_POST_TARGETS+= configure
|
2007-11-30 19:54:40 +01:00
|
|
|
_BARRIER_POST_TARGETS+= build build-env
|
Flatten out recursive makes into a single re-invocation of make by
introducing the concept of a "barrier". We separate the user-invokable
targets into ones that must happen before the barrier, and ones that
must happen after the barrier. The ones that happen after the barrier
are run in a sub-make process. In this case, the targets that must
be run after the barrier are from the "wrapper" step and beyond. We
rewrite the various "flow" targets, e.g. wrapper, configure, build,
etc., so that they of the right form to use the barrier target.
This now completely removes the concept of PKG_PHASE from pkgsrc. It
is replaced with the concept of "before" and "after" the barrier, and
this state can be checked by testing for the existence of the barrier
cookie file. Because we've removed most of the recursive makes, there
is now nowhere to hook the PKG_ERROR_HANDLER.* commands, so remove
them for now.
As part of this commit, put back the logic that conditionalized the
sources for the various cookie files. Because the sources are all
"phony" targets, they were always run, regardless of whether or not
the cookie file already existed. Now, if a cookie file exists, then
that entire phase associated with that cookie file is skipped.
Lastly, fix a thinko in configure/bsd.configure.mk where setting
NO_CONFIGURE in a package Makefile would manage to skip the "wrapper"
step altogether. Fix this by correctly noting "wrapper" and not
"patch" as the preceding step to "configure".
2006-07-06 00:21:02 +02:00
|
|
|
_BARRIER_POST_TARGETS+= test
|
2006-07-06 17:43:10 +02:00
|
|
|
_BARRIER_POST_TARGETS+= all
|
2010-02-24 23:53:34 +01:00
|
|
|
_BARRIER_POST_TARGETS+= stage-install
|
2006-07-06 17:33:19 +02:00
|
|
|
_BARRIER_POST_TARGETS+= reinstall
|
2006-07-07 00:08:32 +02:00
|
|
|
_BARRIER_POST_TARGETS+= replace
|
2006-07-06 17:33:19 +02:00
|
|
|
_BARRIER_POST_TARGETS+= package
|
|
|
|
_BARRIER_POST_TARGETS+= repackage
|
2006-11-03 09:01:04 +01:00
|
|
|
_BARRIER_POST_TARGETS+= package-install
|
2010-02-24 23:53:34 +01:00
|
|
|
_BARRIER_POST_TARGETS+= install
|
2006-07-06 17:33:19 +02:00
|
|
|
|
|
|
|
.for _target_ in ${_BARRIER_POST_TARGETS}
|
|
|
|
. if make(${_target_})
|
|
|
|
_BARRIER_CMDLINE_TARGETS+= ${_target_}
|
|
|
|
. endif
|
|
|
|
.endfor
|
|
|
|
|
Flatten out recursive makes into a single re-invocation of make by
introducing the concept of a "barrier". We separate the user-invokable
targets into ones that must happen before the barrier, and ones that
must happen after the barrier. The ones that happen after the barrier
are run in a sub-make process. In this case, the targets that must
be run after the barrier are from the "wrapper" step and beyond. We
rewrite the various "flow" targets, e.g. wrapper, configure, build,
etc., so that they of the right form to use the barrier target.
This now completely removes the concept of PKG_PHASE from pkgsrc. It
is replaced with the concept of "before" and "after" the barrier, and
this state can be checked by testing for the existence of the barrier
cookie file. Because we've removed most of the recursive makes, there
is now nowhere to hook the PKG_ERROR_HANDLER.* commands, so remove
them for now.
As part of this commit, put back the logic that conditionalized the
sources for the various cookie files. Because the sources are all
"phony" targets, they were always run, regardless of whether or not
the cookie file already existed. Now, if a cookie file exists, then
that entire phase associated with that cookie file is skipped.
Lastly, fix a thinko in configure/bsd.configure.mk where setting
NO_CONFIGURE in a package Makefile would manage to skip the "wrapper"
step altogether. Fix this by correctly noting "wrapper" and not
"patch" as the preceding step to "configure".
2006-07-06 00:21:02 +02:00
|
|
|
######################################################################
|
|
|
|
### barrier (PRIVATE)
|
|
|
|
######################################################################
|
|
|
|
### barrier is a helper target that can be used to separate targets
|
|
|
|
### that should be built in a new make process from being built in
|
|
|
|
### the current one. The targets that must be built after the "barrier"
|
|
|
|
### target invokes a new make should be listed in _BARRIER_POST_TARGETS,
|
|
|
|
### and should be of the form:
|
|
|
|
###
|
2006-07-22 18:31:35 +02:00
|
|
|
### .if !defined(_PKGSRC_BARRIER)
|
Flatten out recursive makes into a single re-invocation of make by
introducing the concept of a "barrier". We separate the user-invokable
targets into ones that must happen before the barrier, and ones that
must happen after the barrier. The ones that happen after the barrier
are run in a sub-make process. In this case, the targets that must
be run after the barrier are from the "wrapper" step and beyond. We
rewrite the various "flow" targets, e.g. wrapper, configure, build,
etc., so that they of the right form to use the barrier target.
This now completely removes the concept of PKG_PHASE from pkgsrc. It
is replaced with the concept of "before" and "after" the barrier, and
this state can be checked by testing for the existence of the barrier
cookie file. Because we've removed most of the recursive makes, there
is now nowhere to hook the PKG_ERROR_HANDLER.* commands, so remove
them for now.
As part of this commit, put back the logic that conditionalized the
sources for the various cookie files. Because the sources are all
"phony" targets, they were always run, regardless of whether or not
the cookie file already existed. Now, if a cookie file exists, then
that entire phase associated with that cookie file is skipped.
Lastly, fix a thinko in configure/bsd.configure.mk where setting
NO_CONFIGURE in a package Makefile would manage to skip the "wrapper"
step altogether. Fix this by correctly noting "wrapper" and not
"patch" as the preceding step to "configure".
2006-07-06 00:21:02 +02:00
|
|
|
### foo: barrier
|
|
|
|
### .else
|
|
|
|
### foo: foo's real source dependencies
|
|
|
|
### .endif
|
|
|
|
###
|
|
|
|
### Note that none of foo's real source dependencies should include
|
|
|
|
### targets that occur before the barrier.
|
|
|
|
###
|
2006-07-06 17:33:19 +02:00
|
|
|
|
2006-10-06 21:04:37 +02:00
|
|
|
.PHONY: barrier-error-check
|
|
|
|
barrier-error-check: error-check
|
|
|
|
|
Flatten out recursive makes into a single re-invocation of make by
introducing the concept of a "barrier". We separate the user-invokable
targets into ones that must happen before the barrier, and ones that
must happen after the barrier. The ones that happen after the barrier
are run in a sub-make process. In this case, the targets that must
be run after the barrier are from the "wrapper" step and beyond. We
rewrite the various "flow" targets, e.g. wrapper, configure, build,
etc., so that they of the right form to use the barrier target.
This now completely removes the concept of PKG_PHASE from pkgsrc. It
is replaced with the concept of "before" and "after" the barrier, and
this state can be checked by testing for the existence of the barrier
cookie file. Because we've removed most of the recursive makes, there
is now nowhere to hook the PKG_ERROR_HANDLER.* commands, so remove
them for now.
As part of this commit, put back the logic that conditionalized the
sources for the various cookie files. Because the sources are all
"phony" targets, they were always run, regardless of whether or not
the cookie file already existed. Now, if a cookie file exists, then
that entire phase associated with that cookie file is skipped.
Lastly, fix a thinko in configure/bsd.configure.mk where setting
NO_CONFIGURE in a package Makefile would manage to skip the "wrapper"
step altogether. Fix this by correctly noting "wrapper" and not
"patch" as the preceding step to "configure".
2006-07-06 00:21:02 +02:00
|
|
|
.PHONY: barrier
|
2006-07-07 23:24:27 +02:00
|
|
|
barrier: ${_BARRIER_PRE_TARGETS} ${_COOKIE.barrier}
|
2006-07-22 18:31:35 +02:00
|
|
|
.if !defined(_PKGSRC_BARRIER)
|
2006-07-06 17:33:19 +02:00
|
|
|
. if defined(PKG_VERBOSE)
|
|
|
|
@${PHASE_MSG} "Invoking \`\`"${_BARRIER_CMDLINE_TARGETS:Q}"'' after barrier for ${PKGNAME}"
|
|
|
|
. endif
|
2008-02-07 22:36:13 +01:00
|
|
|
${RUN} \
|
2009-05-16 03:27:30 +02:00
|
|
|
if ${TEST} -n "${_PKGSRC_UPDATE_CHECK}" && \
|
|
|
|
${PKG_INFO} -qe ${PKGNAME}; then \
|
|
|
|
${PHASE_MSG} "Skipping installation of already handled package"; \
|
|
|
|
else \
|
2006-10-06 21:04:37 +02:00
|
|
|
cd ${.CURDIR} \
|
|
|
|
&& ${RECURSIVE_MAKE} ${MAKEFLAGS} _PKGSRC_BARRIER=yes ALLOW_VULNERABLE_PACKAGES= ${_BARRIER_CMDLINE_TARGETS} \
|
|
|
|
|| { \
|
|
|
|
exitcode="$$?"; \
|
|
|
|
${RECURSIVE_MAKE} ${MAKEFLAGS} _PKGSRC_BARRIER=yes barrier-error-check; \
|
|
|
|
exit "$$exitcode"; \
|
2009-05-16 03:27:30 +02:00
|
|
|
}; \
|
|
|
|
fi
|
2006-07-06 17:33:19 +02:00
|
|
|
. if defined(PKG_VERBOSE)
|
|
|
|
@${PHASE_MSG} "Leaving \`\`"${_BARRIER_CMDLINE_TARGETS:Q}"'' after barrier for ${PKGNAME}"
|
|
|
|
. endif
|
Flatten out recursive makes into a single re-invocation of make by
introducing the concept of a "barrier". We separate the user-invokable
targets into ones that must happen before the barrier, and ones that
must happen after the barrier. The ones that happen after the barrier
are run in a sub-make process. In this case, the targets that must
be run after the barrier are from the "wrapper" step and beyond. We
rewrite the various "flow" targets, e.g. wrapper, configure, build,
etc., so that they of the right form to use the barrier target.
This now completely removes the concept of PKG_PHASE from pkgsrc. It
is replaced with the concept of "before" and "after" the barrier, and
this state can be checked by testing for the existence of the barrier
cookie file. Because we've removed most of the recursive makes, there
is now nowhere to hook the PKG_ERROR_HANDLER.* commands, so remove
them for now.
As part of this commit, put back the logic that conditionalized the
sources for the various cookie files. Because the sources are all
"phony" targets, they were always run, regardless of whether or not
the cookie file already existed. Now, if a cookie file exists, then
that entire phase associated with that cookie file is skipped.
Lastly, fix a thinko in configure/bsd.configure.mk where setting
NO_CONFIGURE in a package Makefile would manage to skip the "wrapper"
step altogether. Fix this by correctly noting "wrapper" and not
"patch" as the preceding step to "configure".
2006-07-06 00:21:02 +02:00
|
|
|
.endif
|
|
|
|
|
|
|
|
######################################################################
|
|
|
|
### barrier-cookie (PRIVATE)
|
|
|
|
######################################################################
|
|
|
|
### barrier-cookie creates the "barrier" cookie file.
|
|
|
|
###
|
2006-07-07 23:24:27 +02:00
|
|
|
${_COOKIE.barrier}:
|
2008-02-07 22:36:13 +01:00
|
|
|
${RUN}${MKDIR} ${.TARGET:H}
|
|
|
|
${RUN}${ECHO} ${PKGNAME} > ${.TARGET}
|