kernel: some boottime sanitychecks
[minix.git] / tools / Makefile
blob27bafe67e3258d2036b5ec5aaad332536112ce02
1 # $NetBSD: Makefile,v 1.155 2011/11/03 07:42:56 joerg Exp $
3 .include <bsd.own.mk>
5 HAVE_GCC= 45
7 # Dependencies in SUBDIR below ordered to maximize parallel ability.
8 SUBDIR= host-mkdep .WAIT compat .WAIT \
9 binstall .WAIT mktemp .WAIT sed .WAIT \
10 genassym \
11 makewhatis mkdep mtree\
12 m4 \
13 .WAIT mkfs.mfs \
14 .WAIT yacc \
15 .WAIT awk \
16 .WAIT tic \
17 .WAIT lex \
18 .WAIT pax \
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}:
29 @true
30 .endfor
31 .endif # }
33 .include <bsd.subdir.mk>
34 .include <bsd.obj.mk>
36 .if !defined(PREVIOUSTOOLDIR)
37 . if exists(PREVIOUSTOOLDIR)
38 PREVIOUSTOOLDIR!= cat PREVIOUSTOOLDIR
39 . else
40 PREVIOUSTOOLDIR=
41 . endif
42 .endif
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"
52 rm -f PREVIOUSTOOLDIR
53 (cd ${.CURDIR} && ${MAKE} PREVIOUSTOOLDIR=${TOOLDIR} cleandir)
54 .endif
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.
73 _deps:=
74 _prev:=
76 .for d in ${SUBDIR} # {
77 _this:= ${d}
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}
90 .endif
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
108 _prev:= ${d}
109 .endfor # }
111 cleandir:
112 rm -f ${CLEANFILES}