e1000: add i82583V 1000baseT Ethernet
[minix3.git] / tools / Makefile
blobe122998e5c6145e5a6c7bde05f51353a89235055
1 # $NetBSD: Makefile,v 1.182 2015/07/23 08:03:26 mrg Exp $
3 .include <bsd.own.mk>
4 .include <bsd.endian.mk>
6 # Make sure that the ordered build/install processing applies when using
7 # plain make.
8 .MAIN: build_install
10 # TOOLDIR must be valid, unless MKTOOLS=no
11 .if ${MKTOOLS:Uyes} != "no"
12 .if "${TOOLDIR}" == ""
13 .error "TOOLDIR is undefined or empty"
14 .elif "${TOOLDIR:tW:M/*}" == ""
15 .error "TOOLDIR is not an absolute path: ${TOOLDIR}"
16 #.elif !exists(TOOLDIR) # XXX .exists fails for directories
17 #.error "TOOLDIR does not exist: ${TOOLDIR}"
18 .endif
19 .endif # MKTOOLS != no
21 # TOOLS_BUILDRUMP == yes builds only the subset of the tools required
22 # for building rump kernels and the hypervisor. It is typically used
23 # when building rump kernels targeted for non-NetBSD systems (via
24 # buildrump.sh), and should not be set for a regular "make build".
25 TOOLS_BUILDRUMP?=no
27 .if ${TOOLCHAIN_MISSING} == "no"
28 . if defined(HAVE_GCC) && ${HAVE_GCC} > 0
29 TOOLCHAIN_BITS= gmake .WAIT
30 TOOLCHAIN_BITS+= gmp .WAIT
31 TOOLCHAIN_BITS+= mpfr .WAIT
32 TOOLCHAIN_BITS+= mpc .WAIT
33 . endif
34 .endif
36 .if ${TOOLCHAIN_MISSING} == "no"
37 TOOLCHAIN_BITS+= binutils .WAIT
38 .endif
40 .if defined(HAVE_GCC) && ${HAVE_GCC} > 0
41 . if ${TOOLCHAIN_MISSING} == "no"
42 TOOLCHAIN_BITS+= gcc
43 .if !defined(__MINIX)
44 # The following test is broken as it still tries to create the directory
45 . if ${MKCROSSGDB:Uno} != "no" || make(obj)
46 TOOLCHAIN_BITS+= gdb
47 . endif
48 .endif # !defined(__MINIX)
49 TOOLCHAIN_BITS+= .WAIT
50 . endif
51 .endif
53 .if defined(HAVE_PCC)
54 . if ${TOOLCHAIN_MISSING} == "no"
55 TOOLCHAIN_BITS+= pcc
56 . endif
57 .endif
59 .if !defined(__MINIX)
60 .if ${TOOLCHAIN_MISSING} == "no"
61 # XXX Eventually, we want to be able to build dbsym and mdsetimage
62 # XXX if EXTERNAL_TOOLCHAIN is set.
63 TOOLCHAIN_BITS+= dbsym mdsetimage
64 .endif
65 .endif # !defined(__MINIX)
67 DTRACE_BITS=
68 .if ${MKDTRACE} != "no" || ${MKCTF} != "no"
69 DTRACE_BITS+= .WAIT libelf
70 DTRACE_BITS+= .WAIT libdwarf
71 DTRACE_BITS+= .WAIT libctf
72 .endif
73 .if ${MKCTF} != "no"
74 DTRACE_BITS+= .WAIT ctfconvert ctfmerge
75 .endif
77 LINT_BITS=
78 .if ${MKLINT} != "no"
79 LINT_BITS= lint lint2
80 .endif
82 # All of host-mkdep, compat, and binstall are needed before anything
83 # else. Within this group, they must be built in a specific order, and
84 # all of them must be built before any of them is installed. They may
85 # be installed in any order. This can't be expressed using the .WAIT
86 # notation inside the SUBDIR list.
88 # XXX .ORDER does not work when multiple targets are passed on the
89 # make command line without "-j", so use dependencies in addition to .ORDER.
91 .ORDER: dependall-host-mkdep dependall-compat dependall-binstall
92 .if make(dependall-host-mkdep) && make(dependall-compat)
93 dependall-compat: dependall-host-mkdep
94 .endif
95 .if make(dependall-compat) && make(dependall-binstall)
96 dependall-binstall: dependall-compat
97 .endif
99 # Dependencies in SUBDIR below ordered to maximize parallel ability.
100 # See above for special treatment for host-mkdep, compat, and binstall.
102 SUBDIR= host-mkdep compat binstall \
103 .WAIT mktemp .WAIT sed .WAIT genassym
104 .if ${TOOLS_BUILDRUMP} == "no"
105 SUBDIR+= \
106 ${LINT_BITS} \
107 makewhatis mtree nbperf .WAIT uudecode
108 .endif
110 SUBDIR+= cat join lorder m4 mkdep tsort .WAIT yacc .WAIT awk .WAIT lex
112 .if ${TOOLS_BUILDRUMP} == "no"
113 SUBDIR += .WAIT texinfo \
114 .WAIT tic \
115 .WAIT pax \
116 .WAIT ${TOOLCHAIN_BITS} \
117 ${DTRACE_BITS} \
118 cksum \
119 file \
120 makefs .WAIT \
121 .WAIT \
122 .WAIT \
123 .WAIT \
124 .WAIT installboot \
125 pwd_mkdb strfile zic
126 .endif
127 SUBDIR+= stat .WAIT
129 .if defined(__MINIX)
130 SUBDIR += \
131 mkfs.mfs \
132 partition \
133 toproto
134 .else
135 SUBDIR+= .WAIT config
136 .endif # defined(__MINIX)
138 .if ${MKLLVM} != "no"
139 SUBDIR+= \
140 llvm .WAIT \
141 llvm-lib/libLLVMSupport llvm-lib/libLLVMTableGen .WAIT \
142 llvm-tblgen llvm-clang-tblgen .WAIT \
143 llvm-include .WAIT \
144 llvm-lib .WAIT \
145 llvm-clang
146 . if ${MKLLD} != "no"
147 SUBDIR+= llvm-lld
148 . endif
149 . if ${MKMCLINKER} != "no"
150 SUBDIR+= llvm-mcld
151 . endif
152 .endif
154 .if ${MKMAN} != "no" || ${MKDOC} != "no" || ${MKHTML} != "no"
155 . if ${MKGROFF} != "no"
156 SUBDIR+= groff
157 . endif
158 SUBDIR+= mandoc
159 .endif
161 .if ${TOOLS_BUILDRUMP} == "no"
163 .if ${MKMAINTAINERTOOLS:Uno} != "no"
164 SUBDIR+= autoconf .WAIT gettext
165 .endif
167 .if ${USE_PIGZGZIP} != "no"
168 SUBDIR+= pigz
169 .endif
171 .if ${MACHINE} == "hppa"
172 SUBDIR+= hppa-mkboot
173 .endif
175 .if ${MACHINE} == "ibmnws"
176 SUBDIR+= ibmnws-ncdcs
177 .endif
179 .if ${MACHINE} == "macppc"
180 SUBDIR+= macppc-fixcoff
181 .endif
183 .if (${MACHINE} == "prep" || ${MACHINE} == "rs6000" || ${MACHINE} == "bebox")
184 SUBDIR+= powerpc-mkbootimage
185 .endif
187 .if ${MACHINE_ARCH} == "m68k"
188 SUBDIR+= m68k-elf2aout
189 .endif
191 .if (${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb" || \
192 ${MACHINE_ARCH} == "mips64el" || ${MACHINE_ARCH} == "mips64eb")
193 SUBDIR+= mips-elf2ecoff
194 .endif
196 .if (${MACHINE} == "sgimips")
197 SUBDIR+= sgivol
198 .endif
200 .if ${MACHINE} == "acorn32"
201 SUBDIR+= sparkcrc
202 .endif
204 .if (${MACHINE_ARCH} == "sparc" || ${MACHINE_ARCH} == "sparc64")
205 SUBDIR+= fgen
206 .endif
208 .if ${MACHINE} == "amiga"
209 SUBDIR+= amiga-elf2bb
210 SUBDIR+= amiga-txlt
211 .endif
213 .if ${MACHINE} == "hp300"
214 SUBDIR+= hp300-mkboot
215 .endif
217 .if !defined(__MINIX)
218 .if ${MACHINE} == "evbarm" \
219 && ${MACHINE_CPU} == "arm" \
220 && ${TARGET_ENDIANNESS} == "1234"
221 SUBDIR+= elftosb
222 .endif
224 .if ${MACHINE} == "evbarm" || ${MACHINE} == "evbmips" || \
225 ${MACHINE} == "evbppc" || ${MACHINE} == "sandpoint"
226 SUBDIR+= mkubootimage
227 .endif
228 .endif # !defined(__MINIX)
230 .if ${MKX11} != "no"
231 SUBDIR+= makestrs
232 SUBDIR+= makekeys
233 .endif
235 .endif # TOOLCHAIN_BUILDRUMP
237 check_MKTOOLS: .PHONY .NOTMAIN
238 .if ${MKTOOLS:Uyes} == "no"
239 @echo '*** WARNING: "MKTOOLS" is set to "no"; this will prevent building and'
240 @echo '*** updating your host toolchain. This should be used only as a'
241 @echo '*** temporary workaround for toolchain problems, as it will result'
242 @echo '*** in version skew and build errors over time!'
243 .endif
245 .if ${MKTOOLS:Uyes} == "no" || ${USETOOLS} != "yes" # {
246 SUBDIR= # empty
247 realall realdepend install: check_MKTOOLS
248 .endif # }
250 .include <bsd.subdir.mk>
251 .include <bsd.buildinstall.mk>
252 .include <bsd.obj.mk>
254 .if !defined(PREVIOUSTOOLDIR)
255 . if exists(PREVIOUSTOOLDIR)
256 PREVIOUSTOOLDIR!= cat PREVIOUSTOOLDIR
257 . else
258 PREVIOUSTOOLDIR=
259 . endif
260 .endif
262 CLEANFILES+= PREVIOUSTOOLDIR
264 realall realdepend: .MAKE
265 .if !empty(PREVIOUSTOOLDIR) && "${PREVIOUSTOOLDIR}" != "${TOOLDIR}"
266 @echo "*** WARNING: TOOLDIR has moved?"
267 @echo "*** PREVIOUSTOOLDIR '${PREVIOUSTOOLDIR}'"
268 @echo "*** != TOOLDIR '${TOOLDIR}'"
269 @echo "*** Cleaning mis-matched tools"
270 rm -f PREVIOUSTOOLDIR
271 (cd ${.CURDIR} && ${MAKE} PREVIOUSTOOLDIR=${TOOLDIR} cleandir)
272 .endif
273 echo ${TOOLDIR} >PREVIOUSTOOLDIR
275 cleandir:
276 rm -f ${CLEANFILES}