bsd.own.mk revision 1.1487 1 # $NetBSD: bsd.own.mk,v 1.1487 2026/09/26 13:09:17 christos Exp $
2
3 # This needs to be before bsd.init.mk
4 .if defined(BSD_MK_COMPAT_FILE)
5 .include <${BSD_MK_COMPAT_FILE}>
6 .endif
7
8 .if !defined(_BSD_OWN_MK_)
9 _BSD_OWN_MK_=1
10
11 MAKECONF?= /etc/mk.conf
12 .-include "${MAKECONF}"
13
14 #
15 # CPU model, derived from MACHINE_ARCH
16 #
17 MACHINE_CPU= ${MACHINE_ARCH:C/mips.*e[bl]/mips/:C/sh3e[bl]/sh3/:S/coldfire/m68k/:S/m68000/m68k/:S/m68ksf/m68k/:C/e?arm.*/arm/:S/powerpc64/powerpc/:S/aarch64eb/aarch64/:S/or1knd/or1k/:C/riscv../riscv/}
18
19 .if (${MACHINE_ARCH} == "mips64el" || \
20 ${MACHINE_ARCH} == "mips64eb" || \
21 ${MACHINE_ARCH} == "mipsn64el" || \
22 ${MACHINE_ARCH} == "mipsn64eb")
23 MACHINE_MIPS64= 1
24 .else
25 MACHINE_MIPS64= 0
26 .endif
27
28 .if ${MACHINE_ARCH} == "m68ksf"
29 BFD_MACHINE_ARCH=m68k
30 BINUTILS_MACHINE_ARCH=m68k
31 GCC_MACHINE_ARCH=m68k
32 GDB_MACHINE_ARCH=m68k
33 GMP_MACHINE_ARCH=m68k
34 GOMP_MACHINE_ARCH=m68k
35 LDELFSO_MACHINE_ARCH=m68k
36 LIBC_MACHINE_ARCH=m68k
37 LIBEXECINFO_MACHINE_ARCH=m68k
38 LIBEXEC_MACHINE_ARCH=m68k
39 LIBGCC_MACHINE_ARCH=m68k
40 LIBKERN_ARCH=m68k
41 .endif
42
43 #
44 # Subdirectory used below ${RELEASEDIR} when building a release
45 #
46 .if \
47 ${MACHINE:Mevbarm} || \
48 ${MACHINE:Mevbmips} || \
49 ${MACHINE:Mevbsh3} || \
50 ${MACHINE:Mriscv}
51 RELEASEMACHINEDIR?= ${MACHINE}-${MACHINE_ARCH}
52 .else
53 RELEASEMACHINEDIR?= ${MACHINE}
54 .endif
55
56 #
57 # Subdirectory or path component used for the following paths:
58 # distrib/${RELEASEMACHINE}
59 # distrib/notes/${RELEASEMACHINE}
60 # etc/etc.${RELEASEMACHINE}
61 # Used when building a release.
62 #
63 RELEASEMACHINE?= ${MACHINE}
64
65 #
66 # NEED_OWN_INSTALL_TARGET is set to "no" by pkgsrc/mk/bsd.pkg.mk to
67 # ensure that things defined by <bsd.own.mk> (default targets,
68 # INSTALL_FILE, etc.) are not conflicting with bsd.pkg.mk.
69 #
70 NEED_OWN_INSTALL_TARGET?= yes
71
72 #
73 # This lists the platforms which do not have working in-tree toolchains. For
74 # the in-tree gcc toolchain, this list is empty.
75 #
76 # If some future port is not supported by the in-tree toolchain, this should
77 # be set to "yes" for that port only.
78 #
79 # .if ${MACHINE} == "playstation2"
80 # TOOLCHAIN_MISSING?= yes
81 # .endif
82
83 TOOLCHAIN_MISSING?= no
84
85 #
86 # GCC Using platforms.
87 #
88 .if ${MKGCC:Uyes} != "no" # {
89
90 #
91 # What GCC is used?
92 #
93 .if \
94 ${MACHINE} == "alpha" || \
95 ${MACHINE_CPU} == "m68k"
96 HAVE_GCC?= 12
97 .endif
98
99 HAVE_GCC?= 14
100
101 #
102 # Platforms that can't run a modern GCC natively
103 .if ${MACHINE_ARCH} == "m68000"
104 MKGCCCMDS?= no
105 .endif
106
107 #
108 # We import the old gcc as "gcc.old" when upgrading. EXTERNAL_GCC_SUBDIR is
109 # set to the relevant subdirectory in src/external/gpl3 for this HAVE_GCC.
110 #
111 .if ${HAVE_GCC} == 12
112 EXTERNAL_GCC_SUBDIR?= gcc.old
113 .elif ${HAVE_GCC} == 14
114 EXTERNAL_GCC_SUBDIR?= gcc
115 .else
116 EXTERNAL_GCC_SUBDIR?= /does/not/exist
117 .endif
118
119 .else # MKGCC == no # } {
120 MKGCCCMDS?= no
121 .endif # MKGCC == no # }
122
123 #
124 # Build GCC with the "isl" library enabled.
125 # The alpha port does not work with it, see GCC PR's 84204 and 84353.
126 # Other ports don't have vector units GCC can target.
127 #
128 .if ${MACHINE} == "alpha" || \
129 ${MACHINE_CPU} == "m68k" || \
130 ${MACHINE_CPU} == "sh3" || \
131 ${MACHINE} == "vax"
132 NOGCCISL= # defined
133 .endif
134
135 #
136 # Build GCC with libquadmath.
137 # E.g.: grep '#define HAVE_FLOAT128 1' lib/libgfortran/arch/*/config.h
138 #
139 .if ${MACHINE_ARCH} == "i386" || \
140 ${MACHINE_ARCH} == "ia64" || \
141 ${MACHINE_ARCH} == "x86_64"
142 HAVE_QUADMATH?= yes
143 .endif
144 HAVE_QUADMATH?= no
145
146 #
147 # What binutils is used?
148 #
149 HAVE_BINUTILS?= 246
150
151 .if ${HAVE_BINUTILS} == 246
152 EXTERNAL_BINUTILS_SUBDIR= binutils
153 .elif ${HAVE_BINUTILS} == 245
154 EXTERNAL_BINUTILS_SUBDIR= binutils.old
155 .else
156 EXTERNAL_BINUTILS_SUBDIR= /does/not/exist
157 .endif
158
159 #
160 # What GDB is used?
161 #
162 HAVE_GDB?= 1710
163
164 .if ${HAVE_GDB} == 1710
165 EXTERNAL_GDB_SUBDIR= gdb
166 .elif ${HAVE_GDB} == 1630
167 EXTERNAL_GDB_SUBDIR= gdb.old
168 .else
169 EXTERNAL_GDB_SUBDIR= /does/not/exist
170 .endif
171
172 .if ${MACHINE_ARCH} == "x86_64"
173 MKGDBSERVER?= yes
174 .endif
175 MKGDBSERVER?= no
176
177 #
178 # What OpenSSL is used?
179 #
180 HAVE_OPENSSL?= 35
181
182 .if ${HAVE_OPENSSL} == 35
183 EXTERNAL_OPENSSL_SUBDIR=apache2/openssl
184 .elif ${HAVE_OPENSSL} == 30
185 EXTERNAL_OPENSSL_SUBDIR=bsd/openssl
186 .elif ${HAVE_OPENSSL} == 11
187 EXTERNAL_OPENSSL_SUBDIR=bsd/openssl.old
188 .else
189 EXTERNAL_OPENSSL_SUBDIR=/does/not/exist
190 .endif
191
192 #
193 # Does the platform support ACPI?
194 #
195 .if \
196 ${MACHINE_ARCH:Maarch64*} || \
197 ${MACHINE} == "amd64" || \
198 ${MACHINE} == "i386" || \
199 ${MACHINE} == "ia64"
200 HAVE_ACPI= yes
201 .else
202 HAVE_ACPI= no
203 .endif
204
205 #
206 # Does the platform support UEFI?
207 #
208 .if \
209 ${MACHINE_ARCH:Maarch64*} || \
210 ${MACHINE} == "amd64" || \
211 ${MACHINE_ARCH:Mearmv7*} || \
212 ${MACHINE} == "i386" || \
213 ${MACHINE} == "ia64" || \
214 ${MACHINE_ARCH} == "riscv64"
215 HAVE_UEFI= yes
216 .else
217 HAVE_UEFI= no
218 .endif
219
220 #
221 # Does the platform support EFI RT services?
222 #
223 .if ${HAVE_UEFI} == "yes" && ${MACHINE_ARCH:M*eb} == ""
224 HAVE_EFI_RT= yes
225 .else
226 HAVE_EFI_RT= no
227 .endif
228
229 #
230 # Does the platform support NVMM?
231 #
232 .if ${MACHINE_ARCH} == "x86_64"
233 HAVE_NVMM= yes
234 .else
235 HAVE_NVMM= no
236 .endif
237
238
239 .if ${MACHINE_ARCH:Mearm*}
240 _LIBC_COMPILER_RT.${MACHINE_ARCH}= yes
241 .endif
242
243 _LIBC_COMPILER_RT.aarch64= yes
244 _LIBC_COMPILER_RT.aarch64eb= yes
245 _LIBC_COMPILER_RT.i386= yes
246 _LIBC_COMPILER_RT.powerpc= yes
247 _LIBC_COMPILER_RT.powerpc64= yes
248 _LIBC_COMPILER_RT.sparc= yes
249 _LIBC_COMPILER_RT.sparc64= yes
250 _LIBC_COMPILER_RT.x86_64= yes
251
252 .if ${HAVE_LLVM:Uno} == "yes" && ${_LIBC_COMPILER_RT.${MACHINE_ARCH}:Uno} == "yes"
253 HAVE_LIBGCC?= no
254 .else
255 HAVE_LIBGCC?= yes
256 .endif
257
258
259 # Should libgcc have unwinding code?
260 .if ${HAVE_LLVM:Uno} == "yes" || ${MACHINE_ARCH:Mearm*}
261 HAVE_LIBGCC_EH?= no
262 .else
263 HAVE_LIBGCC_EH?= yes
264 .endif
265
266 # Coverity does not like SSP
267 .if defined(COVERITY_TOP_CONFIG) || \
268 ${MACHINE} == "alpha" || \
269 ${MACHINE} == "hppa" || \
270 ${MACHINE} == "ia64"
271 HAVE_SSP?= no
272 .else
273 HAVE_SSP?= yes
274 .if !defined(NOFORT) && ${USE_FORT:Uno} != "no"
275 USE_SSP?= yes
276 .endif
277 .endif
278
279 #
280 # What version of jemalloc we use (100 is the one
281 # built-in to libc from 2005 (pre version 3).
282 #
283 .if \
284 ${MACHINE_ARCH} == "m68000" || \
285 ${MACHINE_ARCH} == "vax"
286 HAVE_JEMALLOC?= 100
287 .else
288 HAVE_JEMALLOC?= 540
289 .endif
290
291 .if ${HAVE_JEMALLOC} == 540 || ${HAVE_JEMALLOC} == 100
292 EXTERNAL_JEMALLOC_SUBDIR = jemalloc
293 .elif ${HAVE_JEMALLOC} == 531
294 EXTERNAL_JEMALLOC_SUBDIR = jemalloc.old
295 .else
296 EXTERNAL_JEMALLOC_SUBDIR = /does/not/exist
297 .endif
298
299 .if empty(.MAKEFLAGS:tW:M*-V .OBJDIR*)
300 .if defined(MAKEOBJDIRPREFIX) || defined(MAKEOBJDIR)
301 PRINTOBJDIR= ${MAKE} -B -r -V .OBJDIR -f /dev/null xxx
302 .else
303 PRINTOBJDIR= ${MAKE} -B -V .OBJDIR
304 .endif
305 .else
306 PRINTOBJDIR= echo /error/bsd.own.mk/PRINTOBJDIR # avoid infinite recursion
307 .endif
308
309 #
310 # Make sure we set _NETBSD_REVISIONID in CPPFLAGS if requested.
311 #
312 .ifdef NETBSD_REVISIONID
313 _NETBSD_REVISIONID_STR= "${NETBSD_REVISIONID}"
314 CPPFLAGS+= -D_NETBSD_REVISIONID=${_NETBSD_REVISIONID_STR:Q}
315 .endif
316
317 #
318 # Determine if running in the NetBSD source tree by checking for the
319 # existence of build.sh and tools/ in the current or a parent directory,
320 # and setting _SRC_TOP_ to the result.
321 #
322 .if !defined(_SRC_TOP_) # {
323 _SRC_TOP_!= cd "${.CURDIR}"; while :; do \
324 here=$$(pwd); \
325 [ -f build.sh ] && [ -d tools ] && { echo $$here; break; }; \
326 case $$here in /) echo ""; break;; esac; \
327 cd ..; done
328
329 .MAKEOVERRIDES+= _SRC_TOP_
330
331 .endif # }
332
333 #
334 # If _SRC_TOP_ != "", we're within the NetBSD source tree.
335 # * Set defaults for NETBSDSRCDIR and _SRC_TOP_OBJ_.
336 # * Define _NETBSD_VERSION_DEPENDS. Targets that depend on the
337 # NetBSD version, or on variables defined at build time, can
338 # declare a dependency on ${_NETBSD_VERSION_DEPENDS}.
339 #
340 .if (${_SRC_TOP_} != "") # {
341
342 NETBSDSRCDIR?= ${_SRC_TOP_}
343
344 .if !defined(_SRC_TOP_OBJ_)
345 _SRC_TOP_OBJ_!= cd "${_SRC_TOP_}" && ${PRINTOBJDIR}
346 .MAKEOVERRIDES+= _SRC_TOP_OBJ_
347 .endif
348
349 _NETBSD_VERSION_DEPENDS= ${_SRC_TOP_OBJ_}/params
350 _NETBSD_VERSION_DEPENDS+= ${NETBSDSRCDIR}/sys/sys/param.h
351 _NETBSD_VERSION_DEPENDS+= ${NETBSDSRCDIR}/sys/conf/newvers.sh
352 _NETBSD_VERSION_DEPENDS+= ${NETBSDSRCDIR}/sys/conf/osrelease.sh
353 ${_SRC_TOP_OBJ_}/params: .NOTMAIN .OPTIONAL # created by top level "make build"
354
355 .endif # _SRC_TOP_ != "" # }
356
357
358 .if (${_SRC_TOP_} != "") && \
359 (${TOOLCHAIN_MISSING} == "no" || defined(EXTERNAL_TOOLCHAIN))
360 USETOOLS?= yes
361 .endif
362 USETOOLS?= no
363
364
365 .if \
366 ${MACHINE_ARCH} == "mips" || \
367 ${MACHINE_ARCH} == "mips64" || \
368 ${MACHINE_ARCH} == "sh3"
369 .BEGIN:
370 @echo "Must set MACHINE_ARCH to one of ${MACHINE_ARCH}eb or ${MACHINE_ARCH}el"
371 @false
372 .elif defined(REQUIRETOOLS) && \
373 (${TOOLCHAIN_MISSING} == "no" || defined(EXTERNAL_TOOLCHAIN)) && \
374 ${USETOOLS} == "no"
375 .BEGIN:
376 @echo "USETOOLS=no, but this component requires a version-specific host toolchain"
377 @false
378 .endif
379
380 #
381 # Host platform information; may be overridden
382 #
383 .include <bsd.host.mk>
384
385 .if ${USETOOLS} == "yes" # {
386
387 #
388 # Provide a default for TOOLDIR.
389 #
390 .if !defined(TOOLDIR)
391 TOOLDIR:= ${_SRC_TOP_OBJ_}/tooldir.${HOST_OSTYPE}
392 .MAKEOVERRIDES+= TOOLDIR
393 .endif
394
395 #
396 # This is the prefix used for the NetBSD-sourced tools.
397 #
398 _TOOL_PREFIX?= nb
399
400 #
401 # If an external toolchain base is specified, use it.
402 #
403 .if defined(EXTERNAL_TOOLCHAIN) # {
404 AR= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-ar
405 AS= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-as
406 ELFEDIT= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-elfedit
407 LD= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-ld
408 NM= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-nm
409 OBJCOPY= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-objcopy
410 OBJDUMP= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-objdump
411 RANLIB= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-ranlib
412 READELF= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-readelf
413 SIZE= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-size
414 STRINGS= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-strings
415 STRIP= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-strip
416
417 TOOL_CC.gcc= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-gcc
418 TOOL_CPP.gcc= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-cpp
419 TOOL_CXX.gcc= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-c++
420 TOOL_FC.gcc= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-gfortran
421 TOOL_OBJC.gcc= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-gcc
422
423 TOOL_CC.clang= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-clang
424 TOOL_CPP.clang= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-clang-cpp
425 TOOL_CXX.clang= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-clang++
426 TOOL_OBJC.clang= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-clang
427 .else # } {
428 # Define default locations for common tools.
429 .if ${USETOOLS_BINUTILS:Uyes} == "yes" # {
430 AR= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ar
431 AS= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-as
432 ELFEDIT= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-elfedit
433 LD= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ld
434 NM= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-nm
435 OBJCOPY= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-objcopy
436 OBJDUMP= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-objdump
437 RANLIB= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ranlib
438 READELF= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-readelf
439 SIZE= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-size
440 STRINGS= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-strings
441 STRIP= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-strip
442
443 # GCC supports C, C++, Fortran and Objective C
444 TOOL_CC.gcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-gcc
445 TOOL_CPP.gcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-cpp
446 TOOL_CXX.gcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-c++
447 TOOL_FC.gcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-gfortran
448 TOOL_OBJC.gcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-gcc
449 .endif # }
450
451 # Clang supports C, C++ and Objective C
452 TOOL_CC.clang= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-clang
453 TOOL_CPP.clang= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-clang-cpp
454 TOOL_CXX.clang= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-clang++
455 TOOL_OBJC.clang= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-clang
456
457 # PCC supports C and Fortran
458 TOOL_CC.pcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-pcc
459 TOOL_CPP.pcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-pcpp
460 TOOL_CXX.pcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-p++
461 .endif # EXTERNAL_TOOLCHAIN # }
462
463 #
464 # Make sure DESTDIR is set, so that builds with these tools always
465 # get appropriate -nostdinc, -nostdlib, etc. handling. The default is
466 # <empty string>, meaning start from /, the root directory.
467 #
468 DESTDIR?=
469
470 # Don't append another copy of sysroot (coming from COMPATCPPFLAGS etc.)
471 # because it confuses Coverity. Still we need to cov-configure specially
472 # for each specific sysroot argument.
473 # Also don't add a sysroot at all if a rumpkernel build.
474 .if !defined(HOSTPROG) && !defined(HOSTLIB) && !defined(RUMPRUN)
475 . if ${DESTDIR} != ""
476 . if empty(CPPFLAGS:M*--sysroot=*)
477 CPPFLAGS+= --sysroot=${DESTDIR}
478 . endif
479 LDFLAGS+= --sysroot=${DESTDIR}
480 . else
481 . if empty(CPPFLAGS:M*--sysroot=*)
482 CPPFLAGS+= --sysroot=/
483 . endif
484 LDFLAGS+= --sysroot=/
485 . endif
486 .endif
487
488 ARM_ELF2AOUT= ${TOOLDIR}/bin/${_TOOL_PREFIX}arm-elf2aout
489 DBSYM= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-dbsym
490 INSTALL= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-install
491 LEX= ${TOOLDIR}/bin/${_TOOL_PREFIX}lex
492 LINT= CC=${CC:Q} ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-lint
493 LORDER= NM=${NM:Q} MKTEMP=${TOOL_MKTEMP:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}lorder
494 M68K_ELF2AOUT= ${TOOLDIR}/bin/${_TOOL_PREFIX}m68k-elf2aout
495 MIPS_ELF2ECOFF= ${TOOLDIR}/bin/${_TOOL_PREFIX}mips-elf2ecoff
496 MKDEP= CC=${CC:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}mkdep
497 MKDEPCXX= CC=${CXX:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}mkdep
498 PAXCTL= ${TOOLDIR}/bin/${_TOOL_PREFIX}paxctl
499 TSORT= ${TOOLDIR}/bin/${_TOOL_PREFIX}tsort -q
500 YACC= ${TOOLDIR}/bin/${_TOOL_PREFIX}yacc
501
502 GROFF_SHARE_PATH= ${TOOLDIR}/share/groff
503 TOOL_GROFF_ENV= \
504 GROFF_ENCODING= \
505 GROFF_BIN_PATH=${TOOLDIR}/lib/groff \
506 GROFF_FONT_PATH=${GROFF_SHARE_PATH}/site-font:${GROFF_SHARE_PATH}/font \
507 GROFF_TMAC_PATH=${GROFF_SHARE_PATH}/site-tmac:${GROFF_SHARE_PATH}/tmac
508
509 TOOL_AMIGAAOUT2BB= ${TOOLDIR}/bin/${_TOOL_PREFIX}amiga-aout2bb
510 TOOL_AMIGAELF2BB= ${TOOLDIR}/bin/${_TOOL_PREFIX}amiga-elf2bb
511 TOOL_AMIGATXLT= ${TOOLDIR}/bin/${_TOOL_PREFIX}amiga-txlt
512 TOOL_ARMELF2AOUT= ${TOOLDIR}/bin/${_TOOL_PREFIX}arm-elf2aout
513 TOOL_ASN1_COMPILE= ${TOOLDIR}/bin/${_TOOL_PREFIX}asn1_compile
514 TOOL_AWK= ${TOOLDIR}/bin/${_TOOL_PREFIX}awk
515 TOOL_CAP_MKDB= ${TOOLDIR}/bin/${_TOOL_PREFIX}cap_mkdb
516 TOOL_CAT= ${TOOLDIR}/bin/${_TOOL_PREFIX}cat
517 TOOL_CKSUM= ${TOOLDIR}/bin/${_TOOL_PREFIX}cksum
518 TOOL_CLANG_TBLGEN= ${TOOLDIR}/bin/${_TOOL_PREFIX}clang-tblgen
519 TOOL_COMPILE_ET= ${TOOLDIR}/bin/${_TOOL_PREFIX}compile_et
520 TOOL_CONFIG= ${TOOLDIR}/bin/${_TOOL_PREFIX}config
521 TOOL_CRUNCHGEN= MAKE=${.MAKE:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}crunchgen
522 TOOL_CTAGS= ${TOOLDIR}/bin/${_TOOL_PREFIX}ctags
523 TOOL_CTFCONVERT= ${TOOLDIR}/bin/${_TOOL_PREFIX}ctfconvert
524 TOOL_CTFMERGE= ${TOOLDIR}/bin/${_TOOL_PREFIX}ctfmerge
525 TOOL_CVSLATEST= ${TOOLDIR}/bin/${_TOOL_PREFIX}cvslatest
526 TOOL_DATE= ${TOOLDIR}/bin/${_TOOL_PREFIX}date
527 TOOL_DB= ${TOOLDIR}/bin/${_TOOL_PREFIX}db
528 TOOL_DISKLABEL= ${TOOLDIR}/bin/${_TOOL_PREFIX}disklabel
529 TOOL_DTC= ${TOOLDIR}/bin/${_TOOL_PREFIX}dtc
530 TOOL_ELFTOSB= ${TOOLDIR}/bin/${_TOOL_PREFIX}elftosb
531 TOOL_EQN= ${TOOLDIR}/bin/${_TOOL_PREFIX}eqn
532 TOOL_FDISK= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-fdisk
533 TOOL_FGEN= ${TOOLDIR}/bin/${_TOOL_PREFIX}fgen
534 TOOL_FILE= ${TOOLDIR}/bin/${_TOOL_PREFIX}file
535 TOOL_GENASSYM= ${TOOLDIR}/bin/${_TOOL_PREFIX}genassym
536 TOOL_GENCAT= ${TOOLDIR}/bin/${_TOOL_PREFIX}gencat
537 TOOL_GMAKE= ${TOOLDIR}/bin/${_TOOL_PREFIX}gmake
538 TOOL_GPT= ${TOOLDIR}/bin/${_TOOL_PREFIX}gpt
539 TOOL_GREP= ${TOOLDIR}/bin/${_TOOL_PREFIX}grep
540 TOOL_GROFF= ${TOOL_GROFF_ENV} ${TOOLDIR}/bin/${_TOOL_PREFIX}groff ${GROFF_FLAGS}
541 TOOL_GROPS= ${TOOL_GROFF_ENV} ${TOOLDIR}/lib/groff/grops
542 TOOL_HEXDUMP= ${TOOLDIR}/bin/${_TOOL_PREFIX}hexdump
543 TOOL_HP300MKBOOT= ${TOOLDIR}/bin/${_TOOL_PREFIX}hp300-mkboot
544 TOOL_HPPAMKBOOT= ${TOOLDIR}/bin/${_TOOL_PREFIX}hppa-mkboot
545 TOOL_INDXBIB= ${TOOLDIR}/bin/${_TOOL_PREFIX}indxbib
546 TOOL_INSTALLBOOT= ${TOOLDIR}/bin/${_TOOL_PREFIX}installboot
547 TOOL_INSTALL_INFO= ${TOOLDIR}/bin/${_TOOL_PREFIX}install-info
548 TOOL_JOIN= ${TOOLDIR}/bin/${_TOOL_PREFIX}join
549 TOOL_LLVM_TBLGEN= ${TOOLDIR}/bin/${_TOOL_PREFIX}llvm-tblgen
550 TOOL_M4= ${TOOLDIR}/bin/${_TOOL_PREFIX}m4
551 TOOL_M68KELF2AOUT= ${TOOLDIR}/bin/${_TOOL_PREFIX}m68k-elf2aout
552 TOOL_MACPPCFIXCOFF= ${TOOLDIR}/bin/${_TOOL_PREFIX}macppc-fixcoff
553 TOOL_MACPPCINSTALLBOOT= ${TOOLDIR}/bin/${_TOOL_PREFIX}macppc_installboot
554 TOOL_MACPPCMKBOOTHFS= ${TOOLDIR}/bin/${_TOOL_PREFIX}macppc_mkboothfs
555 TOOL_MAKEFS= ${TOOLDIR}/bin/${_TOOL_PREFIX}makefs
556 TOOL_MAKEINFO= ${TOOLDIR}/bin/${_TOOL_PREFIX}makeinfo
557 TOOL_MAKEKEYS= ${TOOLDIR}/bin/${_TOOL_PREFIX}makekeys
558 TOOL_MAKESTRS= ${TOOLDIR}/bin/${_TOOL_PREFIX}makestrs
559 TOOL_MAKEWHATIS= ${TOOLDIR}/bin/${_TOOL_PREFIX}makewhatis
560 TOOL_MANDOC_ASCII= ${TOOLDIR}/bin/${_TOOL_PREFIX}mandoc -Tascii
561 TOOL_MANDOC_HTML= ${TOOLDIR}/bin/${_TOOL_PREFIX}mandoc -Thtml
562 TOOL_MANDOC_LINT= ${TOOLDIR}/bin/${_TOOL_PREFIX}mandoc -Tlint
563 TOOL_MDSETIMAGE= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-mdsetimage
564 TOOL_MENUC= MENUDEF=${TOOLDIR}/share/misc ${TOOLDIR}/bin/${_TOOL_PREFIX}menuc
565 TOOL_MIPSELF2ECOFF= ${TOOLDIR}/bin/${_TOOL_PREFIX}mips-elf2ecoff
566 TOOL_MKCSMAPPER= ${TOOLDIR}/bin/${_TOOL_PREFIX}mkcsmapper
567 TOOL_MKESDB= ${TOOLDIR}/bin/${_TOOL_PREFIX}mkesdb
568 TOOL_MKHYBRID= ${TOOLDIR}/bin/${_TOOL_PREFIX}mkhybrid
569 TOOL_MKLOCALE= ${TOOLDIR}/bin/${_TOOL_PREFIX}mklocale
570 TOOL_MKMAGIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}file
571 TOOL_MKNOD= ${TOOLDIR}/bin/${_TOOL_PREFIX}mknod
572 TOOL_MKTEMP= ${TOOLDIR}/bin/${_TOOL_PREFIX}mktemp
573 TOOL_MKUBOOTIMAGE= ${TOOLDIR}/bin/${_TOOL_PREFIX}mkubootimage
574 TOOL_MSGC= MSGDEF=${TOOLDIR}/share/misc ${TOOLDIR}/bin/${_TOOL_PREFIX}msgc
575 TOOL_MTREE= ${TOOLDIR}/bin/${_TOOL_PREFIX}mtree
576 TOOL_MVME68KWRTVID= ${TOOLDIR}/bin/${_TOOL_PREFIX}mvme68k-wrtvid
577 TOOL_NBPERF= ${TOOLDIR}/bin/${_TOOL_PREFIX}perf
578 TOOL_NCDCS= ${TOOLDIR}/bin/${_TOOL_PREFIX}ibmnws-ncdcs
579 TOOL_PAX= ${TOOLDIR}/bin/${_TOOL_PREFIX}pax
580 TOOL_PIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}pic
581 TOOL_PIGZ= ${TOOLDIR}/bin/${_TOOL_PREFIX}pigz
582 TOOL_PKG_CREATE= ${TOOLDIR}/bin/${_TOOL_PREFIX}pkg_create
583 TOOL_POWERPCMKBOOTIMAGE=${TOOLDIR}/bin/${_TOOL_PREFIX}powerpc-mkbootimage
584 TOOL_PWD_MKDB= ${TOOLDIR}/bin/${_TOOL_PREFIX}pwd_mkdb
585 TOOL_REFER= ${TOOLDIR}/bin/${_TOOL_PREFIX}refer
586 TOOL_ROFF_ASCII= ${TOOL_GROFF_ENV} ${TOOLDIR}/bin/${_TOOL_PREFIX}nroff
587 TOOL_ROFF_DOCASCII= ${TOOL_GROFF} -Tascii
588 TOOL_ROFF_DOCHTML= ${TOOL_GROFF} -Thtml
589 TOOL_ROFF_DVI= ${TOOL_GROFF} -Tdvi ${ROFF_PAGESIZE}
590 TOOL_ROFF_HTML= ${TOOL_GROFF} -Tlatin1 -mdoc2html
591 TOOL_ROFF_PS= ${TOOL_GROFF} -Tps ${ROFF_PAGESIZE}
592 TOOL_ROFF_RAW= ${TOOL_GROFF} -Z
593 TOOL_RPCGEN= RPCGEN_CPP=${CPP:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}rpcgen
594 TOOL_SED= ${TOOLDIR}/bin/${_TOOL_PREFIX}sed
595 TOOL_SLC= ${TOOLDIR}/bin/${_TOOL_PREFIX}slc
596 TOOL_SOELIM= ${TOOLDIR}/bin/${_TOOL_PREFIX}soelim
597 TOOL_SORTINFO= ${TOOLDIR}/bin/${_TOOL_PREFIX}sortinfo
598 TOOL_SPARKCRC= ${TOOLDIR}/bin/${_TOOL_PREFIX}sparkcrc
599 TOOL_STAT= ${TOOLDIR}/bin/${_TOOL_PREFIX}stat
600 TOOL_STRFILE= ${TOOLDIR}/bin/${_TOOL_PREFIX}strfile
601 TOOL_SUNLABEL= ${TOOLDIR}/bin/${_TOOL_PREFIX}sunlabel
602 TOOL_TBL= ${TOOLDIR}/bin/${_TOOL_PREFIX}tbl
603 TOOL_TIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}tic
604 TOOL_UUDECODE= ${TOOLDIR}/bin/${_TOOL_PREFIX}uudecode
605 TOOL_VAXMOPCOPY= ${TOOLDIR}/bin/${_TOOL_PREFIX}vax-mopcopy
606 TOOL_VFONTEDPR= ${TOOLDIR}/libexec/${_TOOL_PREFIX}vfontedpr
607 TOOL_VGRIND= ${TOOLDIR}/bin/${_TOOL_PREFIX}vgrind -f
608 TOOL_XZ= ${TOOLDIR}/bin/${_TOOL_PREFIX}xz
609 TOOL_ZIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}zic
610
611 .else # USETOOLS != yes # } {
612
613 # Clang supports C, C++ and Objective C
614 TOOL_CC.clang= clang
615 TOOL_CPP.clang= clang-cpp
616 TOOL_CXX.clang= clang++
617 TOOL_OBJC.clang= clang
618
619 # GCC supports C, C++, Fortran and Objective C
620 TOOL_CC.gcc= gcc
621 TOOL_CPP.gcc= cpp
622 TOOL_CXX.gcc= c++
623 TOOL_FC.gcc= gfortran
624 TOOL_OBJC.gcc= gcc
625
626 # PCC supports C and Fortran
627 TOOL_CC.pcc= pcc
628 TOOL_CPP.pcc= pcpp
629 TOOL_CXX.pcc= p++
630
631 TOOL_AMIGAAOUT2BB= amiga-aout2bb
632 TOOL_AMIGAELF2BB= amiga-elf2bb
633 TOOL_AMIGATXLT= amiga-txlt
634 TOOL_ARMELF2AOUT= arm-elf2aout
635 TOOL_ASN1_COMPILE= asn1_compile
636 TOOL_AWK= awk
637 TOOL_CAP_MKDB= cap_mkdb
638 TOOL_CAT= cat
639 TOOL_CKSUM= cksum
640 TOOL_CLANG_TBLGEN= clang-tblgen
641 TOOL_COMPILE_ET= compile_et
642 TOOL_CONFIG= config
643 TOOL_CRUNCHGEN= crunchgen
644 TOOL_CTAGS= ctags
645 TOOL_CTFCONVERT= ctfconvert
646 TOOL_CTFMERGE= ctfmerge
647 TOOL_CVSLATEST= cvslatest
648 TOOL_DATE= date
649 TOOL_DB= db
650 TOOL_DISKLABEL= disklabel
651 TOOL_DTC= dtc
652 TOOL_ELFTOSB= elftosb
653 TOOL_EQN= eqn
654 TOOL_FDISK= fdisk
655 TOOL_FGEN= fgen
656 TOOL_FILE= file
657 TOOL_GENASSYM= genassym
658 TOOL_GENCAT= gencat
659 TOOL_GMAKE= gmake
660 TOOL_GPT= gpt
661 TOOL_GREP= grep
662 TOOL_GROFF= groff
663 TOOL_GROPS= grops
664 TOOL_HEXDUMP= hexdump
665 TOOL_HP300MKBOOT= hp300-mkboot
666 TOOL_HPPAMKBOOT= hppa-mkboot
667 TOOL_INDXBIB= indxbib
668 TOOL_INSTALLBOOT= installboot
669 TOOL_INSTALL_INFO= install-info
670 TOOL_JOIN= join
671 TOOL_LLVM_TBLGEN= llvm-tblgen
672 TOOL_M4= m4
673 TOOL_M68KELF2AOUT= m68k-elf2aout
674 TOOL_MACPPCFIXCOFF= macppc-fixcoff
675 TOOL_MAKEFS= makefs
676 TOOL_MAKEINFO= makeinfo
677 TOOL_MAKEKEYS= makekeys
678 TOOL_MAKESTRS= makestrs
679 TOOL_MAKEWHATIS= /usr/libexec/makewhatis
680 TOOL_MANDOC_ASCII= mandoc -Tascii
681 TOOL_MANDOC_HTML= mandoc -Thtml
682 TOOL_MANDOC_LINT= mandoc -Tlint
683 TOOL_MDSETIMAGE= mdsetimage
684 TOOL_MENUC= menuc
685 TOOL_MIPSELF2ECOFF= mips-elf2ecoff
686 TOOL_MKCSMAPPER= mkcsmapper
687 TOOL_MKESDB= mkesdb
688 TOOL_MKLOCALE= mklocale
689 TOOL_MKMAGIC= file
690 TOOL_MKNOD= mknod
691 TOOL_MKTEMP= mktemp
692 TOOL_MKUBOOTIMAGE= mkubootimage
693 TOOL_MSGC= msgc
694 TOOL_MTREE= mtree
695 TOOL_MVME68KWRTVID= wrtvid
696 TOOL_NBPERF= nbperf
697 TOOL_NCDCS= ncdcs
698 TOOL_PAX= pax
699 TOOL_PIC= pic
700 TOOL_PIGZ= pigz
701 TOOL_PKG_CREATE= pkg_create
702 TOOL_POWERPCMKBOOTIMAGE=powerpc-mkbootimage
703 TOOL_PWD_MKDB= pwd_mkdb
704 TOOL_REFER= refer
705 TOOL_ROFF_ASCII= nroff
706 TOOL_ROFF_DOCASCII= ${TOOL_GROFF} -Tascii
707 TOOL_ROFF_DOCHTML= ${TOOL_GROFF} -Thtml
708 TOOL_ROFF_DVI= ${TOOL_GROFF} -Tdvi ${ROFF_PAGESIZE}
709 TOOL_ROFF_HTML= ${TOOL_GROFF} -Tlatin1 -mdoc2html
710 TOOL_ROFF_PS= ${TOOL_GROFF} -Tps ${ROFF_PAGESIZE}
711 TOOL_ROFF_RAW= ${TOOL_GROFF} -Z
712 TOOL_RPCGEN= rpcgen
713 TOOL_SED= sed
714 TOOL_SOELIM= soelim
715 TOOL_SORTINFO= sortinfo
716 TOOL_SPARKCRC= sparkcrc
717 TOOL_STAT= stat
718 TOOL_STRFILE= strfile
719 TOOL_SUNLABEL= sunlabel
720 TOOL_TBL= tbl
721 TOOL_TIC= tic
722 TOOL_UUDECODE= uudecode
723 TOOL_VAXMOPCOPY= vax-mopcopy
724 TOOL_VFONTEDPR= /usr/libexec/vfontedpr
725 TOOL_VGRIND= vgrind -f
726 TOOL_XZ= xz
727 TOOL_ZIC= zic
728
729 .endif # USETOOLS != yes # }
730
731 # Standalone code should not be compiled with PIE or CTF
732 # Should create a better test
733 .if defined(BINDIR) && ${BINDIR} == "/usr/mdec"
734 NOCTF= # defined
735 NOPIE= # defined
736 .elif ${MACHINE_ARCH} == "m68000"
737 NOPIE= # we don't have PIC, so no PIE
738 .endif
739
740 # Fallback to ensure that all variables are defined to something
741 TOOL_CC.false= false
742 TOOL_CPP.false= false
743 TOOL_CXX.false= false
744 TOOL_FC.false= false
745 TOOL_OBJC.false= false
746
747 AVAILABLE_COMPILER?= ${HAVE_PCC:Dpcc} ${HAVE_LLVM:Dclang} ${HAVE_GCC:Dgcc} false
748
749 .for _t in CC CPP CXX FC OBJC
750 ACTIVE_${_t}= ${AVAILABLE_COMPILER:@.c.@ ${ !defined(UNSUPPORTED_COMPILER.${.c.}) && defined(TOOL_${_t}.${.c.}) :? ${.c.} : }@:[1]}
751 SUPPORTED_${_t}=${AVAILABLE_COMPILER:Nfalse:@.c.@ ${ !defined(UNSUPPORTED_COMPILER.${.c.}) && defined(TOOL_${_t}.${.c.}) :? ${.c.} : }@}
752 .endfor
753 # make bugs prevent moving this into the .for loop
754 CC= ${TOOL_CC.${ACTIVE_CC}}
755 CPP= ${TOOL_CPP.${ACTIVE_CPP}}
756 CXX= ${TOOL_CXX.${ACTIVE_CXX}}
757 FC= ${TOOL_FC.${ACTIVE_FC}}
758 OBJC= ${TOOL_OBJC.${ACTIVE_OBJC}}
759
760 #
761 # Clang and GCC compiler-specific options, usually to disable warnings.
762 # The naming convention is "CC" + the compiler flag converted
763 # to upper case, with '-' and '=' changed to '_' a la `tr -=a-z __A-Z`.
764 # For variable naming purposes, treat -Werror=FLAG as -WFLAG,
765 # and -Wno-error=FLAG as -Wno-FLAG (usually from Clang).
766 #
767 # E.g., CC_WNO_ADDRESS_OF_PACKED_MEMBER contains
768 # both -Wno-error=address-of-packed-member for Clang,
769 # and -Wno-address-of-packed-member for GCC 9+.
770 #
771 # Use these with e.g.
772 # COPTS.foo.c+= ${CC_WNO_ADDRESS_OF_PACKED_MEMBER}
773 #
774 CC_WNO_ADDRESS_OF_PACKED_MEMBER=${${ACTIVE_CC} == "clang" :? -Wno-error=address-of-packed-member :} \
775 ${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 9:? -Wno-address-of-packed-member :}
776
777 CC_WNO_ARRAY_BOUNDS= ${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 12:? -Wno-array-bounds :}
778 CC_WNO_CALLOC_TRANSPOSED_ARGS= ${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 14:? -Wno-calloc-transposed-args :}
779 CC_WNO_CAST_FUNCTION_TYPE= ${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 8:? -Wno-cast-function-type :}
780 CC_WNO_DANGLING_POINTER= ${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 14:? -Wno-dangling-pointer :}
781 CC_WNO_ENUM_INT_MISMATCH= ${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 14:? -Wno-enum-int-mismatch :}
782 CC_WNO_FORMAT_OVERFLOW= ${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 7:? -Wno-format-overflow :}
783 CC_WNO_FORMAT_TRUNCATION= ${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 7:? -Wno-format-truncation :}
784 CC_WNO_IMPLICIT_FALLTHROUGH= ${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 7:? -Wno-implicit-fallthrough :}
785 CC_WNO_MAYBE_UNINITIALIZED= ${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 10:? -Wno-maybe-uninitialized :}
786 CC_WNO_MISSING_TEMPLATE_KEYWORD=${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 12:? -Wno-missing-template-keyword :}
787 CC_WNO_REGISTER= ${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 12:? -Wno-register :}
788 CC_WNO_RETURN_LOCAL_ADDR= ${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 10:? -Wno-return-local-addr :}
789 CC_WNO_STRINGOP_OVERFLOW= ${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 7:? -Wno-stringop-overflow :}
790 CC_WNO_STRINGOP_OVERREAD= ${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 12:? -Wno-stringop-overread :}
791 CC_WNO_STRINGOP_TRUNCATION= ${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 8:? -Wno-stringop-truncation :}
792
793 # relative relocs are only supported in gnu ld for ppc64 and x86
794 .if \
795 ${MACHINE_ARCH} == "i386" || \
796 ${MACHINE_ARCH} == "powerpc64" || \
797 ${MACHINE_ARCH} == "x86_64"
798 LD_PACK_RELATIVE_RELOCS= -Wl,-z,pack-relative-relocs
799 LD_NOPACK_RELATIVE_RELOCS= -Wl,-z,nopack-relative-relocs
800 .endif
801
802 # For each ${MACHINE_CPU}, list the ports that use it.
803 MACHINES.aarch64= evbarm
804 MACHINES.alpha= alpha
805 MACHINES.arm= acorn32 cats epoc32 evbarm hpcarm \
806 iyonix netwinder shark zaurus
807 MACHINES.coldfire= evbcf
808 MACHINES.hppa= hppa
809 MACHINES.i386= i386
810 MACHINES.ia64= ia64
811 MACHINES.m68000= sun2 hb68k
812 MACHINES.m68k= amiga atari cesfic hp300 luna68k mac68k \
813 mvme68k news68k next68k sun3 virt68k x68k
814 MACHINES.m68ksf= mac68k
815 MACHINES.mips= algor arc cobalt emips evbmips ews4800mips \
816 hpcmips mipsco newsmips pmax sbmips sgimips
817 MACHINES.or1k= or1k
818 MACHINES.powerpc= amigappc bebox evbppc ibmnws macppc mvmeppc \
819 ofppc prep rs6000 sandpoint
820 MACHINES.riscv= riscv
821 MACHINES.sh3= dreamcast evbsh3 hpcsh landisk mmeye
822 MACHINES.sparc= sparc sparc64
823 MACHINES.sparc64= sparc64
824 MACHINES.vax= vax
825 MACHINES.x86_64= amd64
826
827 # OBJCOPY flags to create a.out binaries for old firmware
828 # shared among src/distrib and ${MACHINE}/conf/Makefile.${MACHINE}.inc
829 .if ${MACHINE_CPU} == "arm"
830 OBJCOPY_ELF2AOUT_FLAGS?= \
831 -O a.out-arm-netbsd \
832 -R .ident \
833 -R .ARM.attributes \
834 -R .ARM.exidx \
835 -R .ARM.extab \
836 -R .SUNW_ctf \
837 -R .arm.atpcs \
838 -R .comment \
839 -R .debug_abbrev \
840 -R .debug_aranges \
841 -R .debug_info \
842 -R .debug_line \
843 -R .debug_frame \
844 -R .debug_loc \
845 -R .debug_pubnames \
846 -R .debug_pubtypes \
847 -R .debug_ranges \
848 -R .debug_str \
849 -R .debug_macinfo \
850 -R .eh_frame \
851 -R .note.netbsd.ident
852 .endif
853
854 #
855 # Targets to check if DESTDIR or RELEASEDIR is provided
856 #
857 .if !target(check_DESTDIR)
858 check_DESTDIR: .PHONY .NOTMAIN
859 .if !defined(DESTDIR)
860 @echo "setenv DESTDIR before doing that!"
861 @false
862 .else
863 @true
864 .endif
865 .endif
866
867 .if !target(check_RELEASEDIR)
868 check_RELEASEDIR: .PHONY .NOTMAIN
869 .if !defined(RELEASEDIR)
870 @echo "setenv RELEASEDIR before doing that!"
871 @false
872 .else
873 @true
874 .endif
875 .endif
876
877 #
878 # Where the system object and source trees are kept; can be configurable
879 # by the user in case they want them in ~/foosrc and ~/fooobj (for example).
880 #
881 BSDSRCDIR?= /usr/src
882 BSDOBJDIR?= /usr/obj
883 NETBSDSRCDIR?= ${BSDSRCDIR}
884
885 BINGRP?= wheel
886 BINOWN?= root
887 BINMODE?= 555
888 NONBINMODE?= 444
889
890 # These are here mainly because we don't want suid root in case
891 # a Makefile defines BINMODE.
892 RUMPBINGRP?= wheel
893 RUMPBINOWN?= root
894 RUMPBINMODE?= 555
895 RUMPNONBINMODE?=444
896
897 MANDIR?= /usr/share/man
898 MANGRP?= wheel
899 MANOWN?= root
900 MANMODE?= ${NONBINMODE}
901 MANINSTALL?= ${_MANINSTALL}
902
903 INFODIR?= /usr/share/info
904 INFOGRP?= wheel
905 INFOOWN?= root
906 INFOMODE?= ${NONBINMODE}
907
908 LIBDIR?= /usr/lib
909
910 LINTLIBDIR?= /usr/libdata/lint
911 LIBGRP?= ${BINGRP}
912 LIBOWN?= ${BINOWN}
913 LIBMODE?= ${NONBINMODE}
914
915 DOCDIR?= /usr/share/doc
916 DOCGRP?= wheel
917 DOCOWN?= root
918 DOCMODE?= ${NONBINMODE}
919
920 NLSDIR?= /usr/share/nls
921 NLSGRP?= wheel
922 NLSOWN?= root
923 NLSMODE?= ${NONBINMODE}
924
925 KMODULEGRP?= wheel
926 KMODULEOWN?= root
927 KMODULEMODE?= ${NONBINMODE}
928
929 LOCALEDIR?= /usr/share/locale
930 LOCALEGRP?= wheel
931 LOCALEOWN?= root
932 LOCALEMODE?= ${NONBINMODE}
933
934 FIRMWAREDIR?= /libdata/firmware
935 FIRMWAREGRP?= wheel
936 FIRMWAREOWN?= root
937 FIRMWAREMODE?= ${NONBINMODE}
938
939 DEBUGDIR?= /usr/libdata/debug
940 DEBUGGRP?= wheel
941 DEBUGOWN?= root
942 DEBUGMODE?= ${NONBINMODE}
943
944 DTBDIR?= /boot/dtb
945 DTBGRP?= wheel
946 DTBOWN?= root
947 DTBMODE?= ${NONBINMODE}
948
949 MKDIRMODE?= 0755
950 MKDIRPERM?= -m ${MKDIRMODE}
951
952 #
953 # Data-driven table using make variables to control how
954 # toolchain-dependent targets and shared libraries are built
955 # for different platforms and object formats.
956 #
957 # OBJECT_FMT: currently either "ELF" or "a.out".
958 #
959 # All platforms are ELF.
960 #
961 OBJECT_FMT= ELF
962
963 #
964 # If this platform's toolchain is missing, we obviously cannot build it.
965 #
966 .if ${TOOLCHAIN_MISSING} != "no"
967 MKBINUTILS:= no
968 MKGCC:= no
969 MKGDB:= no
970 .endif
971
972 #
973 # If we are using an external toolchain, we can still build the target's
974 # binutils, but we cannot build GCC's support libraries, since those are
975 # tightly-coupled to the version of GCC being used.
976 #
977 .if defined(EXTERNAL_TOOLCHAIN)
978 MKGCC:= no
979 .endif
980
981 MKGDB.or1k= no
982
983 # No kernel modules for or1k (yet)
984 MKKMOD.or1k= no
985
986 # No profiling for or1k (yet)
987 MKPROFILE.or1k= no
988
989 #
990 # The m68000 port is incomplete.
991 #
992 .if ${MACHINE_ARCH} == "m68000"
993 NOPIC= # defined
994 MKISCSI= no
995 # XXX GCC 4 outputs mcount() calling sequences that try to load values
996 # from over 64KB away and this fails to assemble.
997 .if defined(HAVE_GCC)
998 NOPROFILE= # defined
999 .endif
1000 .endif
1001
1002 #
1003 # The ia64 port is incomplete.
1004 #
1005 MKGDB.ia64= no
1006
1007 #
1008 # On VAX using ELF, all objects are PIC, not just shared libraries,
1009 # so don't build the _pic version. VAX has no native TLS support either,
1010 # so differences between TLS models are not relevant.
1011 #
1012 MKPICLIB.vax= no
1013
1014 #
1015 # Location of the file that contains the major and minor numbers of the
1016 # version of a shared library. If this file exists a shared library
1017 # will be built by <bsd.lib.mk>.
1018 #
1019 SHLIB_VERSION_FILE?= ${.CURDIR}/shlib_version
1020
1021 #
1022 # GNU sources and packages sometimes see architecture names differently.
1023 #
1024 GNU_ARCH.aarch64eb=aarch64_be
1025 GNU_ARCH.coldfire=m5407
1026 GNU_ARCH.earm=arm
1027 GNU_ARCH.earmeb=armeb
1028 GNU_ARCH.earmhf=arm
1029 GNU_ARCH.earmhfeb=armeb
1030 GNU_ARCH.earmv4=armv4
1031 GNU_ARCH.earmv4eb=armv4eb
1032 GNU_ARCH.earmv5=arm
1033 GNU_ARCH.earmv5eb=armeb
1034 GNU_ARCH.earmv5hf=arm
1035 GNU_ARCH.earmv5hfeb=armeb
1036 GNU_ARCH.earmv6=armv6
1037 GNU_ARCH.earmv6eb=armv6eb
1038 GNU_ARCH.earmv6hf=armv6
1039 GNU_ARCH.earmv6hfeb=armv6eb
1040 GNU_ARCH.earmv7=armv7
1041 GNU_ARCH.earmv7eb=armv7eb
1042 GNU_ARCH.earmv7hf=armv7
1043 GNU_ARCH.earmv7hfeb=armv7eb
1044 GNU_ARCH.i386=i486
1045 GCC_CONFIG_ARCH.i386=i486
1046 GCC_CONFIG_TUNE.i386=nocona
1047 GCC_CONFIG_TUNE.x86_64=nocona
1048 GNU_ARCH.m68000=m68010
1049 GNU_ARCH.m68ksf=m68k
1050 GNU_ARCH.mips64eb=mips64
1051 GNU_ARCH.sh3eb=sh
1052 GNU_ARCH.sh3el=shle
1053 MACHINE_GNU_ARCH=${GNU_ARCH.${MACHINE_ARCH}:U${MACHINE_ARCH}}
1054
1055 #
1056 # In order to identify NetBSD to GNU packages, we sometimes need
1057 # an "elf" tag for historically a.out platforms.
1058 #
1059 .if (${MACHINE_ARCH:Mearm*})
1060 MACHINE_GNU_PLATFORM?=${MACHINE_GNU_ARCH}--netbsdelf-${MACHINE_ARCH:C/eb//:C/v[4-7]//:S/earm/eabi/}
1061 .elif (${MACHINE_GNU_ARCH} == "arm" || \
1062 ${MACHINE_GNU_ARCH} == "armeb" || \
1063 ${MACHINE_ARCH} == "i386" || \
1064 ${MACHINE_CPU} == "m68k" || \
1065 ${MACHINE_GNU_ARCH} == "sh" || \
1066 ${MACHINE_GNU_ARCH} == "shle" || \
1067 ${MACHINE_ARCH} == "sparc" || \
1068 ${MACHINE_ARCH} == "vax")
1069 MACHINE_GNU_PLATFORM?=${MACHINE_GNU_ARCH}--netbsdelf
1070 .else
1071 MACHINE_GNU_PLATFORM?=${MACHINE_GNU_ARCH}--netbsd
1072 .endif
1073
1074 .if ${MACHINE_ARCH:M*arm*}
1075 # Flags to pass to CC for using the old APCS ABI on ARM for compat or stand.
1076 ARM_APCS_FLAGS= -mabi=apcs-gnu -mfloat-abi=soft -marm
1077 ARM_APCS_FLAGS+= ${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 8:? -mno-thumb-interwork :}
1078 ARM_APCS_FLAGS+=${${ACTIVE_CC} == "clang":? -target ${MACHINE_GNU_ARCH}--netbsdelf -B ${TOOLDIR}/${MACHINE_GNU_PLATFORM}/bin :}
1079 .endif
1080
1081 GENASSYM_CPPFLAGS+= ${${ACTIVE_CC} == "clang":? -no-integrated-as :}
1082
1083 TARGETS+= all clean cleandir depend dependall includes \
1084 install lint obj regress tags html analyze describe \
1085 rumpdescribe
1086 PHONY_NOTMAIN = all clean cleandir depend dependall distclean includes \
1087 install lint obj regress beforedepend afterdepend \
1088 beforeinstall afterinstall realinstall realdepend realall \
1089 html subdir-all subdir-install subdir-depend analyze describe \
1090 rumpdescribe
1091 .PHONY: ${PHONY_NOTMAIN}
1092 .NOTMAIN: ${PHONY_NOTMAIN}
1093
1094 .if ${NEED_OWN_INSTALL_TARGET} != "no"
1095 .if !target(install)
1096 install: beforeinstall .WAIT subdir-install realinstall .WAIT afterinstall
1097 beforeinstall:
1098 subdir-install:
1099 realinstall:
1100 afterinstall:
1101 .endif
1102 all: realall subdir-all
1103 subdir-all:
1104 realall:
1105 depend: realdepend subdir-depend
1106 subdir-depend:
1107 realdepend:
1108 distclean: cleandir
1109 cleandir: clean
1110
1111 dependall: .NOTMAIN realdepend .MAKE
1112 @cd "${.CURDIR}"; ${MAKE} realall
1113 .endif
1114
1115 #
1116 # Define MKxxx variables (which are either yes or no) for users
1117 # to set in /etc/mk.conf and override in the make environment.
1118 # These should be tested with `== "no"' or `!= "no"'.
1119 # The NOxxx variables should only be set by Makefiles.
1120 #
1121 # Please keep etc/Makefile and share/man/man5/mk.conf.5 in sync
1122 # with changes to the MK* variables here.
1123 #
1124
1125 #
1126 # Supported NO* options (if defined, MK* will be forced to "no",
1127 # regardless of user's mk.conf setting).
1128 #
1129 # Source makefiles should set NO*, and not MK*, and must do so before
1130 # including bsd.own.mk.
1131 # Please keep alphabetically sorted with one entry per line.
1132 #
1133 _NOVARS= \
1134 NOCOMPAT \
1135 NODEBUGLIB \
1136 NODOC \
1137 NOHTML \
1138 NOINFO \
1139 NOLIBCSANITIZER \
1140 NOLINKLIB \
1141 NOLINT \
1142 NOMAN \
1143 NONLS \
1144 NOOBJ \
1145 NOPIC \
1146 NOPICINSTALL \
1147 NOPIE \
1148 NOPROFILE \
1149 NORELRO \
1150 NOSANITIZER \
1151 NOSHARE \
1152 NOSTATICLIB
1153
1154 .for var in ${_NOVARS}
1155 .if defined(${var})
1156 MK${var:S/^NO//}:= no
1157 .endif
1158 .endfor
1159
1160 #
1161 # MK* options which have variable defaults.
1162 #
1163
1164 #
1165 # aarch64eb is not yet supported for MKCOMPAT.
1166 #
1167 .if \
1168 (${MACHINE_ARCH} == "aarch64" && ${HAVE_GCC:U0} == 0) || \
1169 ${MACHINE_MIPS64} || \
1170 ${MACHINE_ARCH} == "powerpc64" || \
1171 ${MACHINE_ARCH} == "riscv64" || \
1172 ${MACHINE_ARCH} == "sparc64" || \
1173 ${MACHINE_ARCH} == "x86_64"
1174 MKCOMPAT?= yes
1175 .else
1176 # Don't let this build where it really isn't supported.
1177 MKCOMPAT:= no
1178 .endif
1179
1180 .if ${MKCOMPAT} == "no"
1181 MKCOMPATTESTS:= no
1182 MKCOMPATX11:= no
1183 .endif
1184
1185 .if \
1186 (${MACHINE} == "evbppc" && ${MACHINE_ARCH} == "powerpc") || \
1187 ${MACHINE_MIPS64}
1188 MKCOMPATMODULES?= yes
1189 .else
1190 MKCOMPATMODULES:= no
1191 .endif
1192
1193 #
1194 # These platforms use softfloat by default.
1195 #
1196 .if ${MACHINE_MIPS64}
1197 MKSOFTFLOAT?= yes
1198 .endif
1199
1200 #
1201 # These platforms always use softfloat.
1202 #
1203 .if \
1204 (${MACHINE_CPU} == "arm" && ${MACHINE_ARCH:M*hf*} == "") || \
1205 ${MACHINE_ARCH} == "coldfire" || \
1206 ${MACHINE} == "emips" || \
1207 ${MACHINE_ARCH} == "m68ksf" || \
1208 ${MACHINE_CPU} == "or1k" || \
1209 ${MACHINE_CPU} == "sh3"
1210 MKSOFTFLOAT= yes
1211 .endif
1212
1213 .if ${MACHINE} == "emips"
1214 SOFTFLOAT_BITS= 32
1215 .endif
1216
1217 MKSOFTFLOAT?= no
1218 #
1219 # Prefer libc's softfloat.c
1220 #
1221 .if ${MKSOFTFLOAT} != "no"
1222 MKLIBCSOFTFLOAT?= yes
1223 .else
1224 MKLIBCSOFTFLOAT= no
1225 .endif
1226
1227 #
1228 # We want to build zfs only for aarch64{,be}, amd64, riscv64, and sparc64
1229 # by default for now.
1230 #
1231 .if \
1232 ${MACHINE_ARCH:Maarch64*} || \
1233 ${MACHINE} == "amd64" || \
1234 ${MACHINE_ARCH} == "riscv64" || \
1235 ${MACHINE} == "sparc64"
1236 MKZFS?= yes
1237 .endif
1238
1239 #
1240 # DTrace works on aarch64, earm*, i386, and x86_64
1241 #
1242 .if \
1243 ${MACHINE_ARCH} == "aarch64" || \
1244 ${MACHINE_ARCH:Mearm*} || \
1245 ${MACHINE_ARCH} == "i386" || \
1246 ${MACHINE_ARCH} == "x86_64"
1247 MKDTRACE?= yes
1248 MKCTF?= yes
1249 .endif
1250
1251 #
1252 # PIE is enabled on many platforms by default.
1253 #
1254 # Coverity does not like PIE
1255 .if !defined(COVERITY_TOP_CONFIG) && ( \
1256 ${MACHINE_ARCH:Maarch64*} || \
1257 ${MACHINE_CPU} == "arm" || \
1258 ${MACHINE_ARCH} == "i386" || \
1259 ${MACHINE} == "macppc" || \
1260 ${MACHINE_CPU} == "m68k" || \
1261 ${MACHINE_CPU} == "mips" || \
1262 ${MACHINE_CPU} == "sh3" || \
1263 ${MACHINE} == "sparc64" || \
1264 ${MACHINE_ARCH} == "x86_64" \
1265 )
1266 MKPIE?= yes
1267 .else
1268 MKPIE?= no
1269 .endif
1270
1271 #
1272 # RELRO is enabled on aarch64, amd64, i386, and mip64 by default
1273 #
1274 # sync with NORELRO in compat/*/*/bsd.*.mk for the relro-enabled 64-bit
1275 # platforms with relro-disabled 32-bit compat
1276 #
1277 .if \
1278 ${MACHINE_ARCH:Maarch64*} || \
1279 ${MACHINE} == "amd64" || \
1280 ${MACHINE} == "i386" || \
1281 ${MACHINE_MIPS64}
1282 MKRELRO?= partial
1283 .else
1284 MKRELRO?= no
1285 .endif
1286
1287 .if \
1288 ${MACHINE_ARCH} == "i386" || \
1289 ${MACHINE_ARCH} == "x86_64"
1290 MKSTATICPIE?= yes
1291 .else
1292 MKSTATICPIE?= no
1293 .endif
1294
1295 #
1296 # MK* options which default to "yes".
1297 # Please keep alphabetically sorted with one entry per line.
1298 #
1299 _MKVARS.yes= \
1300 MKADOSFS \
1301 MKARGON2 \
1302 MKATF \
1303 MKAUDIO \
1304 MKAUTOFS \
1305 MKBIND \
1306 MKBINUTILS \
1307 MKBLUETOOTH \
1308 MKBSDDIFF \
1309 MKBSDTAR \
1310 MKCD9660FS \
1311 MKCHFS \
1312 MKCLEANSRC \
1313 MKCLEANVERIFY \
1314 MKCOMPLEX \
1315 MKCVS \
1316 MKCXX \
1317 MKDOC \
1318 MKDTC \
1319 MKDYNAMICROOT \
1320 MKEFS \
1321 MKEXT2FS \
1322 MKFDESCFS \
1323 MKFIDO2 \
1324 MKFILECOREFS \
1325 MKGCC \
1326 MKGDB \
1327 MKGROFF \
1328 MKHESIOD \
1329 MKHFS \
1330 MKHTML \
1331 MKIEEEFP \
1332 MKINET6 \
1333 MKINFO \
1334 MKIPFILTER \
1335 MKIPSEC \
1336 MKISCSI \
1337 MKKERBEROS \
1338 MKKERNFS \
1339 MKKMOD \
1340 MKLDAP \
1341 MKLFS \
1342 MKLIBSTDCXX \
1343 MKLINKLIB \
1344 MKLVM \
1345 MKMAKEMANDB \
1346 MKMAN \
1347 MKMANDOC \
1348 MKMDNS \
1349 MKMSDOSFS \
1350 MKNFS \
1351 MKNILFS \
1352 MKNLS \
1353 MKNPF \
1354 MKNTFS \
1355 MKNULLFS \
1356 MKOBJ \
1357 MKOVERLAYFS \
1358 MKPAM \
1359 MKPF \
1360 MKPIC \
1361 MKPICLIB \
1362 MKPOSTFIX \
1363 MKPROCFS \
1364 MKPROFILE \
1365 MKPTYFS \
1366 MKQEMUFWCFG \
1367 MKRAID \
1368 MKRUMP \
1369 MKSHARE \
1370 MKSKEY \
1371 MKSSH \
1372 MKSTATICLIB \
1373 MKSTRIPSYM \
1374 MKSYSVBFS \
1375 MKTMPFS \
1376 MKUDF \
1377 MKUMAPFS \
1378 MKUNBOUND \
1379 MKUNIONFS \
1380 MKUSB \
1381 MKV7FS \
1382 MKWLAN \
1383 MKX11FONTS \
1384 MKYP
1385
1386 #
1387 # Systems with MACHINE_ARCH == m68000 are extremely limited in terms
1388 # of available system resources. Trim down the base set of system
1389 # features accordingly.
1390 #
1391 MKADOSFS.m68000?= no
1392 MKAUDIO.m68000?= no
1393 MKAUTOFS.m68000?= no
1394 MKBIND.m68000?= no
1395 MKBLUETOOTH.m68000?= no
1396 MKBSDTAR.m68000?= no
1397 MKCHFS.m68000?= no
1398 MKDTC.m68000?= no
1399 MKEFS.m68000?= no
1400 MKEXT2FS.m68000?= no
1401 MKFDESCFS.m68000?= no
1402 MKFIDO2.m68000?= no
1403 MKFILECOREFS.m68000?= no
1404 MKGROFF.m68000?= no
1405 MKHESIOD.m68000?= no
1406 MKHFS.m68000?= no
1407 MKHTML.m68000?= no
1408 MKINET6.m68000?= no
1409 MKIPFILTER.m68000?= no
1410 MKIPSEC.m68000?= no
1411 MKISCSI.m68000?= no
1412 MKLDAP.m68000?= no
1413 MKLFS.m68000?= no
1414 MKLVM.m68000?= no
1415 MKMSDOSFS.m68000?= no
1416 MKNILFS.m68000?= no
1417 MKNPF.m68000?= no
1418 MKNTFS.m68000?= no
1419 MKNULLFS.m68000?= no
1420 MKOVERLAYFS.m68000?= no
1421 MKPAM.m68000?= no
1422 MKPF.m68000?= no
1423 MKPOSTFIX.m68000?= no
1424 MKPROCFS.m68000?= no
1425 MKQEMUFWCFG.m68000?= no
1426 MKRAID.m68000?= no
1427 MKRUMP.m68000?= no
1428 MKSSH.m68000?= no
1429 MKSYSVBFS.m68000?= no
1430 MKTMPFS.m68000?= no
1431 MKUDF.m68000?= no
1432 MKUMAPFS.m68000?= no
1433 MKUNBOUND.m68000?= no
1434 MKUNIONFS.m68000?= no
1435 MKUSB.m68000?= no
1436 MKV7FS.m68000?= no
1437 MKWLAN.m68000?= no
1438
1439 .for var in ${_MKVARS.yes}
1440 ${var}?= ${${var}.${MACHINE_ARCH}:U${${var}.${MACHINE}:Uyes}}
1441 .endfor
1442
1443 #
1444 # MKGCCCMDS is only valid if we are building GCC so make it dependent on that.
1445 #
1446 _MKVARS.yes += MKGCCCMDS
1447 MKGCCCMDS?= ${MKGCC}
1448
1449 #
1450 # Sanitizers, only "address" and "undefined" are supported by gcc
1451 #
1452 MKSANITIZER?= no
1453 USE_SANITIZER?= address
1454
1455 #
1456 # Sanitizers implemented in libc, only "undefined" is supported
1457 #
1458 MKLIBCSANITIZER?= no
1459 USE_LIBCSANITIZER?= undefined
1460
1461 #
1462 # Exceptions to the above:
1463 #
1464
1465 # RUMP uses -nostdinc which coverity does not like
1466 # It also does not use many new files, so disable it
1467 .if defined(COVERITY_TOP_CONFIG)
1468 MKRUMP= no
1469 .endif
1470
1471 #
1472 # Build a dynamically linked /bin and /sbin, with the necessary shared
1473 # libraries moved from /usr/lib to /lib and the shared linker moved
1474 # from /usr/libexec to /lib
1475 #
1476 # Note that if the BINDIR is not /bin or /sbin, then we always use the
1477 # non-DYNAMICROOT behavior (i.e. it is only enabled for programs in /bin
1478 # and /sbin). See <bsd.shlib.mk>.
1479 #
1480 # For ia64, ld.elf_so not yet implemented
1481 .if ${MACHINE_ARCH} == "ia64"
1482 MKDYNAMICROOT= no
1483 .endif
1484
1485 .if defined(MKREPRO)
1486 MKARZERO ?= ${MKREPRO}
1487 GROFF_FLAGS ?= -dpaper=letter
1488 ROFF_PAGESIZE ?= -P-pletter
1489 .endif
1490
1491 #
1492 # Install the kernel as /netbsd/kernel and the modules in /netbsd/modules
1493 #
1494 KERNEL_DIR?= no
1495
1496 # Only install the general firmware on some systems
1497 MKFIRMWARE.amd64= yes
1498 MKFIRMWARE.cobalt= yes
1499 MKFIRMWARE.evbarm= yes
1500 MKFIRMWARE.evbmips= yes
1501 MKFIRMWARE.evbppc= yes
1502 MKFIRMWARE.hpcarm= yes
1503 MKFIRMWARE.hppa= yes
1504 MKFIRMWARE.i386= yes
1505 MKFIRMWARE.mac68k= yes
1506 MKFIRMWARE.macppc= yes
1507 MKFIRMWARE.riscv= yes
1508 MKFIRMWARE.sandpoint= yes
1509 MKFIRMWARE.sparc64= yes
1510
1511 # Only install the GPU firmware on DRM-happy systems.
1512 MKAMDGPUFIRMWARE.x86_64= yes
1513 MKNOUVEAUFIRMWARE.aarch64= yes
1514 MKNOUVEAUFIRMWARE.i386= yes
1515 MKNOUVEAUFIRMWARE.x86_64= yes
1516 MKRADEONFIRMWARE.aarch64= yes
1517 MKRADEONFIRMWARE.i386= yes
1518 MKRADEONFIRMWARE.x86_64= yes
1519
1520 # Only install the tegra firmware on evbarm.
1521 MKTEGRAFIRMWARE.evbarm= yes
1522
1523 # Only build devicetree (dtb) files on armv5, armv6, armv7, aarch64,
1524 # and risc-v.
1525 MKDTB.aarch64= yes
1526 MKDTB.aarch64eb= yes
1527 MKDTB.earmv5= yes
1528 MKDTB.earmv5hf= yes
1529 MKDTB.earmv6= yes
1530 MKDTB.earmv6eb= yes
1531 MKDTB.earmv6hf= yes
1532 MKDTB.earmv6hfeb= yes
1533 MKDTB.earmv7= yes
1534 MKDTB.earmv7eb= yes
1535 MKDTB.earmv7hf= yes
1536 MKDTB.earmv7hfeb= yes
1537 MKDTB.riscv32= yes
1538 MKDTB.riscv64= yes
1539
1540 # During transition from xorg-server 1.10 to 1.20
1541 # XXX sgimips uses XAA which is removed in 1.20, and EXA is hard
1542 # XXX to do the same with.
1543 .if ${MACHINE} == "sgimips"
1544 HAVE_XORG_SERVER_VER?=110
1545 .else
1546 HAVE_XORG_SERVER_VER?=120
1547 .endif
1548
1549 # Newer Mesa does not build with old X server
1550 .if ${HAVE_XORG_SERVER_VER} != "120"
1551 HAVE_MESA_VER?=19
1552 .endif
1553
1554 HAVE_MESA_VER?= 21
1555 .if ${HAVE_MESA_VER} == 19
1556 EXTERNAL_MESALIB_DIR?= MesaLib.old
1557 .elif ${HAVE_MESA_VER} == 21
1558 EXTERNAL_MESALIB_DIR?= MesaLib
1559 .endif
1560
1561 # Default to LLVM run-time if x86 or aarch64 and X11 and Mesa 18 or newer
1562 # XXX This knows that MKX11=no is default below, but would
1563 # require splitting the below loop in two parts.
1564 .if ${MKX11:Uno} != "no" && ${HAVE_MESA_VER} >= 19
1565 MKLLVMRT.aarch64= yes
1566 MKLLVMRT.amd64= yes
1567 MKLLVMRT.i386= yes
1568 .endif
1569
1570 # Just-in-time compiler for bpf, npf acceleration
1571 MKSLJIT.aarch64= yes
1572 MKSLJIT.i386= yes
1573 MKSLJIT.sparc= yes
1574 MKSLJIT.x86_64= yes
1575 #MKSLJIT.mips64eb= yes # XXX
1576 #MKSLJIT.mips64el= yes # XXX
1577 #MKSLJIT.mipseb= yes # XXX
1578 #MKSLJIT.mipsel= yes # XXX
1579 #MKSLJIT.powerpc64= yes # XXX
1580 #MKSLJIT.powerpc= yes # XXX
1581 #MKSLJIT.riscv32= yes # not until we update sljit
1582 #MKSLJIT.riscv64= yes # not until we update sljit
1583 #MKSLJIT.sparc64= yes # not suppored in sljit (yet?)
1584
1585 # compat with old names
1586 MKDEBUGKERNEL?=${MKKDEBUG:Uno}
1587 MKDEBUGTOOLS?=${MKTOOLSDEBUG:Uno}
1588
1589 #
1590 # MK* options which default to "no".
1591 # Note that MKZFS has a different default for some platforms, see above.
1592 # Please keep alphabetically sorted with one entry per line.
1593 #
1594 _MKVARS.no= \
1595 MKAMDGPUFIRMWARE \
1596 MKARZERO \
1597 MKDEBUGKERNEL \
1598 MKBSDGREP \
1599 MKCATPAGES \
1600 MKCOMPATTESTS \
1601 MKCOMPATX11 \
1602 MKCTF \
1603 MKDEBUG \
1604 MKDEBUGLIB \
1605 MKDEPINCLUDES \
1606 MKDTB \
1607 MKDTRACE \
1608 MKFIRMWARE \
1609 MKGROFFHTMLDOC \
1610 MKHOSTOBJ \
1611 MKKYUA \
1612 MKLIBCXX \
1613 MKLINT \
1614 MKLLVM \
1615 MKLLVMRT \
1616 MKMANZ \
1617 MKNOUVEAUFIRMWARE \
1618 MKNSD \
1619 MKOBJDIRS \
1620 MKPCC \
1621 MKPICINSTALL \
1622 MKPIGZGZIP \
1623 MKRADEONFIRMWARE \
1624 MKREPRO \
1625 MKSLJIT \
1626 MKSOFTFLOAT \
1627 MKSTRIPIDENT \
1628 MKTEGRAFIRMWARE \
1629 MKTPM \
1630 MKUNPRIVED \
1631 MKUPDATE \
1632 MKX11 \
1633 MKX11MOTIF \
1634 MKXORG_SERVER \
1635 MKZFS
1636
1637 .for var in ${_MKVARS.no}
1638 ${var}?= ${${var}.${MACHINE_ARCH}:U${${var}.${MACHINE}:Uno}}
1639 .endfor
1640
1641 #
1642 # Which platforms build the xorg-server drivers (as opposed
1643 # to just Xnest and Xvfb.)
1644 #
1645 .if \
1646 ${MACHINE} == "alpha" || \
1647 ${MACHINE} == "amd64" || \
1648 ${MACHINE} == "amiga" || \
1649 ${MACHINE} == "bebox" || \
1650 ${MACHINE} == "cats" || \
1651 ${MACHINE} == "dreamcast" || \
1652 ${MACHINE} == "evbarm" || \
1653 ${MACHINE} == "evbmips" || \
1654 ${MACHINE} == "evbppc" || \
1655 ${MACHINE} == "ews4800mips" || \
1656 ${MACHINE} == "hp300" || \
1657 ${MACHINE} == "hpcarm" || \
1658 ${MACHINE} == "hpcmips" || \
1659 ${MACHINE} == "hpcsh" || \
1660 ${MACHINE} == "hppa" || \
1661 ${MACHINE} == "i386" || \
1662 ${MACHINE} == "ibmnws" || \
1663 ${MACHINE} == "iyonix" || \
1664 ${MACHINE} == "luna68k" || \
1665 ${MACHINE} == "mac68k" || \
1666 ${MACHINE} == "macppc" || \
1667 ${MACHINE} == "netwinder" || \
1668 ${MACHINE} == "newsmips" || \
1669 ${MACHINE} == "ofppc" || \
1670 ${MACHINE} == "pmax" || \
1671 ${MACHINE} == "prep" || \
1672 ${MACHINE} == "sgimips" || \
1673 ${MACHINE} == "shark" || \
1674 ${MACHINE} == "sparc" || \
1675 ${MACHINE} == "sparc64" || \
1676 ${MACHINE} == "vax" || \
1677 ${MACHINE} == "zaurus"
1678 MKXORG_SERVER=yes
1679 .endif
1680
1681 #
1682 # Force some options off if their dependencies are off.
1683 #
1684
1685 .if ${MKCXX} == "no"
1686 MKATF:= no
1687 MKGCCCMDS:= no
1688 MKGDB:= no
1689 MKGROFF:= no
1690 MKKYUA:= no
1691 .endif
1692
1693 .if ${MKMAN} == "no"
1694 MKCATPAGES:= no
1695 MKHTML:= no
1696 .endif
1697
1698 _MANINSTALL= maninstall
1699 .if ${MKCATPAGES} != "no"
1700 _MANINSTALL+= catinstall
1701 .endif
1702 .if ${MKHTML} != "no"
1703 _MANINSTALL+= htmlinstall
1704 .endif
1705
1706 .if ${MKLINKLIB} == "no"
1707 MKLINT:= no
1708 MKPICINSTALL:= no
1709 MKPROFILE:= no
1710 .endif
1711
1712 .if ${MKPIC} == "no"
1713 MKPICLIB:= no
1714 .endif
1715
1716 .if ${MKOBJ} == "no"
1717 MKOBJDIRS:= no
1718 .endif
1719
1720 .if ${MKSHARE} == "no"
1721 MKCATPAGES:= no
1722 MKDOC:= no
1723 MKHTML:= no
1724 MKINFO:= no
1725 MKMAN:= no
1726 MKNLS:= no
1727 .endif
1728
1729 .if ${MKUSB} == "no"
1730 MKFIDO2:= no
1731 .endif
1732
1733 .if ${MACHINE_ARCH:Mearm*}
1734 _NEEDS_LIBCXX.${MACHINE_ARCH}= yes
1735 .endif
1736 _NEEDS_LIBCXX.aarch64= yes
1737 _NEEDS_LIBCXX.aarch64eb= yes
1738 _NEEDS_LIBCXX.i386= yes
1739 _NEEDS_LIBCXX.powerpc= yes
1740 _NEEDS_LIBCXX.powerpc64= yes
1741 _NEEDS_LIBCXX.sparc= yes
1742 _NEEDS_LIBCXX.sparc64= yes
1743 _NEEDS_LIBCXX.x86_64= yes
1744
1745 .if ${MKLLVM} == "yes" && ${_NEEDS_LIBCXX.${MACHINE_ARCH}:Uno} == "yes"
1746 MKLIBCXX:= yes
1747 .endif
1748
1749 #
1750 # Disable MKSTRIPSYM if MKDEBUG is enabled.
1751 #
1752 .if ${MKDEBUG} != "no"
1753 MKSTRIPSYM:= no
1754 .endif
1755
1756 #
1757 # install(1) parameters.
1758 #
1759 COPY?= -c
1760 .if ${MKUPDATE} == "no"
1761 PRESERVE?=
1762 .else
1763 PRESERVE?= -p
1764 .endif
1765 RENAME?= -r
1766 HRDLINK?= -l h
1767 SYMLINK?= -l s
1768
1769 METALOG?= ${DESTDIR}/METALOG
1770 METALOG.add?= ${TOOL_CAT} -l >> ${METALOG}
1771 .if (${_SRC_TOP_} != "") # only set INSTPRIV if inside ${NETBSDSRCDIR}
1772 .if ${MKUNPRIVED} != "no"
1773 INSTPRIV.unpriv=-U -M ${METALOG} -D ${DESTDIR} -h sha256
1774 .else
1775 INSTPRIV.unpriv=
1776 .endif
1777 INSTPRIV?= ${INSTPRIV.unpriv} -N ${NETBSDSRCDIR}/etc
1778 .endif
1779 STRIPFLAG?=
1780
1781 INSTALL_DIR?= ${INSTALL} ${INSTPRIV} -d
1782 INSTALL_FILE?= ${INSTALL} ${INSTPRIV} ${COPY} ${PRESERVE} ${RENAME}
1783 INSTALL_LINK?= ${INSTALL} ${INSTPRIV} ${HRDLINK} ${RENAME}
1784 INSTALL_SYMLINK?= ${INSTALL} ${INSTPRIV} ${SYMLINK} ${RENAME}
1785
1786 # for crunchide & ldd, define the OBJECT_FMTS used by a MACHINE_ARCH
1787 #
1788 OBJECT_FMTS=
1789 .if ${MACHINE_ARCH} != "alpha" && ${MACHINE_ARCH} != "ia64"
1790 OBJECT_FMTS+= elf32
1791 .endif
1792 .if ${MACHINE_ARCH} == "alpha" || ${MACHINE_ARCH:M*64*} != ""
1793 . if !(${MKCOMPAT:Uyes} == "no" && ${MACHINE_ARCH:Mmips64*} != "")
1794 OBJECT_FMTS+= elf64
1795 . endif
1796 .endif
1797
1798 #
1799 # Set defaults for the USE_xxx variables.
1800 #
1801
1802 #
1803 # USE_* options which default to "no" and will be forced to "no" if their
1804 # corresponding MK* variable is set to "no".
1805 #
1806 .for var in USE_SKEY
1807 .if (${${var:S/USE_/MK/}} == "no")
1808 ${var}:= no
1809 .else
1810 ${var}?= no
1811 .endif
1812 .endfor
1813
1814 #
1815 # USE_* options which default to "yes" unless their corresponding MK*
1816 # variable is set to "no".
1817 #
1818 .for var in USE_HESIOD USE_INET6 USE_KERBEROS USE_LDAP USE_PAM USE_YP
1819 .if (${${var:S/USE_/MK/}} == "no")
1820 ${var}:= no
1821 .else
1822 ${var}?= yes
1823 .endif
1824 .endfor
1825
1826 #
1827 # USE_* options which default to "yes".
1828 #
1829 .for var in USE_JEMALLOC
1830 ${var}?= yes
1831 .endfor
1832
1833 #
1834 # USE_* options which default to "no".
1835 #
1836 # For now, disable pigz as compressor by default
1837 .for var in USE_PIGZGZIP
1838 ${var}?= no
1839 .endfor
1840
1841 # Default to USE_XZ_SETS on some 64bit architectures where decompressor
1842 # memory will likely not be in short supply.
1843 # Since pigz can not create .xz format files currently, disable .xz
1844 # format if USE_PIGZGZIP is enabled.
1845 .if ${USE_PIGZGZIP} == "no" && ( \
1846 ${MACHINE_ARCH:Maarch64*} || \
1847 ${MACHINE} == "amd64" \
1848 )
1849 USE_XZ_SETS?= yes
1850 .else
1851 USE_XZ_SETS?= no
1852 .endif
1853
1854 #
1855 # TOOL_GZIP and friends. These might refer to TOOL_PIGZ or to the host gzip.
1856 #
1857 .if ${USE_PIGZGZIP} != "no"
1858 TOOL_GZIP= ${TOOL_PIGZ}
1859 GZIP_N_FLAG?= -nT
1860 .else
1861 .if ${USETOOLS} == "yes"
1862 TOOL_GZIP= ${TOOLDIR}/bin/${_TOOL_PREFIX}gzip
1863 .else
1864 TOOL_GZIP= gzip
1865 .endif
1866 GZIP_N_FLAG?= -n
1867 .endif
1868 TOOL_GZIP_N= ${TOOL_GZIP} ${GZIP_N_FLAG}
1869
1870 #
1871 # Where X11 sources are and where it is installed to.
1872 #
1873 .if !defined(X11SRCDIR)
1874 .if exists(${NETBSDSRCDIR}/../xsrc)
1875 X11SRCDIR!= cd "${NETBSDSRCDIR}/../xsrc" && pwd
1876 .else
1877 X11SRCDIR= /usr/xsrc
1878 .endif
1879 .endif # !defined(X11SRCDIR)
1880
1881 X11SRCDIR.local?= ${X11SRCDIR}/local
1882 X11ROOTDIR?= /usr/X11R7
1883 X11BINDIR?= ${X11ROOTDIR}/bin
1884 X11ETCDIR?= /etc/X11
1885 X11FONTDIR?= ${X11ROOTDIR}/lib/X11/fonts
1886 X11INCDIR?= ${X11ROOTDIR}/include
1887 X11LIBDIR?= ${X11ROOTDIR}/lib/X11
1888 X11MANDIR?= ${X11ROOTDIR}/man
1889 X11SHAREDIR?= ${X11ROOTDIR}/share
1890 X11USRLIBDIR?= ${X11ROOTDIR}/lib${MLIBDIR:D/${MLIBDIR}}
1891
1892 #
1893 # New modular-xorg based builds
1894 #
1895 X11SRCDIRMIT?= ${X11SRCDIR}/external/mit
1896 .for _lib in \
1897 FS ICE SM X11 XScrnSaver XTrap Xau Xcomposite Xcursor Xdamage \
1898 Xdmcp Xevie Xext Xfixes Xfont Xfont2 Xft Xi Xinerama Xmu Xpresent Xpm \
1899 Xrandr Xrender Xres Xt Xtst Xv XvMC Xxf86dga Xxf86misc Xxf86vm drm \
1900 epoxy fontenc vdpau xkbfile xkbui Xaw pciaccess xcb xshmfence \
1901 pthread-stubs xcvt
1902 X11SRCDIR.${_lib}?= ${X11SRCDIRMIT}/lib${_lib}/dist
1903 .endfor
1904
1905 .for _proto in \
1906 xcb- xorg
1907 X11SRCDIR.${_proto}proto?= ${X11SRCDIRMIT}/${_proto}proto/dist
1908 .endfor
1909
1910 # Build glamor extension?
1911
1912 .if ${HAVE_XORG_SERVER_VER} == "120"
1913 XORG_SERVER_SUBDIR?=xorg-server
1914 . if \
1915 ${MACHINE} == "amd64" || \
1916 ${MACHINE} == "evbarm" || \
1917 ${MACHINE} == "evbppc" || \
1918 ${MACHINE} == "i386"
1919 HAVE_XORG_GLAMOR?= yes
1920 . endif
1921 HAVE_XORG_EGL?= yes
1922 .else
1923 XORG_SERVER_SUBDIR?=xorg-server.old
1924 .endif
1925
1926 X11SRCDIR.xorg-server?= ${X11SRCDIRMIT}/${XORG_SERVER_SUBDIR}/dist
1927 HAVE_XORG_GLAMOR?= no
1928 HAVE_XORG_EGL?= no
1929
1930 .for _dir in \
1931 xtrans fontconfig freetype evieext mkfontscale bdftopcf \
1932 xorg-cf-files imake xbiff xkeyboard-config \
1933 xcompmgr xbitmaps appres xeyes xev xedit sessreg pixman \
1934 brotli \
1935 beforelight bitmap editres makedepend fonttosfnt fslsfonts fstobdf \
1936 glu glw mesa-demos MesaGLUT MesaLib MesaLib.old MesaLib7 \
1937 ico iceauth listres lndir \
1938 luit xproxymanagementprotocol mkfontdir oclock proxymngr rgb \
1939 rstart setxkbmap showfont smproxy transset twm viewres \
1940 util-macros \
1941 x11perf xauth xcalc xclipboard \
1942 xclock xcmsdb xconsole xditview xdpyinfo xdriinfo xdm \
1943 xfd xf86dga xfindproxy xfontsel xgamma xgc xhost xinit \
1944 xkill xload xlogo xlsatoms xlsclients xlsfonts xmag xmessage \
1945 xmh xmodmap xmore xman xprop xrandr xrdb xrefresh xset \
1946 xsetmode xsetpointer xsetroot xsm xstdcmap xvidtune xvinfo \
1947 xwininfo xwud xkbprint xkbevd \
1948 xterm xwd xfs xfsinfo xtrap xkbutils xkbcomp \
1949 xinput xcb-util xorg-docs \
1950 font-adobe-100dpi font-adobe-75dpi font-adobe-utopia-100dpi \
1951 font-adobe-utopia-75dpi font-adobe-utopia-type1 \
1952 font-alias \
1953 font-bh-100dpi font-bh-75dpi font-bh-lucidatypewriter-100dpi \
1954 font-bh-lucidatypewriter-75dpi font-bh-ttf font-bh-type1 \
1955 font-bitstream-100dpi font-bitstream-75dpi font-bitstream-type1 \
1956 font-cursor-misc font-daewoo-misc font-dec-misc font-ibm-type1 \
1957 font-isas-misc font-jis-misc font-misc-misc font-mutt-misc \
1958 font-sony-misc font-util ttf-bitstream-vera encodings \
1959 font-arabic-misc font-micro-misc font-schumacher-misc \
1960 font-sun-misc font-cronyx-cyrillic font-misc-cyrillic \
1961 font-screen-cyrillic font-winitzki-cyrillic font-xfree86-type1
1962 X11SRCDIR.${_dir}?= ${X11SRCDIRMIT}/${_dir}/dist
1963 .endfor
1964
1965 # X11SRCDIR.Mesa points to the currently used Mesa sources
1966 X11SRCDIR.Mesa?= ${X11SRCDIRMIT}/${EXTERNAL_MESALIB_DIR}/dist
1967
1968 .for _i in \
1969 elographics keyboard mouse synaptics vmmouse void ws
1970 X11SRCDIR.xf86-input-${_i}?= ${X11SRCDIRMIT}/xf86-input-${_i}/dist
1971 .endfor
1972
1973 # xf86-video-modesetting move into the server build.
1974 EXTRA_DRIVERS=
1975 .if ${HAVE_XORG_SERVER_VER} == "120"
1976 X11SRCDIR.xf86-video-modesetting=${X11SRCDIR.xorg-server}/hw/xfree86/drivers/modesetting
1977 .else
1978 EXTRA_DRIVERS= modesetting
1979 .endif
1980
1981 .for _v in \
1982 ag10e amdgpu apm ark ast ati ati-kms chips cirrus crime \
1983 geode glint i128 i740 igs imstt intel intel-old intel-2014 \
1984 ${EXTRA_DRIVERS} mach64 mga mgx \
1985 neomagic newport ngle nouveau nsc nv openchrome pnozz \
1986 r128 rendition \
1987 s3 s3virge savage siliconmotion sis suncg14 \
1988 suncg6 sunffb sunleo suntcx \
1989 tdfx tga trident tseng vboxvideo vesa vga vmware wsfb xgi
1990 X11SRCDIR.xf86-video-${_v}?= ${X11SRCDIRMIT}/xf86-video-${_v}/dist
1991 .endfor
1992
1993
1994 X11DRI?= yes
1995 X11LOADABLE?= yes
1996
1997
1998 #
1999 # MAKEDIRTARGET dir target [extra make(1) params]
2000 # run "cd $${dir} && ${MAKEDIRTARGETENV} ${MAKE} [params] $${target}", with a pretty message
2001 #
2002 MAKEDIRTARGETENV?=
2003 MAKEDIRTARGET=\
2004 @_makedirtarget() { \
2005 dir="$$1"; shift; \
2006 target="$$1"; shift; \
2007 case "$${dir}" in \
2008 /*) this="$${dir}/"; \
2009 real="$${dir}" ;; \
2010 .) this="${_THISDIR_}"; \
2011 real="${.CURDIR}" ;; \
2012 *) this="${_THISDIR_}$${dir}/"; \
2013 real="${.CURDIR}/$${dir}" ;; \
2014 esac; \
2015 show=$${this:-.}; \
2016 echo "$${target} ===> $${show%/}$${1:+ (with: $$@)}"; \
2017 cd "$${real}" \
2018 && ${MAKEDIRTARGETENV} ${MAKE} _THISDIR_="$${this}" "$$@" $${target}; \
2019 }; \
2020 _makedirtarget
2021
2022 #
2023 # MAKEVERBOSE support. Levels are:
2024 # 0 Minimal output ("quiet")
2025 # 1 Describe what is occurring
2026 # 2 Describe what is occurring and echo the actual command
2027 # 3 Ignore the effect of the "@" prefix in make commands
2028 # 4 Trace shell commands using the shell's -x flag
2029 #
2030 MAKEVERBOSE?= 2
2031
2032 .if ${MAKEVERBOSE} == 0
2033 _MKMSG?= @\#
2034 _MKSHMSG?= : echo
2035 _MKSHECHO?= : echo
2036 .SILENT:
2037 .elif ${MAKEVERBOSE} == 1
2038 _MKMSG?= @echo ' '
2039 _MKSHMSG?= echo ' '
2040 _MKSHECHO?= : echo
2041 .SILENT:
2042 .else # MAKEVERBOSE >= 2
2043 _MKMSG?= @echo '\# '
2044 _MKSHMSG?= echo '\# '
2045 _MKSHECHO?= echo
2046 .SILENT: __makeverbose_dummy_target__
2047 .endif # MAKEVERBOSE >= 2
2048 .if ${MAKEVERBOSE} >= 3
2049 .MAKEFLAGS: -dl
2050 .endif # ${MAKEVERBOSE} >= 3
2051 .if ${MAKEVERBOSE} >= 4
2052 .MAKEFLAGS: -dx
2053 .endif # ${MAKEVERBOSE} >= 4
2054
2055 _MKMSG_BUILD?= ${_MKMSG} " build "
2056 _MKMSG_COMPILE?= ${_MKMSG} "compile "
2057 _MKMSG_CREATE?= ${_MKMSG} " create "
2058 _MKMSG_EXECUTE?= ${_MKMSG} "execute "
2059 _MKMSG_FORMAT?= ${_MKMSG} " format "
2060 _MKMSG_INSTALL?= ${_MKMSG} "install "
2061 _MKMSG_LEX?= ${_MKMSG} " lex "
2062 _MKMSG_LINK?= ${_MKMSG} " link "
2063 _MKMSG_REGEN?= ${_MKMSG} " regen "
2064 _MKMSG_REMOVE?= ${_MKMSG} " remove "
2065 _MKMSG_YACC?= ${_MKMSG} " yacc "
2066
2067 _MKSHMSG_CREATE?= ${_MKSHMSG} " create "
2068 _MKSHMSG_FORMAT?= ${_MKSHMSG} " format "
2069 _MKSHMSG_INSTALL?= ${_MKSHMSG} "install "
2070
2071 _MKTARGET_BUILD?= ${_MKMSG_BUILD} ${.CURDIR:T}/${.TARGET}
2072 _MKTARGET_COMPILE?= ${_MKMSG_COMPILE} ${.CURDIR:T}/${.TARGET}
2073 _MKTARGET_CREATE?= ${_MKMSG_CREATE} ${.CURDIR:T}/${.TARGET}
2074 _MKTARGET_FORMAT?= ${_MKMSG_FORMAT} ${.CURDIR:T}/${.TARGET}
2075 _MKTARGET_INSTALL?= ${_MKMSG_INSTALL} ${.TARGET}
2076 _MKTARGET_LEX?= ${_MKMSG_LEX} ${.CURDIR:T}/${.TARGET}
2077 _MKTARGET_LINK?= ${_MKMSG_LINK} ${.CURDIR:T}/${.TARGET}
2078 _MKTARGET_REMOVE?= ${_MKMSG_REMOVE} ${.TARGET}
2079 _MKTARGET_YACC?= ${_MKMSG_YACC} ${.CURDIR:T}/${.TARGET}
2080
2081 .if ${MKMANDOC} == "yes"
2082 TARGETS+= lintmanpages
2083 .endif
2084
2085 TESTSBASE= /usr/tests${MLIBDIR:D/${MLIBDIR}}
2086
2087 # Override with tools versions if needed
2088 .if ${MKCTF:Uno} != "no" && !defined(NOCTF) && \
2089 (exists(${TOOL_CTFCONVERT}) || exists(/usr/bin/${TOOL_CTFCONVERT}))
2090 CTFCONVERT= ${TOOL_CTFCONVERT}
2091 CTFMERGE= ${TOOL_CTFMERGE}
2092 .endif
2093
2094 .endif # !defined(_BSD_OWN_MK_)
2095