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