1 # $NetBSD: Makefile,v 1.155 2011/11/03 07:42:56 joerg Exp $
7 # Dependencies in SUBDIR below ordered to maximize parallel ability.
8 SUBDIR
= host-mkdep .WAIT compat .WAIT \
9 binstall .WAIT mktemp .WAIT sed .WAIT \
17 .WAIT gmake .WAIT gmp .WAIT mpfr .WAIT mpc .WAIT binutils .WAIT gcc \
18 cat file pwd_mkdb stat zic \
22 .if
${MKTOOLS
:Uyes
} == "no" ||
${USETOOLS} != "yes" # {
23 realall realdepend
install: check_MKTOOLS
25 .for
dir in
${SUBDIR
:N.WAIT
}
26 all-
${dir} depend-
${dir} dependall-
${dir} install-
${dir}:
31 .
include <bsd.subdir.mk
>
34 .if
!defined
(PREVIOUSTOOLDIR
)
35 . if exists
(PREVIOUSTOOLDIR
)
36 PREVIOUSTOOLDIR
!= cat PREVIOUSTOOLDIR
42 CLEANFILES
+= PREVIOUSTOOLDIR
44 realall realdepend
: .MAKE
45 .if
!empty
(PREVIOUSTOOLDIR
) && "${PREVIOUSTOOLDIR}" != "${TOOLDIR}"
46 @echo
"*** WARNING: TOOLDIR has moved?"
47 @echo
"*** PREVIOUSTOOLDIR '${PREVIOUSTOOLDIR}'"
48 @echo
"*** != TOOLDIR '${TOOLDIR}'"
49 @echo
"*** Cleaning mis-matched tools"
51 (cd
${.CURDIR
} && ${MAKE} PREVIOUSTOOLDIR
=${TOOLDIR} cleandir
)
53 echo
${TOOLDIR} >PREVIOUSTOOLDIR
55 # For each .WAIT point, make sure the immediately preceding target is
56 # installed before building anything after that point.
57 # (dsl: which means that with: 'a b .WAIT c' the build of 'c' waits for the
58 # install of 'b', but not the install of 'a'.)
60 # We use the "internal" targets and dependencies generated by <bsd.subdir.mk>
61 # to achieve this. These targets look like:
62 # subdir-all: all-dir1 [.WAIT] all-dir2 etc..
63 # subdir-install: install-dir1 [.WAIT] install-dir2 etc..
64 # and so on for each element in ${TARGETS}, with .WAIT sources inserted at
65 # places corresponding to the .WAITs in our $SUBDIR variable.
67 # Also, since we're now mixing `install' with `all' and `depend' targets
68 # an order relationship between those in each individual subdirectory
69 # must be established.
74 .for d in
${SUBDIR} # {
77 .if
${_this} == ".WAIT" # {
79 # setup dependency to apply to all/depend targets in the next group
80 _deps
:= ${_deps} ${_prev
:S
/^
/install-
/}
82 # if we're building *only* individual targets (i.e. "dependall-yacc"),
83 # make sure prerequisite tools build before installing
84 # XXX: dsl: this is likely to generate a dependency loop since there is
85 # a .ORDER releation between the nodes as well.
86 .if
!make
(all) && !make
(dependall
) && !make
(install)
87 install-
${_prev}: dependall-
${_prev}
90 .
else # ${_this} != ".WAIT" # } {
92 # order depend/all/install targets for ${d} subdir.
93 .ORDER
: depend-
${d} all-
${d} dependall-
${d} install-
${d}
95 # prevent cleandir in real{all,depend} from interfering with subdir makes
96 .ORDER
: realdepend dependall-
${d}
97 .ORDER
: realdepend depend-
${d}
98 .ORDER
: realall all-
${d}
100 # make all/depend-${d} dependent on list of install targets
101 depend-
${d} all-
${d} dependall-
${d}: ${_deps}
103 .
endif # ${_this} != ".WAIT" # }
105 # stash current name in case the next entry is .WAIT