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 \
11 makewhatis mkdep mtree\
19 .WAIT gmake .WAIT gmp .WAIT mpfr .WAIT mpc .WAIT binutils .WAIT gcc \
20 cat file pwd_mkdb stat zic \
24 .if
${MKTOOLS
:Uyes
} == "no" ||
${USETOOLS} != "yes" # {
25 realall realdepend
install: check_MKTOOLS
27 .for
dir in
${SUBDIR
:N.WAIT
}
28 all-
${dir} depend-
${dir} dependall-
${dir} install-
${dir}:
33 .
include <bsd.subdir.mk
>
36 .if
!defined
(PREVIOUSTOOLDIR
)
37 . if exists
(PREVIOUSTOOLDIR
)
38 PREVIOUSTOOLDIR
!= cat PREVIOUSTOOLDIR
44 CLEANFILES
+= PREVIOUSTOOLDIR
46 realall realdepend
: .MAKE
47 .if
!empty
(PREVIOUSTOOLDIR
) && "${PREVIOUSTOOLDIR}" != "${TOOLDIR}"
48 @echo
"*** WARNING: TOOLDIR has moved?"
49 @echo
"*** PREVIOUSTOOLDIR '${PREVIOUSTOOLDIR}'"
50 @echo
"*** != TOOLDIR '${TOOLDIR}'"
51 @echo
"*** Cleaning mis-matched tools"
53 (cd
${.CURDIR
} && ${MAKE} PREVIOUSTOOLDIR
=${TOOLDIR} cleandir
)
55 echo
${TOOLDIR} >PREVIOUSTOOLDIR
57 # For each .WAIT point, make sure the immediately preceding target is
58 # installed before building anything after that point.
59 # (dsl: which means that with: 'a b .WAIT c' the build of 'c' waits for the
60 # install of 'b', but not the install of 'a'.)
62 # We use the "internal" targets and dependencies generated by <bsd.subdir.mk>
63 # to achieve this. These targets look like:
64 # subdir-all: all-dir1 [.WAIT] all-dir2 etc..
65 # subdir-install: install-dir1 [.WAIT] install-dir2 etc..
66 # and so on for each element in ${TARGETS}, with .WAIT sources inserted at
67 # places corresponding to the .WAITs in our $SUBDIR variable.
69 # Also, since we're now mixing `install' with `all' and `depend' targets
70 # an order relationship between those in each individual subdirectory
71 # must be established.
76 .for d in
${SUBDIR} # {
79 .if
${_this} == ".WAIT" # {
81 # setup dependency to apply to all/depend targets in the next group
82 _deps
:= ${_deps} ${_prev
:S
/^
/install-
/}
84 # if we're building *only* individual targets (i.e. "dependall-yacc"),
85 # make sure prerequisite tools build before installing
86 # XXX: dsl: this is likely to generate a dependency loop since there is
87 # a .ORDER releation between the nodes as well.
88 .if
!make
(all) && !make
(dependall
) && !make
(install)
89 install-
${_prev}: dependall-
${_prev}
92 .
else # ${_this} != ".WAIT" # } {
94 # order depend/all/install targets for ${d} subdir.
95 .ORDER
: depend-
${d} all-
${d} dependall-
${d} install-
${d}
97 # prevent cleandir in real{all,depend} from interfering with subdir makes
98 .ORDER
: realdepend dependall-
${d}
99 .ORDER
: realdepend depend-
${d}
100 .ORDER
: realall all-
${d}
102 # make all/depend-${d} dependent on list of install targets
103 depend-
${d} all-
${d} dependall-
${d}: ${_deps}
105 .
endif # ${_this} != ".WAIT" # }
107 # stash current name in case the next entry is .WAIT