1 # $NetBSD: bsd.pkg.barrier.mk,v 1.15 2007/11/30 18:54:40 rillig Exp $
3 _COOKIE.barrier= ${WRKDIR}/.barrier_cookie
5 # _BARRIER_PRE_TARGETS is a list of the targets that must be built before
6 # the "barrier" target invokes a new make.
8 _BARRIER_PRE_TARGETS= checksum-phase makedirs depends
10 # _BARRIER_POST_TARGETS is a list of the targets that must be built after
11 # the "barrier" target invokes a new make. This list is specially
12 # ordered so that if more than one is specified on the command-line,
13 # then pkgsrc will still do the right thing.
16 # FIXME: why is wrapper before extract?
17 _BARRIER_POST_TARGETS= tools
18 _BARRIER_POST_TARGETS+= wrapper
19 _BARRIER_POST_TARGETS+= extract
20 _BARRIER_POST_TARGETS+= patch
21 _BARRIER_POST_TARGETS+= configure
22 _BARRIER_POST_TARGETS+= build build-env
23 _BARRIER_POST_TARGETS+= test
24 _BARRIER_POST_TARGETS+= all
25 _BARRIER_POST_TARGETS+= install
26 _BARRIER_POST_TARGETS+= reinstall
27 _BARRIER_POST_TARGETS+= replace
28 _BARRIER_POST_TARGETS+= package
29 _BARRIER_POST_TARGETS+= repackage
30 _BARRIER_POST_TARGETS+= package-install
32 .for _target_ in ${_BARRIER_POST_TARGETS}
33 . if make(${_target_})
34 _BARRIER_CMDLINE_TARGETS+= ${_target_}
38 ######################################################################
40 ######################################################################
41 ### barrier is a helper target that can be used to separate targets
42 ### that should be built in a new make process from being built in
43 ### the current one. The targets that must be built after the "barrier"
44 ### target invokes a new make should be listed in _BARRIER_POST_TARGETS,
45 ### and should be of the form:
47 ### .if !defined(_PKGSRC_BARRIER)
50 ### foo: foo's real source dependencies
53 ### Note that none of foo's real source dependencies should include
54 ### targets that occur before the barrier.
57 .PHONY: barrier-error-check
58 barrier-error-check: error-check
61 barrier: ${_BARRIER_PRE_TARGETS} ${_COOKIE.barrier}
62 .if !defined(_PKGSRC_BARRIER)
63 . if defined(PKG_VERBOSE)
64 @${PHASE_MSG} "Invoking \`\`"${_BARRIER_CMDLINE_TARGETS:Q}"'' after barrier for ${PKGNAME}"
68 && ${RECURSIVE_MAKE} ${MAKEFLAGS} _PKGSRC_BARRIER=yes ALLOW_VULNERABLE_PACKAGES= ${_BARRIER_CMDLINE_TARGETS} \
71 ${RECURSIVE_MAKE} ${MAKEFLAGS} _PKGSRC_BARRIER=yes barrier-error-check; \
74 . if defined(PKG_VERBOSE)
75 @${PHASE_MSG} "Leaving \`\`"${_BARRIER_CMDLINE_TARGETS:Q}"'' after barrier for ${PKGNAME}"
79 ######################################################################
80 ### barrier-cookie (PRIVATE)
81 ######################################################################
82 ### barrier-cookie creates the "barrier" cookie file.
85 ${RUN}${MKDIR} ${.TARGET:H}
86 ${RUN}${ECHO} ${PKGNAME} > ${.TARGET}