Remove building with NOCRYPTO option
[minix3.git] / share / mk / bsd.own.mk
blob946e5dece189ee16d4f8638062d39dc421409096
1 # $NetBSD: bsd.own.mk,v 1.874 2015/09/30 22:58:02 rjs Exp $
3 # This needs to be before bsd.init.mk
4 .if defined(BSD_MK_COMPAT_FILE)
5 .include <${BSD_MK_COMPAT_FILE}>
6 .endif
8 .if !defined(_BSD_OWN_MK_)
9 _BSD_OWN_MK_=1
11 .if defined(__MINIX)
13 # Some Minix deviations from NetBSD
14 LDSTATIC?= -static
15 MKDYNAMICROOT?= no
16 NO_LIBGOMP?= yes
18 BINMODE?= 755
19 NONBINMODE?= 644
20 MANDIR?= /usr/man
22 MKKYUA?= yes
23 MKMCLINKER?= no
24 MKCLANGRT?= no
25 MKGCC?= no
26 MKGCCCMDS?= no
27 MKPROFILE?= no
28 MKSLJIT?= no
30 #MINIX-specific variables
31 MKCOVERAGE?= no
33 # LSC MINIX does not support these features ATM.
34 USE_FORT:= no
35 USE_SSP:= no
36 MKCOMPAT:= no
37 MKGDB:= no
38 MKGROFF:= no
39 MKHESIOD:= no
40 MKHTML:= no
41 MKIPFILTER:= no
42 MKISCSI:= no
43 MKKERBEROS:= no
44 MKKMOD:= no
45 MKLDAP:= no
46 MKLINT:= no
47 MKLVM:= no
48 MKMDNS:= no
49 MKNPF:= no
50 MKPAM:= no
51 MKPF:= no
52 MKPOSTFIX:= no
53 MKRUMP:= no
54 MKSKEY:= no
55 MKYP:= no
56 MKCROSSGDB:= no
58 WEAKALIASOVERRIDEPASS?=${NETBSDSRCDIR}/minix/llvm/bin/weak-alias-module-override.so
59 GOLD_PLUGIN?=${NETBSDSRCDIR}/minix/llvm/bin/LLVMgold.so
61 # By default when running LLVM passes:
62 # - do not run optimization while running LLVM passes
63 # - run the passe which allows assembly weak symbols to be
64 # overriden by bitcode functions
65 OPTFLAGS?= -disable-opt \
66 -disable-inlining \
67 -load ${WEAKALIASOVERRIDEPASS} -weak-alias-module-override
69 BITCODE_LD_FLAGS_1ST?= \
70 -Wl,-plugin=${GOLD_PLUGIN} \
71 -Wl,-plugin-opt=-disable-opt \
72 -Wl,-plugin-opt=-disable-inlining
74 BITCODE_LD_FLAGS_2ND?=${BITCODE_LD_FLAGS_1ST}
76 .ifdef CONFIG_SMP
77 SMP_FLAGS += -DCONFIG_SMP
78 .ifdef CONFIG_MAX_CPUS
79 SMP_FLAGS += -DCONFIG_MAX_CPUS=${CONFIG_MAX_CPUS}
80 .endif
81 .endif
83 CPPFLAGS+= ${SMP_FLAGS}
85 # Disabled unaligned accesses on ARM
86 .if !empty(MACHINE_ARCH:Mearm*)
87 CFLAGS+= -mno-unaligned-access
88 .endif
90 __uname_s!= uname -s
91 .if ${__uname_s:Uunknown} == "Minix"
92 USETOOLS?= never
93 . if ${USETOOLS:Uno} != "yes"
94 HAVE_LLVM?= yes
96 # If DESTDIR was specified, and we are not using the tools, then make sure to
97 # build out-of-tree and to refer only DESTDIR for target binaries
98 # The case when using tools is already handled below.
99 . if ${DESTDIR:U} != ""
100 CPPFLAGS+= --sysroot=${DESTDIR}
101 LDFLAGS+= --sysroot=${DESTDIR}
102 . endif # ${DESTDIR:U} != ""
104 MKTOOLS?=no
105 . endif # ${USETOOLS:Uno} != "yes"
107 . if !defined(HOSTPROG) && !defined(HOSTLIB)
108 # LSC FIXME: Override MACHINE as the native minix host make command will set
109 # it to i686.
110 . if ${MACHINE_ARCH} == "i386"
111 MACHINE:= i386
112 . endif
113 # LSC FIXME: On a native ARM system MACHINE_ARCH is earmv7 instead of earm...
114 . if !empty(MACHINE_ARCH:Mearm*)
115 MACHINE_ARCH:= earm
116 . endif
117 . endif # !defined(HOSTPROG) && !defined(HOSTLIB)
118 .endif # __uname_s == "Minix"
120 # LSC FIXME: RELEASEMACHINEDIR is set to evbarm, instead of evbearm-el
121 .if !empty(MACHINE:Mevbarm*)
122 RELEASEMACHINEDIR:= evbearm-el
123 .endif
125 .if ${HAVE_GCC:Dyes} == "yes" || \
126 (${MKGCCCMDS:Uno} == "yes" && ${MKLLVM:Uyes} == "no")
127 # We are building with GCC, means we cannot build LIBCXX, and need LIBSTDCXX
128 MKLIBCXX?= no # Can't compile with GCC.
130 . if ${USETOOLS:Uno} == "yes" || ${MKLIBSTDCXX:Uno} == "yes"
131 # When cross-compiling, or building MKLIBSTDCXX, use the in-tree LIBSTDCXX
132 MKLIBSTDCXX?= yes
133 CXXFLAGS+= -I${DESTDIR}/usr/include/g++
134 . endif # ${USETOOLS:Uno} == "yes"
136 . if ${MKLIBSTDCXX:Uno} == "no"
137 # Specify the C++ system header for the host libstdc++, as we are not building
138 # LIBSTDCXX
139 CXXFLAGS+= -I/usr/include/g++
140 . endif # ${MKLIBSTDCXX:Uno} == "no"
142 .endif # ${HAVE_GCC:Dyes} == "yes" || \
143 # (${MKGCCCMDS:Uno} == "yes" && ${MKLLVM:Uyes} == "no")
145 # MKGCCCMDS == yes implies MKGCC == yes
146 .if ${MKGCCCMDS} == "yes"
147 MKGCC= yes
148 MKBINUTILS?= yes # We are installing GCC, so trigger binutils.
149 MKLIBSTDCXX?= yes # Also install the GNU C++ library
150 .endif # ${MKGCCCMDS} == "yes"
152 # The default value of MKLIBSTDCXX cannot be set before the previous test.
153 MKLIBSTDCXX?= no
155 .if ${MKGCC} == "yes"
156 HAVE_GCC?= 5 # Not really, but that's the setting.
157 HAVE_LIBGCC?= yes
158 HAVE_LIBGCC_EH?= yes
159 .endif # ${MKGCC} == "yes"
161 .if ${USETOOLS:Uno} == "yes"
162 MKLLVM?= yes
163 .endif # ${USETOOLS:Uno} == "yes"
165 .if ${MKLLVM:Uno} == "yes"
166 HAVE_LLVM?= yes
167 MKBINUTILS?= yes # We are installing clang, so trigger binutils.
168 .endif # ${MKLLVM:Uno} == "yes"
170 .if ${HAVE_LLVM:Dyes} == "yes"
171 HAVE_LIBGCC?= no
172 .endif # ${HAVE_LLVM:Dyes} == "yes"
174 # The default value has to be set after we have figured out if we are using GCC
175 # or not.
176 MKLIBCXX?= yes # Build by default libc++
178 # The default value of MKBINUTILS cannot be set before the previous test.
179 MKBINUTILS?= no
181 .endif # defined(__MINIX)
183 MAKECONF?= /etc/mk.conf
184 .-include "${MAKECONF}"
187 # CPU model, derived from MACHINE_ARCH
189 MACHINE_CPU= ${MACHINE_ARCH:C/mipse[bl]/mips/:C/mips64e[bl]/mips/:C/sh3e[bl]/sh3/:S/coldfire/m68k/:S/m68000/m68k/:C/arm.*/arm/:C/earm.*/arm/:S/earm/arm/:S/powerpc64/powerpc/:S/aarch64eb/aarch64/:S/or1knd/or1k/:C/riscv../riscv/}
192 # Subdirectory used below ${RELEASEDIR} when building a release
194 RELEASEMACHINEDIR?= ${MACHINE}
197 # Subdirectory or path component used for the following paths:
198 # distrib/${RELEASEMACHINE}
199 # distrib/notes/${RELEASEMACHINE}
200 # etc/etc.${RELEASEMACHINE}
201 # Used when building a release.
203 RELEASEMACHINE?= ${MACHINE}
206 # NEED_OWN_INSTALL_TARGET is set to "no" by pkgsrc/mk/bsd.pkg.mk to
207 # ensure that things defined by <bsd.own.mk> (default targets,
208 # INSTALL_FILE, etc.) are not conflicting with bsd.pkg.mk.
210 NEED_OWN_INSTALL_TARGET?= yes
213 # This lists the platforms which do not have working in-tree toolchains. For
214 # the in-tree gcc toolchain, this list is empty.
216 # If some future port is not supported by the in-tree toolchain, this should
217 # be set to "yes" for that port only.
219 .if ${MACHINE} == "playstation2"
220 TOOLCHAIN_MISSING?= yes
221 .endif
223 TOOLCHAIN_MISSING?= no
225 .if ${MACHINE_CPU} == "aarch64" && !defined(EXTERNAL_TOOLCHAIN) && ${MKLLVM:Uyes} != "no"
226 MKLLVM?= yes
227 HAVE_LLVM?= yes
228 MKGCC?= no
229 .endif
232 # GCC Using platforms.
234 .if ${MKGCC:Uyes} != "no"
236 .if ${MACHINE} == "playstation2" || ${MACHINE_CPU} == "aarch64"
237 HAVE_GCC?= 0
238 .else
239 # Otherwise, default to GCC4.8
240 HAVE_GCC?= 48
241 .endif
244 # Platforms that can't run a modern GCC natively
245 .if ${MACHINE_ARCH} == "m68000"
246 MKGCCCMDS?= no
247 .endif
250 # We import the old gcc as "gcc.old" when upgrading. EXTERNAL_GCC_SUBDIR is
251 # set to the relevant subdirectory in src/external/gpl3 for his HAVE_GCC.
253 .if ${HAVE_GCC} == 5
254 EXTERNAL_GCC_SUBDIR= gcc
255 .elif ${HAVE_GCC} == 48
256 EXTERNAL_GCC_SUBDIR= gcc.old
257 .else
258 EXTERNAL_GCC_SUBDIR= /does/not/exist
259 .endif
260 .else
261 MKGCCCMDS?= no
262 .endif
264 .if !empty(MACHINE_ARCH:Mearm*)
265 _LIBC_COMPILER_RT.${MACHINE_ARCH}= yes
266 .endif
268 _LIBC_COMPILER_RT.aarch64= yes
269 _LIBC_COMPILER_RT.i386= yes
270 _LIBC_COMPILER_RT.powerpc= yes
271 _LIBC_COMPILER_RT.powerpc64= yes
272 _LIBC_COMPILER_RT.x86_64= yes
274 .if ${HAVE_LLVM:Uno} == "yes" && ${_LIBC_COMPILER_RT.${MACHINE_ARCH}:Uno} == "yes"
275 HAVE_LIBGCC?= no
276 .else
277 HAVE_LIBGCC?= yes
278 .endif
281 # ia64 is not support
282 .if ${HAVE_LLVM:Uno} == "yes" || !empty(MACHINE_ARCH:Mearm*)
283 HAVE_LIBGCC_EH?= no
284 .else
285 HAVE_LIBGCC_EH?= yes
286 .endif
288 HAVE_GDB?= 79
290 .if (${MACHINE_ARCH} == "alpha") || \
291 (${MACHINE_ARCH} == "hppa") || \
292 (${MACHINE_ARCH} == "ia64") || \
293 (${MACHINE_CPU} == "mips")
294 HAVE_SSP?= no
295 .else
296 HAVE_SSP?= yes
297 .if ${USE_FORT:Uno} != "no"
298 USE_SSP?= yes
299 .endif
300 .endif
302 .if empty(.MAKEFLAGS:tW:M*-V .OBJDIR*)
303 .if defined(MAKEOBJDIRPREFIX) || defined(MAKEOBJDIR)
304 PRINTOBJDIR= ${MAKE} -r -V .OBJDIR -f /dev/null xxx
305 .else
306 PRINTOBJDIR= ${MAKE} -V .OBJDIR
307 .endif
308 .else
309 PRINTOBJDIR= echo /error/bsd.own.mk/PRINTOBJDIR # avoid infinite recursion
310 .endif
313 # Determine if running in the NetBSD source tree by checking for the
314 # existence of build.sh and tools/ in the current or a parent directory,
315 # and setting _SRC_TOP_ to the result.
317 .if !defined(_SRC_TOP_) # {
318 _SRC_TOP_!= cd "${.CURDIR}"; while :; do \
319 here=`pwd`; \
320 [ -f build.sh ] && [ -d tools ] && { echo $$here; break; }; \
321 case $$here in /) echo ""; break;; esac; \
322 cd ..; done
324 .MAKEOVERRIDES+= _SRC_TOP_
326 .endif # }
329 # If _SRC_TOP_ != "", we're within the NetBSD source tree.
330 # * Set defaults for NETBSDSRCDIR and _SRC_TOP_OBJ_.
331 # * Define _NETBSD_VERSION_DEPENDS. Targets that depend on the
332 # NetBSD version, or on variables defined at build time, can
333 # declare a dependency on ${_NETBSD_VERSION_DEPENDS}.
335 .if (${_SRC_TOP_} != "") # {
337 NETBSDSRCDIR?= ${_SRC_TOP_}
339 .if !defined(_SRC_TOP_OBJ_)
340 _SRC_TOP_OBJ_!= cd "${_SRC_TOP_}" && ${PRINTOBJDIR}
341 .MAKEOVERRIDES+= _SRC_TOP_OBJ_
342 .endif
344 _NETBSD_VERSION_DEPENDS= ${_SRC_TOP_OBJ_}/params
345 _NETBSD_VERSION_DEPENDS+= ${NETBSDSRCDIR}/sys/sys/param.h
346 _NETBSD_VERSION_DEPENDS+= ${NETBSDSRCDIR}/sys/conf/newvers.sh
347 _NETBSD_VERSION_DEPENDS+= ${NETBSDSRCDIR}/sys/conf/osrelease.sh
348 ${_SRC_TOP_OBJ_}/params: .NOTMAIN .OPTIONAL # created by top level "make build"
350 .endif # _SRC_TOP_ != "" # }
353 .if (${_SRC_TOP_} != "") && \
354 (${TOOLCHAIN_MISSING} == "no" || defined(EXTERNAL_TOOLCHAIN))
355 USETOOLS?= yes
356 .endif
357 USETOOLS?= no
360 .if ${MACHINE_ARCH} == "mips" || ${MACHINE_ARCH} == "mips64" || \
361 ${MACHINE_ARCH} == "sh3"
362 .BEGIN:
363 @echo "Must set MACHINE_ARCH to one of ${MACHINE_ARCH}eb or ${MACHINE_ARCH}el"
364 @false
365 .elif defined(REQUIRETOOLS) && \
366 (${TOOLCHAIN_MISSING} == "no" || defined(EXTERNAL_TOOLCHAIN)) && \
367 ${USETOOLS} == "no"
368 .BEGIN:
369 @echo "USETOOLS=no, but this component requires a version-specific host toolchain"
370 @false
371 .endif
374 # Host platform information; may be overridden
376 .include <bsd.host.mk>
378 .if ${USETOOLS} == "yes" # {
381 # Provide a default for TOOLDIR.
383 .if !defined(TOOLDIR)
384 TOOLDIR:= ${_SRC_TOP_OBJ_}/tooldir.${HOST_OSTYPE}
385 .MAKEOVERRIDES+= TOOLDIR
386 .endif
389 # This is the prefix used for the NetBSD-sourced tools.
391 _TOOL_PREFIX?= nb
394 # If an external toolchain base is specified, use it.
396 .if defined(EXTERNAL_TOOLCHAIN) # {
397 AR= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-ar
398 AS= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-as
399 LD= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-ld
400 NM= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-nm
401 OBJCOPY= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-objcopy
402 OBJDUMP= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-objdump
403 RANLIB= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-ranlib
404 READELF= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-readelf
405 SIZE= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-size
406 STRINGS= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-strings
407 STRIP= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-strip
409 TOOL_CC.gcc= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-gcc
410 TOOL_CPP.gcc= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-cpp
411 TOOL_CXX.gcc= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-c++
412 TOOL_FC.gcc= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-g77
413 TOOL_OBJC.gcc= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-gcc
415 TOOL_CC.clang= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-clang
416 TOOL_CPP.clang= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-clang-cpp
417 TOOL_CXX.clang= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-clang++
418 TOOL_OBJC.clang= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-clang
419 TOOL_OPT.clang= ${EXTERNAL_TOOLCHAIN}/bin/opt
420 TOOL_LLC.clang= ${EXTERNAL_TOOLCHAIN}/bin/llc
421 .else # } {
422 # Define default locations for common tools.
423 .if ${USETOOLS_BINUTILS:Uyes} == "yes" # {
424 AR= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ar
425 AS= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-as
426 LD= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ld
427 NM= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-nm
428 OBJCOPY= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-objcopy
429 OBJDUMP= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-objdump
430 RANLIB= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ranlib
431 READELF= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-readelf
432 SIZE= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-size
433 STRINGS= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-strings
434 STRIP= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-strip
436 # GCC supports C, C++, Fortran and Objective C
437 TOOL_CC.gcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-gcc
438 TOOL_CPP.gcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-cpp
439 TOOL_CXX.gcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-c++
440 TOOL_FC.gcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-g77
441 TOOL_OBJC.gcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-gcc
442 .endif # }
444 # Clang supports C, C++ and Objective C
445 TOOL_CC.clang= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-clang
446 TOOL_CPP.clang= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-clang-cpp
447 TOOL_CXX.clang= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-clang++
448 TOOL_OBJC.clang= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-clang
449 TOOL_OPT.clang= ${TOOLDIR}/bin/opt
450 TOOL_LLC.clang= ${TOOLDIR}/bin/llc
452 # PCC supports C and Fortran
453 TOOL_CC.pcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-pcc
454 TOOL_CPP.pcc= ${TOOLDIR}/libexec/${MACHINE_GNU_PLATFORM}-cpp
455 TOOL_CXX.pcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-p++
458 # Make sure DESTDIR is set, so that builds with these tools always
459 # get appropriate -nostdinc, -nostdlib, etc. handling. The default is
460 # <empty string>, meaning start from /, the root directory.
462 DESTDIR?=
464 .if !defined(HOSTPROG) && !defined(HOSTLIB)
465 . if ${DESTDIR} != ""
466 CPPFLAGS+= --sysroot=${DESTDIR}
467 LDFLAGS+= --sysroot=${DESTDIR}
468 . else
469 CPPFLAGS+= --sysroot=/
470 LDFLAGS+= --sysroot=/
471 . endif
472 .endif
473 .endif # EXTERNAL_TOOLCHAIN # }
475 DBSYM= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-dbsym
476 ELF2AOUT= ${TOOLDIR}/bin/${_TOOL_PREFIX}m68k-elf2aout
477 ELF2ECOFF= ${TOOLDIR}/bin/${_TOOL_PREFIX}mips-elf2ecoff
478 INSTALL= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-install
479 LEX= ${TOOLDIR}/bin/${_TOOL_PREFIX}lex
480 LINT= CC=${CC:Q} ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-lint
481 LORDER= NM=${NM:Q} MKTEMP=${TOOL_MKTEMP:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}lorder
482 MKDEP= CC=${CC:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}mkdep
483 MKDEPCXX= CC=${CXX:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}mkdep
484 PAXCTL= ${TOOLDIR}/bin/${_TOOL_PREFIX}paxctl
485 TSORT= ${TOOLDIR}/bin/${_TOOL_PREFIX}tsort -q
486 YACC= ${TOOLDIR}/bin/${_TOOL_PREFIX}yacc
488 TOOL_AMIGAAOUT2BB= ${TOOLDIR}/bin/${_TOOL_PREFIX}amiga-aout2bb
489 TOOL_AMIGAELF2BB= ${TOOLDIR}/bin/${_TOOL_PREFIX}amiga-elf2bb
490 TOOL_AMIGATXLT= ${TOOLDIR}/bin/${_TOOL_PREFIX}amiga-txlt
491 TOOL_ASN1_COMPILE= ${TOOLDIR}/bin/${_TOOL_PREFIX}asn1_compile
492 TOOL_AWK= ${TOOLDIR}/bin/${_TOOL_PREFIX}awk
493 TOOL_CAP_MKDB= ${TOOLDIR}/bin/${_TOOL_PREFIX}cap_mkdb
494 TOOL_CAT= ${TOOLDIR}/bin/${_TOOL_PREFIX}cat
495 TOOL_CKSUM= ${TOOLDIR}/bin/${_TOOL_PREFIX}cksum
496 TOOL_CLANG_TBLGEN= ${TOOLDIR}/bin/${_TOOL_PREFIX}clang-tblgen
497 TOOL_COMPILE_ET= ${TOOLDIR}/bin/${_TOOL_PREFIX}compile_et
498 TOOL_CONFIG= ${TOOLDIR}/bin/${_TOOL_PREFIX}config
499 TOOL_CRUNCHGEN= MAKE=${.MAKE:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}crunchgen
500 TOOL_CTAGS= ${TOOLDIR}/bin/${_TOOL_PREFIX}ctags
501 TOOL_CTFCONVERT= ${TOOLDIR}/bin/${_TOOL_PREFIX}ctfconvert
502 TOOL_CTFMERGE= ${TOOLDIR}/bin/${_TOOL_PREFIX}ctfmerge
503 TOOL_DB= ${TOOLDIR}/bin/${_TOOL_PREFIX}db
504 TOOL_DISKLABEL= ${TOOLDIR}/bin/nbdisklabel
505 TOOL_EQN= ${TOOLDIR}/bin/${_TOOL_PREFIX}eqn
506 TOOL_FDISK= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-fdisk
507 TOOL_FGEN= ${TOOLDIR}/bin/${_TOOL_PREFIX}fgen
508 TOOL_GENASSYM= ${TOOLDIR}/bin/${_TOOL_PREFIX}genassym
509 TOOL_GENCAT= ${TOOLDIR}/bin/${_TOOL_PREFIX}gencat
510 TOOL_GMAKE= ${TOOLDIR}/bin/${_TOOL_PREFIX}gmake
511 TOOL_GREP= ${TOOLDIR}/bin/${_TOOL_PREFIX}grep
512 TOOL_GROFF= PATH=${TOOLDIR}/lib/groff:$${PATH} ${TOOLDIR}/bin/${_TOOL_PREFIX}groff
513 TOOL_HEXDUMP= ${TOOLDIR}/bin/${_TOOL_PREFIX}hexdump
514 TOOL_HP300MKBOOT= ${TOOLDIR}/bin/${_TOOL_PREFIX}hp300-mkboot
515 TOOL_HPPAMKBOOT= ${TOOLDIR}/bin/${_TOOL_PREFIX}hppa-mkboot
516 TOOL_INDXBIB= ${TOOLDIR}/bin/${_TOOL_PREFIX}indxbib
517 TOOL_INSTALLBOOT= ${TOOLDIR}/bin/${_TOOL_PREFIX}installboot
518 TOOL_INSTALL_INFO= ${TOOLDIR}/bin/${_TOOL_PREFIX}install-info
519 TOOL_JOIN= ${TOOLDIR}/bin/${_TOOL_PREFIX}join
520 TOOL_LLVM_TBLGEN= ${TOOLDIR}/bin/${_TOOL_PREFIX}llvm-tblgen
521 TOOL_M4= ${TOOLDIR}/bin/${_TOOL_PREFIX}m4
522 TOOL_MACPPCFIXCOFF= ${TOOLDIR}/bin/${_TOOL_PREFIX}macppc-fixcoff
523 TOOL_MAKEFS= ${TOOLDIR}/bin/${_TOOL_PREFIX}makefs
524 TOOL_MAKEINFO= ${TOOLDIR}/bin/${_TOOL_PREFIX}makeinfo
525 TOOL_MAKEKEYS= ${TOOLDIR}/bin/${_TOOL_PREFIX}makekeys
526 TOOL_MAKESTRS= ${TOOLDIR}/bin/${_TOOL_PREFIX}makestrs
527 TOOL_MAKEWHATIS= ${TOOLDIR}/bin/${_TOOL_PREFIX}makewhatis
528 TOOL_MANDOC_ASCII= ${TOOLDIR}/bin/${_TOOL_PREFIX}mandoc -Tascii
529 TOOL_MANDOC_HTML= ${TOOLDIR}/bin/${_TOOL_PREFIX}mandoc -Thtml
530 TOOL_MANDOC_LINT= ${TOOLDIR}/bin/${_TOOL_PREFIX}mandoc -Tlint
531 TOOL_MDSETIMAGE= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-mdsetimage
532 TOOL_MENUC= MENUDEF=${TOOLDIR}/share/misc ${TOOLDIR}/bin/${_TOOL_PREFIX}menuc
533 TOOL_M68KELF2AOUT= ${TOOLDIR}/bin/${_TOOL_PREFIX}m68k-elf2aout
534 TOOL_MIPSELF2ECOFF= ${TOOLDIR}/bin/${_TOOL_PREFIX}mips-elf2ecoff
535 TOOL_MKCSMAPPER= ${TOOLDIR}/bin/${_TOOL_PREFIX}mkcsmapper
536 TOOL_MKESDB= ${TOOLDIR}/bin/${_TOOL_PREFIX}mkesdb
537 TOOL_MKFSMFS= ${TOOLDIR}/bin/${_TOOL_PREFIX}mkfs.mfs
538 TOOL_MKLOCALE= ${TOOLDIR}/bin/${_TOOL_PREFIX}mklocale
539 TOOL_MKMAGIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}file
540 TOOL_MKNOD= ${TOOLDIR}/bin/${_TOOL_PREFIX}mknod
541 TOOL_MKTEMP= ${TOOLDIR}/bin/${_TOOL_PREFIX}mktemp
542 TOOL_MKUBOOTIMAGE= ${TOOLDIR}/bin/${_TOOL_PREFIX}mkubootimage
543 TOOL_ELFTOSB= ${TOOLDIR}/bin/${_TOOL_PREFIX}elftosb
544 TOOL_MSGC= MSGDEF=${TOOLDIR}/share/misc ${TOOLDIR}/bin/${_TOOL_PREFIX}msgc
545 TOOL_MTREE= ${TOOLDIR}/bin/${_TOOL_PREFIX}mtree
546 TOOL_NBPERF= ${TOOLDIR}/bin/${_TOOL_PREFIX}perf
547 TOOL_NCDCS= ${TOOLDIR}/bin/${_TOOL_PREFIX}ibmnws-ncdcs
548 TOOL_PAX= ${TOOLDIR}/bin/${_TOOL_PREFIX}pax
549 TOOL_PIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}pic
550 TOOL_PIGZ= ${TOOLDIR}/bin/${_TOOL_PREFIX}pigz
551 TOOL_PKG_CREATE= ${TOOLDIR}/bin/${_TOOL_PREFIX}pkg_create
552 TOOL_POWERPCMKBOOTIMAGE=${TOOLDIR}/bin/${_TOOL_PREFIX}powerpc-mkbootimage
553 TOOL_PWD_MKDB= ${TOOLDIR}/bin/${_TOOL_PREFIX}pwd_mkdb
554 TOOL_REFER= ${TOOLDIR}/bin/${_TOOL_PREFIX}refer
555 TOOL_ROFF_ASCII= PATH=${TOOLDIR}/lib/groff:$${PATH} ${TOOLDIR}/bin/${_TOOL_PREFIX}nroff
556 TOOL_ROFF_DOCASCII= ${TOOL_GROFF} -Tascii
557 TOOL_ROFF_DOCHTML= ${TOOL_GROFF} -Thtml
558 TOOL_ROFF_DVI= ${TOOL_GROFF} -Tdvi
559 TOOL_ROFF_HTML= ${TOOL_GROFF} -Tlatin1 -mdoc2html
560 TOOL_ROFF_PS= ${TOOL_GROFF} -Tps
561 TOOL_ROFF_RAW= ${TOOL_GROFF} -Z
562 TOOL_RPCGEN= RPCGEN_CPP=${CPP:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}rpcgen
563 TOOL_SED= ${TOOLDIR}/bin/${_TOOL_PREFIX}sed
564 TOOL_SLC= ${TOOLDIR}/bin/${_TOOL_PREFIX}slc
565 TOOL_SOELIM= ${TOOLDIR}/bin/${_TOOL_PREFIX}soelim
566 TOOL_SPARKCRC= ${TOOLDIR}/bin/${_TOOL_PREFIX}sparkcrc
567 TOOL_STAT= ${TOOLDIR}/bin/${_TOOL_PREFIX}stat
568 TOOL_STRFILE= ${TOOLDIR}/bin/${_TOOL_PREFIX}strfile
569 TOOL_SUNLABEL= ${TOOLDIR}/bin/${_TOOL_PREFIX}sunlabel
570 TOOL_TBL= ${TOOLDIR}/bin/${_TOOL_PREFIX}tbl
571 TOOL_TIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}tic
572 TOOL_TOPROTO= ${TOOLDIR}/bin/${_TOOL_PREFIX}toproto
573 TOOL_UUDECODE= ${TOOLDIR}/bin/${_TOOL_PREFIX}uudecode
574 TOOL_VGRIND= ${TOOLDIR}/bin/${_TOOL_PREFIX}vgrind -f
575 TOOL_VFONTEDPR= ${TOOLDIR}/libexec/${_TOOL_PREFIX}vfontedpr
576 TOOL_ZIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}zic
578 .else # USETOOLS != yes # } {
580 # Clang supports C, C++ and Objective C
581 TOOL_CC.clang= clang
582 .if defined(__MINIX)
583 TOOL_CPP.clang= clang -E
584 .else
585 TOOL_CPP.clang= clang-cpp
586 .endif # defined(__MINIX)
587 TOOL_CXX.clang= clang++
588 TOOL_OBJC.clang= clang
589 TOOL_OPT.clang= opt
590 TOOL_LLC.clang= llc
592 # GCC supports C, C++, Fortran and Objective C
593 TOOL_CC.gcc= gcc
594 TOOL_CPP.gcc= cpp
595 TOOL_CXX.gcc= c++
596 TOOL_FC.gcc= g77
597 TOOL_OBJC.gcc= gcc
599 # PCC supports C and Fortran
600 TOOL_CC.pcc= pcc
601 TOOL_CPP.pcc= /usr/libexec/pcpp
602 TOOL_CXX.pcc= p++
604 TOOL_AMIGAAOUT2BB= amiga-aout2bb
605 TOOL_AMIGAELF2BB= amiga-elf2bb
606 TOOL_AMIGATXLT= amiga-txlt
607 TOOL_ASN1_COMPILE= asn1_compile
608 TOOL_AWK= awk
609 TOOL_CAP_MKDB= cap_mkdb
610 TOOL_CAT= cat
611 TOOL_CKSUM= cksum
612 .if defined(__MINIX)
613 # LSC: A full path has to be provided, as this is also used as a make
614 # target.
615 . if exists(/usr/pkg/bin/clang-tblgen)
616 TOOL_CLANG_TBLGEN= /usr/pkg/bin/clang-tblgen
617 . else
618 TOOL_CLANG_TBLGEN= /usr/bin/clang-tblgen
619 . endif # exists(/usr/pkg/bin/clang-tblgen)
620 .else
621 TOOL_CLANG_TBLGEN= clang-tblgen
622 .endif # defined(__MINIX)
623 TOOL_COMPILE_ET= compile_et
624 TOOL_CONFIG= config
625 TOOL_CRUNCHGEN= crunchgen
626 TOOL_CTAGS= ctags
627 TOOL_CTFCONVERT= ctfconvert
628 TOOL_CTFMERGE= ctfmerge
629 TOOL_DB= db
630 TOOL_DISKLABEL= disklabel
631 TOOL_EQN= eqn
632 TOOL_FDISK= fdisk
633 TOOL_FGEN= fgen
634 TOOL_GENASSYM= genassym
635 TOOL_GENCAT= gencat
636 TOOL_GMAKE= gmake
637 TOOL_GREP= grep
638 TOOL_GROFF= groff
639 TOOL_HEXDUMP= hexdump
640 TOOL_HP300MKBOOT= hp300-mkboot
641 TOOL_HPPAMKBOOT= hppa-mkboot
642 TOOL_INDXBIB= indxbib
643 TOOL_INSTALLBOOT= installboot
644 TOOL_INSTALL_INFO= install-info
645 TOOL_JOIN= join
646 .if defined(__MINIX)
647 # LSC: A full path has to be provided, as this is also used as a make
648 # target.
649 . if exists(/usr/pkg/bin/llvm-tblgen)
650 TOOL_LLVM_TBLGEN= /usr/pkg/bin/llvm-tblgen
651 . else
652 TOOL_LLVM_TBLGEN= /usr/bin/llvm-tblgen
653 . endif # exists(/usr/pkg/bin/llvm-tblgen)
654 .else
655 TOOL_LLVM_TBLGEN= llvm-tblgen
656 .endif # defined(__MINIX)
657 TOOL_M4= m4
658 TOOL_MACPPCFIXCOFF= macppc-fixcoff
659 TOOL_MAKEFS= makefs
660 TOOL_MAKEINFO= makeinfo
661 .if defined(__MINIX)
662 # LSC: A full path has to be provided, as this is also used as a make
663 # target.
664 TOOL_MAKEKEYS= /usr/X11R7/bin/makekeys
665 .else
666 TOOL_MAKEKEYS= makekeys
667 .endif # defined(__MINIX)
668 .if defined(__MINIX)
669 # LSC: A full path has to be provided, as this is also used as a make
670 # target.
671 TOOL_MAKESTRS= /usr/X11R7/bin/makestrs
672 .else
673 TOOL_MAKESTRS= makestrs
674 .endif # defined(__MINIX)
675 TOOL_MAKEWHATIS= /usr/libexec/makewhatis
676 TOOL_MANDOC_ASCII= mandoc -Tascii
677 TOOL_MANDOC_HTML= mandoc -Thtml
678 TOOL_MANDOC_LINT= mandoc -Tlint
679 TOOL_MDSETIMAGE= mdsetimage
680 TOOL_MENUC= menuc
681 TOOL_M68KELF2AOUT= m68k-elf2aout
682 TOOL_MIPSELF2ECOFF= mips-elf2ecoff
683 TOOL_MKCSMAPPER= mkcsmapper
684 TOOL_MKESDB= mkesdb
685 TOOL_MKFSMFS= mkfs.mfs
686 TOOL_MKLOCALE= mklocale
687 TOOL_MKMAGIC= file
688 TOOL_MKNOD= mknod
689 TOOL_MKTEMP= mktemp
690 TOOL_MKUBOOTIMAGE= mkubootimage
691 TOOL_ELFTOSB= elftosb
692 TOOL_MSGC= msgc
693 TOOL_MTREE= mtree
694 TOOL_NBPERF= nbperf
695 TOOL_NCDCS= ncdcs
696 TOOL_PAX= pax
697 TOOL_PIC= pic
698 TOOL_PIGZ= pigz
699 TOOL_PKG_CREATE= pkg_create
700 TOOL_POWERPCMKBOOTIMAGE= powerpc-mkbootimage
701 TOOL_PWD_MKDB= pwd_mkdb
702 TOOL_REFER= refer
703 TOOL_ROFF_ASCII= nroff
704 TOOL_ROFF_DOCASCII= ${TOOL_GROFF} -Tascii
705 TOOL_ROFF_DOCHTML= ${TOOL_GROFF} -Thtml
706 TOOL_ROFF_DVI= ${TOOL_GROFF} -Tdvi
707 TOOL_ROFF_HTML= ${TOOL_GROFF} -Tlatin1 -mdoc2html
708 TOOL_ROFF_PS= ${TOOL_GROFF} -Tps
709 TOOL_ROFF_RAW= ${TOOL_GROFF} -Z
710 TOOL_RPCGEN= rpcgen
711 TOOL_SED= sed
712 TOOL_SOELIM= soelim
713 TOOL_SPARKCRC= sparkcrc
714 TOOL_STAT= stat
715 .if defined(__MINIX)
716 TOOL_STRFILE= /usr/games/strfile
717 .else
718 TOOL_STRFILE= strfile
719 .endif # defined(__MINIX)
720 TOOL_SUNLABEL= sunlabel
721 TOOL_TBL= tbl
722 .if defined(__MINIX)
723 # LSC: There is a tic packaged, which has a completly different set of
724 # options, so make sure to use the base system one, always.
725 TOOL_TIC= /usr/bin/tic
726 .else
727 TOOL_TIC= tic
728 .endif # defined(__MINIX)
729 TOOL_TOPROTO= toproto
730 TOOL_UUDECODE= uudecode
731 TOOL_VGRIND= vgrind -f
732 TOOL_VFONTEDPR= /usr/libexec/vfontedpr
733 TOOL_ZIC= zic
735 .endif # USETOOLS != yes # }
737 # Fallback to ensure that all variables are defined to something
738 TOOL_CC.false= false
739 TOOL_CPP.false= false
740 TOOL_CXX.false= false
741 TOOL_FC.false= false
742 TOOL_OBJC.false= false
743 TOOL_OPT.false= false
744 TOOL_LLC.false= false
746 AVAILABLE_COMPILER?= ${HAVE_PCC:Dpcc} ${HAVE_LLVM:Dclang} ${HAVE_GCC:Dgcc} ${EXTERNAL_TOOLCHAIN:Dgcc} false
748 .for _t in CC CPP CXX FC OBJC OPT LLC
749 ACTIVE_${_t}= ${AVAILABLE_COMPILER:@.c.@ ${ !defined(UNSUPPORTED_COMPILER.${.c.}) && defined(TOOL_${_t}.${.c.}) :? ${.c.} : }@:[1]}
750 SUPPORTED_${_t}=${AVAILABLE_COMPILER:Nfalse:@.c.@ ${ !defined(UNSUPPORTED_COMPILER.${.c.}) && defined(TOOL_${_t}.${.c.}) :? ${.c.} : }@}
751 .endfor
752 # make bugs prevent moving this into the .for loop
753 CC= ${TOOL_CC.${ACTIVE_CC}}
754 CPP= ${TOOL_CPP.${ACTIVE_CPP}}
755 CXX= ${TOOL_CXX.${ACTIVE_CXX}}
756 FC= ${TOOL_FC.${ACTIVE_FC}}
757 OBJC= ${TOOL_OBJC.${ACTIVE_OBJC}}
758 OPT= ${TOOL_OPT.${ACTIVE_OPT}}
759 LLC= ${TOOL_LLC.${ACTIVE_LLC}}
761 # Override with tools versions if needed
762 .if ${MKCTF:Uno} != "no" && !defined(NOCTF)
763 CTFCONVERT= ${TOOL_CTFCONVERT}
764 CTFMERGE= ${TOOL_CTFMERGE}
765 .endif
767 # For each ${MACHINE_CPU}, list the ports that use it.
768 MACHINES.aarch64= evbarm64
769 MACHINES.alpha= alpha
770 MACHINES.arm= acorn26 acorn32 cats epoc32 evbarm hpcarm \
771 iyonix netwinder shark zaurus
772 MACHINES.coldfire= evbcf
773 MACHINES.i386= i386
774 MACHINES.ia64= ia64
775 MACHINES.hppa= hppa
776 MACHINES.m68000= sun2
777 MACHINES.m68k= amiga atari cesfic hp300 luna68k mac68k \
778 news68k next68k sun3 x68k
779 MACHINES.mips= arc cobalt algor cobalt emips evbmips ews4800mips \
780 hpcmips mipsco newsmips pmax sbmips sgimips
781 MACHINES.or1k= or1k
782 MACHINES.powerpc= amigappc bebox evbppc ibmnws macppc mvmeppc \
783 ofppc prep rs6000 sandpoint
784 MACHINES.riscv= riscv
785 MACHINES.sh3= dreamcast evbsh3 hpcsh landisk mmeye
786 MACHINES.sparc= sparc sparc64
787 MACHINES.sparc64= sparc64
788 MACHINES.vax= vax
789 MACHINES.x86_64= amd64
791 # for crunchide & ldd, define the OBJECT_FMTS used by a MACHINE_ARCH
793 OBJECT_FMTS=
794 .if ${MACHINE_ARCH} != "alpha"
795 OBJECT_FMTS+= elf32
796 .endif
797 .if ${MACHINE_ARCH} == "alpha" || ${MACHINE_ARCH:M*64*} != ""
798 OBJECT_FMTS+= elf64
799 .endif
801 # OBJCOPY flags to create a.out binaries for old firmware
802 # shared among src/distrib and ${MACHINE}/conf/Makefile.${MACHINE}.inc
803 .if ${MACHINE_CPU} == "arm"
804 OBJCOPY_ELF2AOUT_FLAGS?= \
805 -O a.out-arm-netbsd \
806 -R .ident \
807 -R .ARM.attributes \
808 -R .ARM.exidx \
809 -R .ARM.extab \
810 -R .arm.atpcs \
811 -R .comment \
812 -R .debug_abbrev \
813 -R .debug_aranges \
814 -R .debug_info \
815 -R .debug_line \
816 -R .debug_frame \
817 -R .debug_loc \
818 -R .debug_pubnames \
819 -R .debug_pubtypes \
820 -R .debug_ranges \
821 -R .debug_str \
822 -R .eh_frame \
823 -R .note.netbsd.ident
824 .endif
827 # Targets to check if DESTDIR or RELEASEDIR is provided
829 .if !target(check_DESTDIR)
830 check_DESTDIR: .PHONY .NOTMAIN
831 .if !defined(DESTDIR)
832 @echo "setenv DESTDIR before doing that!"
833 @false
834 .else
835 @true
836 .endif
837 .endif
839 .if !target(check_RELEASEDIR)
840 check_RELEASEDIR: .PHONY .NOTMAIN
841 .if !defined(RELEASEDIR)
842 @echo "setenv RELEASEDIR before doing that!"
843 @false
844 .else
845 @true
846 .endif
847 .endif
850 # Build a dynamically linked /bin and /sbin, with the necessary shared
851 # libraries moved from /usr/lib to /lib and the shared linker moved
852 # from /usr/libexec to /lib
854 # Note that if the BINDIR is not /bin or /sbin, then we always use the
855 # non-DYNAMICROOT behavior (i.e. it is only enabled for programs in /bin
856 # and /sbin). See <bsd.shlib.mk>.
858 MKDYNAMICROOT?= yes
861 # Where the system object and source trees are kept; can be configurable
862 # by the user in case they want them in ~/foosrc and ~/fooobj (for example).
864 BSDSRCDIR?= /usr/src
865 BSDOBJDIR?= /usr/obj
866 NETBSDSRCDIR?= ${BSDSRCDIR}
868 BINGRP?= wheel
869 BINOWN?= root
870 BINMODE?= 555
871 NONBINMODE?= 444
873 # These are here mainly because we don't want suid root in case
874 # a Makefile defines BINMODE.
875 RUMPBINGRP?= wheel
876 RUMPBINOWN?= root
877 RUMPBINMODE?= 555
878 RUMPNONBINMODE?=444
880 MANDIR?= /usr/share/man
881 MANGRP?= wheel
882 MANOWN?= root
883 MANMODE?= ${NONBINMODE}
884 MANINSTALL?= ${_MANINSTALL}
886 INFODIR?= /usr/share/info
887 INFOGRP?= wheel
888 INFOOWN?= root
889 INFOMODE?= ${NONBINMODE}
891 LIBDIR?= /usr/lib
893 LINTLIBDIR?= /usr/libdata/lint
894 LIBGRP?= ${BINGRP}
895 LIBOWN?= ${BINOWN}
896 LIBMODE?= ${NONBINMODE}
898 DOCDIR?= /usr/share/doc
899 DOCGRP?= wheel
900 DOCOWN?= root
901 DOCMODE?= ${NONBINMODE}
903 NLSDIR?= /usr/share/nls
904 NLSGRP?= wheel
905 NLSOWN?= root
906 NLSMODE?= ${NONBINMODE}
908 KMODULEGRP?= wheel
909 KMODULEOWN?= root
910 KMODULEMODE?= ${NONBINMODE}
912 LOCALEDIR?= /usr/share/locale
913 LOCALEGRP?= wheel
914 LOCALEOWN?= root
915 LOCALEMODE?= ${NONBINMODE}
917 FIRMWAREDIR?= /libdata/firmware
918 FIRMWAREGRP?= wheel
919 FIRMWAREOWN?= root
920 FIRMWAREMODE?= ${NONBINMODE}
922 DEBUGDIR?= /usr/libdata/debug
923 DEBUGGRP?= wheel
924 DEBUGOWN?= root
925 DEBUGMODE?= ${NONBINMODE}
928 # Data-driven table using make variables to control how
929 # toolchain-dependent targets and shared libraries are built
930 # for different platforms and object formats.
932 # OBJECT_FMT: currently either "ELF" or "a.out".
934 # All platforms are ELF.
936 OBJECT_FMT= ELF
939 # If this platform's toolchain is missing, we obviously cannot build it.
941 .if ${TOOLCHAIN_MISSING} != "no"
942 MKBINUTILS:= no
943 MKGDB:= no
944 MKGCC:= no
945 .endif
948 # If we are using an external toolchain, we can still build the target's
949 # binutils, but we cannot build GCC's support libraries, since those are
950 # tightly-coupled to the version of GCC being used.
952 .if defined(EXTERNAL_TOOLCHAIN)
953 MKGCC:= no
954 .endif
956 # No GDB support for aarch64
957 MKGDB.aarch64= no
958 MKGDB.or1k= no
959 MKGDB.riscv32= no
960 MKGDB.riscv64= no
962 # No kernel modules for or1k (yet)
963 MKKMOD.or1k= no
964 MKKMOD.riscv32= no
965 MKKMOD.riscv64= no
967 # No profiling for or1k (yet)
968 MKPROFILE.or1k= no
969 MKPROFILE.riscv32=no
970 MKPROFILE.riscv64=no
973 # The m68000 port is incomplete.
975 .if ${MACHINE_ARCH} == "m68000"
976 NOPIC= # defined
977 MKISCSI= no
978 # XXX GCC 4 outputs mcount() calling sequences that try to load values
979 # from over 64KB away and this fails to assemble.
980 .if defined(HAVE_GCC)
981 NOPROFILE= # defined
982 .endif
983 .endif
986 # The ia64 port is incomplete.
988 MKLINT.ia64= no
989 MKGDB.ia64= no
992 # On the MIPS, all libs are compiled with ABIcalls (and are thus PIC),
993 # not just shared libraries, so don't build the _pic version.
995 .if ${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb" || \
996 ${MACHINE_ARCH} == "mips64el" || ${MACHINE_ARCH} == "mips64eb"
997 MKPICLIB:= no
998 .endif
1000 # PowerPC64 and AArch64 ABI's are PIC
1001 MKPICLIB.powerpc64= no
1002 #MKPICLIB.aarch64= no
1005 # On VAX using ELF, all objects are PIC, not just shared libraries,
1006 # so don't build the _pic version.
1008 MKPICLIB.vax= no
1011 # Location of the file that contains the major and minor numbers of the
1012 # version of a shared library. If this file exists a shared library
1013 # will be built by <bsd.lib.mk>.
1015 SHLIB_VERSION_FILE?= ${.CURDIR}/shlib_version
1018 # GNU sources and packages sometimes see architecture names differently.
1020 GNU_ARCH.aarch64eb=aarch64_be
1021 GNU_ARCH.coldfire=m5407
1022 GNU_ARCH.earm=arm
1023 GNU_ARCH.earmhf=arm
1024 GNU_ARCH.earmeb=armeb
1025 GNU_ARCH.earmhfeb=armeb
1026 GNU_ARCH.earmv4=armv4
1027 GNU_ARCH.earmv4eb=armv4eb
1028 GNU_ARCH.earmv5=arm
1029 GNU_ARCH.earmv5eb=armeb
1030 GNU_ARCH.earmv6=armv6
1031 GNU_ARCH.earmv6hf=armv6
1032 GNU_ARCH.earmv6eb=armv6eb
1033 GNU_ARCH.earmv6hfeb=armv6eb
1034 GNU_ARCH.earmv7=armv7
1035 GNU_ARCH.earmv7hf=armv7
1036 GNU_ARCH.earmv7eb=armv7eb
1037 GNU_ARCH.earmv7hfeb=armv7eb
1038 GNU_ARCH.i386=i486
1039 GCC_CONFIG_ARCH.i386=i486
1040 GCC_CONFIG_TUNE.i386=nocona
1041 GCC_CONFIG_TUNE.x86_64=nocona
1042 GNU_ARCH.m68000=m68010
1043 GNU_ARCH.sh3eb=sh
1044 GNU_ARCH.sh3el=shle
1045 GNU_ARCH.mips64eb=mips64
1047 .if defined(__MINIX)
1048 # MINIX/arm default
1049 GCC_CONFIG_ARCH.earm=armv7-a
1051 # MINIX/intel default
1052 GNU_ARCH.i386=i586
1053 GCC_CONFIG_ARCH.i386=i586
1055 .endif # defined(__MINIX)
1057 MACHINE_GNU_ARCH=${GNU_ARCH.${MACHINE_ARCH}:U${MACHINE_ARCH}}
1060 # In order to identify NetBSD to GNU packages, we sometimes need
1061 # an "elf" tag for historically a.out platforms.
1063 .if (!empty(MACHINE_ARCH:Mearm*))
1064 MACHINE_GNU_PLATFORM?=${MACHINE_GNU_ARCH}--netbsdelf-${MACHINE_ARCH:C/eb//:C/v[4-7]//:S/earm/eabi/}
1065 .elif (${MACHINE_GNU_ARCH} == "arm" || \
1066 ${MACHINE_GNU_ARCH} == "armeb" || \
1067 ${MACHINE_ARCH} == "i386" || \
1068 ${MACHINE_CPU} == "m68k" || \
1069 ${MACHINE_GNU_ARCH} == "sh" || \
1070 ${MACHINE_GNU_ARCH} == "shle" || \
1071 ${MACHINE_ARCH} == "sparc" || \
1072 ${MACHINE_ARCH} == "vax")
1073 MACHINE_GNU_PLATFORM?=${MACHINE_GNU_ARCH}--netbsdelf
1074 .else
1075 MACHINE_GNU_PLATFORM?=${MACHINE_GNU_ARCH}--netbsd
1076 .endif
1078 .if defined(__MINIX)
1079 # We have a simpler toolchain naming scheme
1080 MACHINE_GNU_PLATFORM:=${MACHINE_GNU_ARCH}-elf32-minix
1082 # We need to check for HAVE_GOLD after LD has been set
1083 . if ${_HAVE_GOLD:U} == ""
1084 _HAVE_GOLD!= (exec 2>&1; ${LD} --version || echo "")
1085 _GOLD_MATCH:=${_HAVE_GOLD:Mgold}
1086 _HAVE_GOLD:= ${_HAVE_GOLD:M[0-9]\.[0-9][0-9]}
1088 . if ${_GOLD_MATCH} != "" && ${_HAVE_GOLD} != ""
1089 HAVE_GOLD?= ${_HAVE_GOLD}
1091 # Without -Wl,--no-ctors-in-init-array, gold moves the constructors out of
1092 # .ctors into .init_array, which is bad on intel.
1093 LDFLAGS+= -Wl,--no-ctors-in-init-array
1094 . else
1095 USE_BITCODE:=no
1096 . endif
1097 . endif # ${_HAVE_GOLD:U} == ""
1098 .endif # defined(__MINIX)
1100 .if !empty(MACHINE_ARCH:M*arm*)
1101 # Flags to pass to CC for using the old APCS ABI on ARM for compat or stand.
1102 ARM_APCS_FLAGS= -mabi=apcs-gnu -mfloat-abi=soft
1103 ARM_APCS_FLAGS+=${${ACTIVE_CC} == "gcc":? -marm :}
1104 ARM_APCS_FLAGS+=${${ACTIVE_CC} == "clang":? -target ${MACHINE_GNU_ARCH}--netbsdelf -B ${TOOLDIR}/${MACHINE_GNU_PLATFORM}/bin :}
1105 .endif
1107 GENASSYM_CPPFLAGS+= ${${ACTIVE_CC} == "clang":? -no-integrated-as :}
1109 TARGETS+= all clean cleandir depend dependall includes \
1110 install lint obj regress tags html analyze
1111 PHONY_NOTMAIN = all clean cleandir depend dependall distclean includes \
1112 install lint obj regress beforedepend afterdepend \
1113 beforeinstall afterinstall realinstall realdepend realall \
1114 html subdir-all subdir-install subdir-depend analyze
1115 .PHONY: ${PHONY_NOTMAIN}
1116 .NOTMAIN: ${PHONY_NOTMAIN}
1118 .if ${NEED_OWN_INSTALL_TARGET} != "no"
1119 .if !target(install)
1120 install: beforeinstall .WAIT subdir-install realinstall .WAIT afterinstall
1121 beforeinstall:
1122 subdir-install:
1123 realinstall:
1124 afterinstall:
1125 .endif
1126 all: realall subdir-all
1127 subdir-all:
1128 realall:
1129 depend: realdepend subdir-depend
1130 subdir-depend:
1131 realdepend:
1132 distclean: cleandir
1133 cleandir: clean
1135 dependall: .NOTMAIN realdepend .MAKE
1136 @cd "${.CURDIR}"; ${MAKE} realall
1137 .endif
1140 # Define MKxxx variables (which are either yes or no) for users
1141 # to set in /etc/mk.conf and override in the make environment.
1142 # These should be tested with `== "no"' or `!= "no"'.
1143 # The NOxxx variables should only be set by Makefiles.
1145 # Please keep etc/Makefile and share/man/man5/mk.conf.5 in sync
1146 # with changes to the MK* variables here.
1150 # Supported NO* options (if defined, MK* will be forced to "no",
1151 # regardless of user's mk.conf setting).
1153 # Source makefiles should set NO*, and not MK*, and must do so before
1154 # including bsd.own.mk.
1156 .for var in \
1157 NOCRYPTO NODOC NOHTML NOINFO NOLINKLIB NOLINT NOMAN NONLS NOOBJ NOPIC \
1158 NOPICINSTALL NOPROFILE NOSHARE NOSTATICLIB
1159 .if defined(${var})
1160 MK${var:S/^NO//}:= no
1161 .endif
1162 .endfor
1165 # Older-style variables that enabled behaviour when set.
1167 .for var in MANZ UNPRIVED UPDATE
1168 .if defined(${var})
1169 MK${var}:= yes
1170 .endif
1171 .endfor
1174 # MK* options which have variable defaults.
1176 .if ${MACHINE_ARCH} == "x86_64" || ${MACHINE_ARCH} == "sparc64" \
1177 || ${MACHINE_ARCH} == "mips64eb" || ${MACHINE_ARCH} == "mips64el" \
1178 || ${MACHINE_ARCH} == "powerpc64" || ${MACHINE_CPU} == "aarch64" \
1179 || ${MACHINE_ARCH} == "riscv64" \
1180 || !empty(MACHINE_ARCH:Mearm*)
1181 MKCOMPAT?= yes
1182 .else
1183 # Don't let this build where it really isn't supported.
1184 MKCOMPAT:= no
1185 MKCOMPATTESTS:= no
1186 MKCOMPATX11:= no
1187 .endif
1189 .if ${MACHINE_ARCH} == "x86_64" || ${MACHINE_ARCH} == "i386" \
1190 || ${MACHINE_ARCH} == "mips64eb" || ${MACHINE_ARCH} == "mips64el" \
1191 || (${MACHINE} == "evbppc" && ${MACHINE_ARCH} == "powerpc")
1192 MKCOMPATMODULES?= yes
1193 .else
1194 MKCOMPATMODULES:= no
1195 .endif
1198 # Default mips64 to softfloat now.
1199 # arm is always softfloat unless it isn't
1200 # emips is always softfloat.
1201 # coldfire is always softfloat
1202 # or1k is always softfloat
1204 .if ${MACHINE_ARCH} == "mips64eb" || ${MACHINE_ARCH} == "mips64el" || \
1205 (${MACHINE_CPU} == "arm" && ${MACHINE_ARCH:M*hf*} == "") || \
1206 ${MACHINE_ARCH} == "coldfire" || ${MACHINE_CPU} == "or1k" || \
1207 ${MACHINE} == "emips"
1208 MKSOFTFLOAT?= yes
1209 .endif
1211 .if ${MACHINE} == "emips"
1212 SOFTFLOAT_BITS= 32
1213 .endif
1215 .if ${MACHINE_ARCH} == "i386" || \
1216 ${MACHINE_ARCH} == "x86_64" || \
1217 ${MACHINE_ARCH} == "sparc"
1218 MKSLJIT?= yes
1219 .else
1220 MKSLJIT?= no
1221 .endif
1224 # MK* backward compatibility.
1226 .if defined(MKBFD)
1227 MKBINUTILS?= ${MKBFD}
1228 .endif
1231 # We want to build zfs only for amd64 by default for now.
1233 .if ${MACHINE} == "amd64"
1234 MKZFS?= yes
1235 .endif
1238 # MK* options which default to "yes".
1240 _MKVARS.yes= \
1241 MKATF \
1242 MKBINUTILS \
1243 MKCRYPTO MKCOMPLEX MKCVS MKCXX \
1244 MKDOC \
1245 MKGCC MKGDB MKGROFF \
1246 MKHESIOD MKHTML \
1247 MKIEEEFP MKINET6 MKINFO MKIPFILTER MKISCSI \
1248 MKKERBEROS \
1249 MKKMOD \
1250 MKLDAP MKLIBSTDCXX MKLINKLIB MKLVM \
1251 MKMAN MKMANDOC \
1252 MKMDNS \
1253 MKMAKEMANDB \
1254 MKNLS \
1255 MKNPF \
1256 MKOBJ \
1257 MKPAM MKPERFUSE \
1258 MKPF MKPIC MKPICINSTALL MKPICLIB MKPOSTFIX MKPROFILE \
1259 MKRUMP \
1260 MKSHARE MKSKEY MKSTATICLIB \
1261 MKX11FONTS \
1262 MKYP
1264 #MINIX-specific vars
1265 _MKVARS.yes+= \
1266 MKSYSDEBUG MKLIVEUPDATE MKLLVMCMDS
1267 .if (${MACHINE_ARCH} == "i386")
1268 _MKVARS.yes+= \
1269 MKWATCHDOG MKACPI MKAPIC MKDEBUGREG MKINSTALLBOOT MKPCI
1270 .endif
1272 .for var in ${_MKVARS.yes}
1273 ${var}?= ${${var}.${MACHINE_ARCH}:Uyes}
1274 .endfor
1277 # MKGCCCMDS is only valid if we are building GCC so make it dependent on that.
1279 _MKVARS.yes += MKGCCCMDS
1280 MKGCCCMDS?= ${MKGCC}
1283 # Exceptions to the above:
1285 .if ${MACHINE} == "acorn26" # page size is prohibitive
1286 MKKMOD= no
1287 .endif
1290 # MK* options which default to "no". Note that MKZFS has a different
1291 # default for some platforms, see above.
1293 _MKVARS.no= \
1294 MKBSDGREP MKBSDTAR \
1295 MKCATPAGES MKCOMPATTESTS MKCOMPATX11 MKCRYPTO_RC5 MKCTF MKDEBUG \
1296 MKDEBUGLIB MKDTRACE MKEXTSRC MKGROFFHTMLDOC \
1297 MKKYUA MKLLD MKLLDB MKLINT \
1298 MKMANZ MKMCLINKER MKOBJDIRS \
1299 MKLIBCXX MKLLVM MKPCC \
1300 MKPIGZGZIP \
1301 MKREPRO \
1302 MKSOFTFLOAT MKSTRIPIDENT MKTPM \
1303 MKUNPRIVED MKUPDATE MKX11 MKX11MOTIF MKZFS
1305 #MINIX-specific vars
1306 _MKVARS.no+= \
1307 MKIMAGEONLY MKSMALL MKBITCODE MKMAGIC MKPAE MKASR MKSRC
1308 .if !empty(MACHINE_ARCH:Mearm*)
1309 _MKVARS.no+= \
1310 MKWATCHDOG MKPAE MKACPI MKAPIC MKDEBUGREG MKINSTALLBOOT MKPCI
1311 .endif
1313 .for var in ${_MKVARS.no}
1314 ${var}?= ${${var}.${MACHINE_ARCH}:Uno}
1315 .endfor
1318 # Which platforms build the xorg-server drivers (as opposed
1319 # to just Xnest and Xvfb.)
1321 .if ${MACHINE} == "alpha" || \
1322 ${MACHINE} == "amd64" || \
1323 ${MACHINE} == "bebox" || \
1324 ${MACHINE} == "cats" || \
1325 ${MACHINE} == "dreamcast" || \
1326 ${MACHINE} == "ews4800mips" || \
1327 ${MACHINE} == "evbarm" || \
1328 ${MACHINE} == "evbmips" || \
1329 ${MACHINE} == "hp300" || \
1330 ${MACHINE} == "hpcarm" || \
1331 ${MACHINE} == "hpcmips" || \
1332 ${MACHINE} == "hpcsh" || \
1333 ${MACHINE} == "i386" || \
1334 ${MACHINE} == "luna68k" || \
1335 ${MACHINE} == "mac68k" || \
1336 ${MACHINE} == "macppc" || \
1337 ${MACHINE} == "netwinder" || \
1338 ${MACHINE} == "newsmips" || \
1339 ${MACHINE} == "prep" || \
1340 ${MACHINE} == "ofppc" || \
1341 ${MACHINE} == "sgimips" || \
1342 ${MACHINE} == "shark" || \
1343 ${MACHINE} == "sparc" || \
1344 ${MACHINE} == "sparc64" || \
1345 ${MACHINE} == "vax" || \
1346 ${MACHINE} == "zaurus"
1347 MKXORG_SERVER?=yes
1348 .else
1349 MKXORG_SERVER?=no
1350 .endif
1353 # Force some options off if their dependencies are off.
1356 .if ${MKCXX} == "no"
1357 MKATF:= no
1358 MKGROFF:= no
1359 MKKYUA:= no
1360 .endif
1362 .if ${MKCRYPTO} == "no"
1363 MKKERBEROS:= no
1364 MKLDAP:= no
1365 .endif
1367 .if ${MKMAN} == "no"
1368 MKCATPAGES:= no
1369 MKHTML:= no
1370 .endif
1372 _MANINSTALL= maninstall
1373 .if ${MKCATPAGES} != "no"
1374 _MANINSTALL+= catinstall
1375 .endif
1376 .if ${MKHTML} != "no"
1377 _MANINSTALL+= htmlinstall
1378 .endif
1380 .if ${MKLINKLIB} == "no"
1381 MKLINT:= no
1382 MKPICINSTALL:= no
1383 MKPROFILE:= no
1384 .endif
1386 .if ${MKPIC} == "no"
1387 MKPICLIB:= no
1388 .endif
1390 .if ${MKOBJ} == "no"
1391 MKOBJDIRS:= no
1392 .endif
1394 .if ${MKSHARE} == "no"
1395 MKCATPAGES:= no
1396 MKDOC:= no
1397 MKINFO:= no
1398 MKHTML:= no
1399 MKMAN:= no
1400 MKNLS:= no
1401 .endif
1403 # MINIX
1404 .if ${MKSMALL} == "yes"
1405 MKWATCHDOG:= no
1406 MKACPI:= no
1407 MKAPIC:= no
1408 MKDEBUGREG:= no
1409 MKSYSDEBUG:= no
1410 MKLIVEUPDATE:= no
1411 .endif
1413 # MINIX: MKASR implies MKMAGIC
1414 .if ${MKASR} == "yes"
1415 MKMAGIC:= yes
1416 .endif
1418 # MINIX: MKMAGIC implies MKBITCODE
1419 .if ${MKMAGIC} == "yes"
1420 MKBITCODE:= yes
1421 .endif
1423 .if !empty(MACHINE_ARCH:Mearm*)
1424 _NEEDS_LIBCXX.${MACHINE_ARCH}= yes
1425 .endif
1426 _NEEDS_LIBCXX.i386= yes
1427 _NEEDS_LIBCXX.powerpc= yes
1428 _NEEDS_LIBCXX.powerpc64= yes
1429 _NEEDS_LIBCXX.x86_64= yes
1430 _NEEDS_LIBCXX.aarch64= yes
1432 .if ${MKLLVM} == "yes" && ${_NEEDS_LIBCXX.${MACHINE_ARCH}:Uno} == "yes"
1433 MKLIBCXX:= yes
1434 .endif
1437 # install(1) parameters.
1439 COPY?= -c
1440 .if ${MKUPDATE} == "no"
1441 PRESERVE?=
1442 .else
1443 PRESERVE?= -p
1444 .endif
1445 RENAME?= -r
1446 HRDLINK?= -l h
1447 SYMLINK?= -l s
1449 METALOG?= ${DESTDIR}/METALOG
1450 METALOG.add?= ${TOOL_CAT} -l >> ${METALOG}
1451 .if (${_SRC_TOP_} != "") # only set INSTPRIV if inside ${NETBSDSRCDIR}
1452 .if ${MKUNPRIVED} != "no"
1453 INSTPRIV.unpriv=-U -M ${METALOG} -D ${DESTDIR} -h sha256
1454 .else
1455 INSTPRIV.unpriv=
1456 .endif
1457 INSTPRIV?= ${INSTPRIV.unpriv} -N ${NETBSDSRCDIR}/etc
1458 .endif
1459 STRIPFLAG?=
1461 .if ${NEED_OWN_INSTALL_TARGET} != "no"
1462 INSTALL_DIR?= ${INSTALL} ${INSTPRIV} -d
1463 INSTALL_FILE?= ${INSTALL} ${INSTPRIV} ${COPY} ${PRESERVE} ${RENAME}
1464 INSTALL_LINK?= ${INSTALL} ${INSTPRIV} ${HRDLINK} ${RENAME}
1465 INSTALL_SYMLINK?= ${INSTALL} ${INSTPRIV} ${SYMLINK} ${RENAME}
1466 .endif
1469 # Set defaults for the USE_xxx variables.
1473 # USE_* options which default to "no" and will be forced to "no" if their
1474 # corresponding MK* variable is set to "no".
1476 .for var in USE_SKEY
1477 .if (${${var:S/USE_/MK/}} == "no")
1478 ${var}:= no
1479 .else
1480 ${var}?= no
1481 .endif
1482 .endfor
1485 # USE_* options which default to "yes" unless their corresponding MK*
1486 # variable is set to "no".
1488 .for var in USE_HESIOD USE_INET6 USE_KERBEROS USE_LDAP USE_PAM USE_YP
1489 .if (${${var:S/USE_/MK/}} == "no")
1490 ${var}:= no
1491 .else
1492 ${var}?= yes
1493 .endif
1494 .endfor
1496 #MINIX-specific vars
1497 .for var in \
1498 USE_WATCHDOG USE_ACPI USE_PAE USE_APIC USE_DEBUGREG USE_SYSDEBUG \
1499 USE_LIVEUPDATE USE_PCI USE_BITCODE USE_MAGIC USE_ASR
1500 .if (${${var:S/USE_/MK/}} == "no")
1501 ${var}:= no
1502 .else
1503 ${var}?= yes
1504 .endif
1505 .endfor
1508 # USE_* options which default to "yes".
1510 .for var in USE_JEMALLOC
1511 ${var}?= yes
1512 .endfor
1515 # USE_* options which default to "no".
1517 # For now, disable pigz as compressor by default
1518 .for var in USE_PIGZGZIP USE_LIBTRE
1519 ${var}?= no
1520 .endfor
1523 # TOOL_GZIP and friends. These might refer to TOOL_PIGZ or to the host gzip.
1525 .if ${USE_PIGZGZIP} != "no"
1526 TOOL_GZIP= ${TOOL_PIGZ}
1527 GZIP_N_FLAG?= -nT
1528 .else
1529 TOOL_GZIP= gzip
1530 GZIP_N_FLAG?= -n
1531 .endif
1532 TOOL_GZIP_N= ${TOOL_GZIP} ${GZIP_N_FLAG}
1535 # Where X11 sources are and where it is installed to.
1537 .if !defined(X11SRCDIR)
1538 .if exists(${NETBSDSRCDIR}/../xsrc)
1539 X11SRCDIR!= cd "${NETBSDSRCDIR}/../xsrc" && pwd
1540 .else
1541 X11SRCDIR= /usr/xsrc
1542 .endif
1543 .endif # !defined(X11SRCDIR)
1545 X11SRCDIR.local?= ${X11SRCDIR}/local
1546 X11ROOTDIR?= /usr/X11R7
1547 X11BINDIR?= ${X11ROOTDIR}/bin
1548 X11ETCDIR?= /etc/X11
1549 X11FONTDIR?= ${X11ROOTDIR}/lib/X11/fonts
1550 X11INCDIR?= ${X11ROOTDIR}/include
1551 X11LIBDIR?= ${X11ROOTDIR}/lib/X11
1552 X11MANDIR?= ${X11ROOTDIR}/man
1553 X11SHAREDIR?= ${X11ROOTDIR}/share
1554 X11USRLIBDIR?= ${X11ROOTDIR}/lib${MLIBDIR:D/${MLIBDIR}}
1557 # New modular-xorg based builds
1559 X11SRCDIRMIT?= ${X11SRCDIR}/external/mit
1560 .for _lib in \
1561 FS ICE SM X11 XScrnSaver XTrap Xau Xcomposite Xcursor Xdamage \
1562 Xdmcp Xevie Xext Xfixes Xfont Xft Xi Xinerama Xmu Xpresent Xpm \
1563 Xrandr Xrender Xres Xt Xtst Xv XvMC Xxf86dga Xxf86misc Xxf86vm drm \
1564 fontenc xkbfile xkbui Xaw Xfontcache pciaccess xcb \
1565 pthread-stubs
1566 X11SRCDIR.${_lib}?= ${X11SRCDIRMIT}/lib${_lib}/dist
1567 .endfor
1569 .for _proto in \
1570 xcmisc xext xf86bigfont bigreqs input kb x fonts fixes scrnsaver \
1571 xinerama dri2 dri3 render resource record video xf86dga xf86misc \
1572 xf86vidmode composite damage trap gl randr fontcache xf86dri \
1573 present xcb-
1574 X11SRCDIR.${_proto}proto?= ${X11SRCDIRMIT}/${_proto}proto/dist
1575 .endfor
1577 .for _dir in \
1578 xtrans fontconfig freetype evieext mkfontscale bdftopcf \
1579 xkbcomp xorg-cf-files imake xorg-server xbiff xkeyboard-config \
1580 xbitmaps appres xeyes xev xedit sessreg pixman \
1581 beforelight bitmap editres makedepend fonttosfnt fslsfonts fstobdf \
1582 glu glw mesa-demos MesaGLUT MesaLib MesaLib7 \
1583 ico iceauth listres lndir \
1584 luit xproxymanagementprotocol mkfontdir oclock proxymngr rgb \
1585 rstart setxkbmap showfont smproxy twm viewres \
1586 x11perf xauth xcalc xclipboard \
1587 xclock xcmsdb xconsole xditview xdpyinfo xdriinfo xdm \
1588 xfd xf86dga xfindproxy xfontsel xfwp xgamma xgc xhost xinit \
1589 xkill xload xlogo xlsatoms xlsclients xlsfonts xmag xmessage \
1590 xmh xmodmap xmore xman xprop xrandr xrdb xrefresh xset \
1591 xsetmode xsetpointer xsetroot xsm xstdcmap xvidtune xvinfo \
1592 xwininfo xwud xkbprint xkbevd \
1593 xterm xwd xfs xfsinfo xtrap xkbutils xkbcomp \
1594 xkeyboard-config xinput xcb-util xorg-docs \
1595 font-adobe-100dpi font-adobe-75dpi font-adobe-utopia-100dpi \
1596 font-adobe-utopia-75dpi font-adobe-utopia-type1 \
1597 font-alias \
1598 font-bh-100dpi font-bh-75dpi font-bh-lucidatypewriter-100dpi \
1599 font-bh-lucidatypewriter-75dpi font-bh-ttf font-bh-type1 \
1600 font-bitstream-100dpi font-bitstream-75dpi font-bitstream-type1 \
1601 font-cursor-misc font-daewoo-misc font-dec-misc font-ibm-type1 \
1602 font-isas-misc font-jis-misc font-misc-misc font-mutt-misc \
1603 font-sony-misc font-util ttf-bitstream-vera encodings
1604 X11SRCDIR.${_dir}?= ${X11SRCDIRMIT}/${_dir}/dist
1605 .endfor
1607 .for _i in \
1608 elographics keyboard mouse synaptics vmmouse void ws
1609 X11SRCDIR.xf86-input-${_i}?= ${X11SRCDIRMIT}/xf86-input-${_i}/dist
1610 .endfor
1612 .for _v in \
1613 ag10e apm ark ast ati ati-kms chips cirrus crime \
1614 geode glint i128 i740 igs imstt intel intel-old mach64 mga \
1615 neomagic newport nsc nv nvxbox openchrome pnozz \
1616 r128 radeonhd rendition \
1617 s3 s3virge savage siliconmotion sis suncg14 \
1618 suncg6 sunffb sunleo suntcx \
1619 tdfx tga trident tseng vesa vga vmware wsfb xgi
1620 X11SRCDIR.xf86-video-${_v}?= ${X11SRCDIRMIT}/xf86-video-${_v}/dist
1621 .endfor
1623 # Only install the radeon firmware on DRM-happy systems.
1624 .if ${MACHINE_ARCH} == "x86_64" || ${MACHINE_ARCH} == "i386"
1625 MKRADEONFIRMWARE?= yes
1626 .endif
1627 MKRADEONFIRMWARE?= no
1629 X11DRI?= yes
1630 X11LOADABLE?= yes
1634 # Where extsrc sources are and where it is installed to.
1636 .if !defined(EXTSRCSRCDIR)
1637 .if exists(${NETBSDSRCDIR}/../extsrc)
1638 EXTSRCSRCDIR!= cd "${NETBSDSRCDIR}/../extsrc" && pwd
1639 .else
1640 EXTSRCSRCDIR= /usr/extsrc
1641 .endif
1642 .endif # !defined(EXTSRCSRCDIR)
1644 EXTSRCROOTDIR?= /usr/ext
1645 EXTSRCBINDIR?= ${EXTSRCROOTDIR}/bin
1646 EXTSRCETCDIR?= /etc/ext
1647 EXTSRCINCDIR?= ${EXTSRCROOTDIR}/include
1648 EXTSRCLIBDIR?= ${EXTSRCROOTDIR}/lib/ext
1649 EXTSRCMANDIR?= ${EXTSRCROOTDIR}/man
1650 EXTSRCUSRLIBDIR?= ${EXTSRCROOTDIR}/lib
1653 # MAKEDIRTARGET dir target [extra make(1) params]
1654 # run "cd $${dir} && ${MAKEDIRTARGETENV} ${MAKE} [params] $${target}", with a pretty message
1656 MAKEDIRTARGETENV?=
1657 MAKEDIRTARGET=\
1658 @_makedirtarget() { \
1659 dir="$$1"; shift; \
1660 target="$$1"; shift; \
1661 case "$${dir}" in \
1662 /*) this="$${dir}/"; \
1663 real="$${dir}" ;; \
1664 .) this="${_THISDIR_}"; \
1665 real="${.CURDIR}" ;; \
1666 *) this="${_THISDIR_}$${dir}/"; \
1667 real="${.CURDIR}/$${dir}" ;; \
1668 esac; \
1669 show=$${this:-.}; \
1670 echo "$${target} ===> $${show%/}$${1:+ (with: $$@)}"; \
1671 cd "$${real}" \
1672 && ${MAKEDIRTARGETENV} ${MAKE} _THISDIR_="$${this}" "$$@" $${target}; \
1673 }; \
1674 _makedirtarget
1677 # MAKEVERBOSE support. Levels are:
1678 # 0 Minimal output ("quiet")
1679 # 1 Describe what is occurring
1680 # 2 Describe what is occurring and echo the actual command
1681 # 3 Ignore the effect of the "@" prefix in make commands
1682 # 4 Trace shell commands using the shell's -x flag
1684 MAKEVERBOSE?= 2
1686 .if ${MAKEVERBOSE} == 0
1687 _MKMSG?= @\#
1688 _MKSHMSG?= : echo
1689 _MKSHECHO?= : echo
1690 .SILENT:
1691 .elif ${MAKEVERBOSE} == 1
1692 _MKMSG?= @echo ' '
1693 _MKSHMSG?= echo ' '
1694 _MKSHECHO?= : echo
1695 .SILENT:
1696 .else # MAKEVERBOSE >= 2
1697 _MKMSG?= @echo '\# '
1698 _MKSHMSG?= echo '\# '
1699 _MKSHECHO?= echo
1700 .SILENT: __makeverbose_dummy_target__
1701 .endif # MAKEVERBOSE >= 2
1702 .if ${MAKEVERBOSE} >= 3
1703 .MAKEFLAGS: -dl
1704 .endif # ${MAKEVERBOSE} >= 3
1705 .if ${MAKEVERBOSE} >= 4
1706 .MAKEFLAGS: -dx
1707 .endif # ${MAKEVERBOSE} >= 4
1709 _MKMSG_BUILD?= ${_MKMSG} " build "
1710 _MKMSG_CREATE?= ${_MKMSG} " create "
1711 _MKMSG_COMPILE?= ${_MKMSG} "compile "
1712 _MKMSG_FORMAT?= ${_MKMSG} " format "
1713 _MKMSG_INSTALL?= ${_MKMSG} "install "
1714 _MKMSG_LINK?= ${_MKMSG} " link "
1715 _MKMSG_LEX?= ${_MKMSG} " lex "
1716 _MKMSG_REMOVE?= ${_MKMSG} " remove "
1717 _MKMSG_YACC?= ${_MKMSG} " yacc "
1719 _MKSHMSG_CREATE?= ${_MKSHMSG} " create "
1720 _MKSHMSG_INSTALL?= ${_MKSHMSG} "install "
1722 _MKTARGET_BUILD?= ${_MKMSG_BUILD} ${.CURDIR:T}/${.TARGET}
1723 _MKTARGET_CREATE?= ${_MKMSG_CREATE} ${.CURDIR:T}/${.TARGET}
1724 _MKTARGET_COMPILE?= ${_MKMSG_COMPILE} ${.CURDIR:T}/${.TARGET}
1725 _MKTARGET_FORMAT?= ${_MKMSG_FORMAT} ${.CURDIR:T}/${.TARGET}
1726 _MKTARGET_INSTALL?= ${_MKMSG_INSTALL} ${.TARGET}
1727 _MKTARGET_LINK?= ${_MKMSG_LINK} ${.CURDIR:T}/${.TARGET}
1728 _MKTARGET_LEX?= ${_MKMSG_LEX} ${.CURDIR:T}/${.TARGET}
1729 _MKTARGET_REMOVE?= ${_MKMSG_REMOVE} ${.TARGET}
1730 _MKTARGET_YACC?= ${_MKMSG_YACC} ${.CURDIR:T}/${.TARGET}
1732 .if ${MKMANDOC} == "yes"
1733 TARGETS+= lintmanpages
1734 .endif
1736 TESTSBASE= /usr/tests${MLIBDIR:D/${MLIBDIR}}
1738 .endif # !defined(_BSD_OWN_MK_)