tests: print error locations verbosely
[minix3.git] / share / mk / bsd.own.mk
blob1d37c9cf23232ce574b4ce63ab79525ecf81df02
1 # $NetBSD: bsd.own.mk,v 1.706 2012/08/16 05:30:55 matt 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 # LSC FIXME: Useless difference, Should use the mk.conf
14 MAKECONF?= /etc/make.conf
16 # Some Minix deviations from NetBSD
17 LDSTATIC?= -static
18 MKDYNAMICROOT?= no
20 BINMODE?= 755
21 NONBINMODE?= 644
22 MANDIR?= /usr/man
23 BINGRP?= operator
24 MANGRP?= operator
25 INFOGRP?= operator
26 DOCGRP?= operator
28 MKBINUTILS:= no
29 MKGDB:= no
30 MKGCC?= no
32 # LSC To check if works
33 #DESTDIR?= /usr/destdir.${MACHINE_ARCH}
35 # LSC MINIX SMP Support?
36 .ifdef CONFIG_SMP
37 SMP_FLAGS += -DCONFIG_SMP
38 .ifdef CONFIG_MAX_CPUS
39 SMP_FLAGS += -DCONFIG_MAX_CPUS=${CONFIG_MAX_CPUS}
40 .endif
41 .endif
43 CPPFLAGS+= ${SMP_FLAGS}
45 __uname_s!= uname -s
46 .if ${__uname_s:Uunknown} == "Minix"
47 USETOOLS?= never
48 . if ${USETOOLS:Uno} != "yes" && ${HAVE_LLVM:U} == ""
49 HAVE_LLVM!= clang --version | grep version | cut -d' ' -f 3
50 . endif
51 . if !defined(HOSTPROG) && !defined(HOSTLIB)
52 # LSC FIXME: Override MACHINE as the native minix host make command will set
53 # it to i686.
54 . if ${MACHINE_ARCH} == "i386"
55 MACHINE:= i386
56 . endif
57 . endif # !defined(HOSTPROG) && !defined(HOSTLIB)
58 .endif # __uname_s == "Minix"
60 .else
61 MAKECONF?= /etc/mk.conf
62 .endif # defined(__MINIX)
63 .-include "${MAKECONF}"
66 # CPU model, derived from MACHINE_ARCH
68 MACHINE_CPU= ${MACHINE_ARCH:C/mipse[bl]/mips/:C/mips64e[bl]/mips/:C/sh3e[bl]/sh3/:S/m68000/m68k/:S/armeb/arm/:S/earm/arm/:S/earmeb/arm/:S/powerpc64/powerpc/}
71 # Subdirectory used below ${RELEASEDIR} when building a release
73 RELEASEMACHINEDIR?= ${MACHINE}
76 # Subdirectory or path component used for the following paths:
77 # distrib/${RELEASEMACHINE}
78 # distrib/notes/${RELEASEMACHINE}
79 # etc/etc.${RELEASEMACHINE}
80 # Used when building a release.
82 RELEASEMACHINE?= ${MACHINE}
85 # NEED_OWN_INSTALL_TARGET is set to "no" by pkgsrc/mk/bsd.pkg.mk to
86 # ensure that things defined by <bsd.own.mk> (default targets,
87 # INSTALL_FILE, etc.) are not conflicting with bsd.pkg.mk.
89 NEED_OWN_INSTALL_TARGET?= yes
92 # This lists the platforms which do not have working in-tree toolchains. For
93 # the in-tree gcc toolchain, this list is empty.
95 # If some future port is not supported by the in-tree toolchain, this should
96 # be set to "yes" for that port only.
98 TOOLCHAIN_MISSING?= no
101 # Platforms still using GCC 4.1
103 .if ${MKGCC:Uyes} != "no"
104 .if ${MACHINE_CPU} == "vax"
105 HAVE_GCC?= 4
106 .else
107 # Otherwise, default to GCC4.5
108 HAVE_GCC?= 45
109 .endif
110 .endif
112 .if \
113 ${MACHINE_CPU} == "arm" || \
114 ${MACHINE_ARCH} == "i386" || \
115 ${MACHINE_ARCH} == "powerpc" || \
116 ${MACHINE_CPU} == "sh3" || \
117 ${MACHINE_ARCH} == "x86_64"
118 USE_COMPILERCRTSTUFF?= no
119 .endif
120 USE_COMPILERCRTSTUFF?= yes
124 # Platforms still using GDB 6
126 .if ${MACHINE_CPU} == "mips"
127 HAVE_GDB?= 6
128 .else
129 # Otherwise, default to GDB7
130 HAVE_GDB?= 7
131 .endif
134 .if empty(.MAKEFLAGS:M-V*)
135 .if defined(MAKEOBJDIRPREFIX) || defined(MAKEOBJDIR)
136 PRINTOBJDIR= ${MAKE} -r -V .OBJDIR -f /dev/null xxx
137 .else
138 PRINTOBJDIR= ${MAKE} -V .OBJDIR
139 .endif
140 .else
141 PRINTOBJDIR= echo # prevent infinite recursion
142 .endif
145 # Determine if running in the NetBSD source tree by checking for the
146 # existence of build.sh and tools/ in the current or a parent directory,
147 # and setting _SRC_TOP_ to the result.
149 .if !defined(_SRC_TOP_) # {
150 _SRC_TOP_!= cd "${.CURDIR}"; while :; do \
151 here=`pwd`; \
152 [ -f build.sh ] && [ -d tools ] && { echo $$here; break; }; \
153 case $$here in /) echo ""; break;; esac; \
154 cd ..; done
156 .MAKEOVERRIDES+= _SRC_TOP_
158 .endif # }
161 # If _SRC_TOP_ != "", we're within the NetBSD source tree, so set
162 # defaults for NETBSDSRCDIR and _SRC_TOP_OBJ_.
164 .if (${_SRC_TOP_} != "") # {
166 NETBSDSRCDIR?= ${_SRC_TOP_}
168 .if !defined(_SRC_TOP_OBJ_)
169 _SRC_TOP_OBJ_!= cd "${_SRC_TOP_}" && ${PRINTOBJDIR}
170 .MAKEOVERRIDES+= _SRC_TOP_OBJ_
171 .endif
173 .endif # _SRC_TOP_ != "" # }
176 .if (${_SRC_TOP_} != "") && \
177 (${TOOLCHAIN_MISSING} == "no" || defined(EXTERNAL_TOOLCHAIN))
178 USETOOLS?= yes
179 .endif
180 USETOOLS?= no
183 .if ${MACHINE_ARCH} == "mips" || ${MACHINE_ARCH} == "mips64" || \
184 ${MACHINE_ARCH} == "sh3"
185 .BEGIN:
186 @echo "Must set MACHINE_ARCH to one of ${MACHINE_ARCH}eb or ${MACHINE_ARCH}el"
187 @false
188 .elif defined(REQUIRETOOLS) && \
189 (${TOOLCHAIN_MISSING} == "no" || defined(EXTERNAL_TOOLCHAIN)) && \
190 ${USETOOLS} == "no"
191 .BEGIN:
192 @echo "USETOOLS=no, but this component requires a version-specific host toolchain"
193 @false
194 .endif
197 # Host platform information; may be overridden
199 .if !defined(HOST_OSTYPE)
200 _HOST_OSNAME!= uname -s
201 _HOST_OSREL!= uname -r
202 # For _HOST_ARCH, if uname -p fails, or prints "unknown", or prints
203 # something that does not look like an identifier, then use uname -m.
204 _HOST_ARCH!= uname -p 2>/dev/null
205 _HOST_ARCH:= ${HOST_ARCH:tW:C/.*[^-_A-Za-z0-9].*//:S/unknown//}
206 .if empty(_HOST_ARCH)
207 _HOST_ARCH!= uname -m
208 .endif
209 HOST_OSTYPE:= ${_HOST_OSNAME}-${_HOST_OSREL:C/\([^\)]*\)//g:[*]:C/ /_/g}-${_HOST_ARCH:C/\([^\)]*\)//g:[*]:C/ /_/g}
210 .MAKEOVERRIDES+= HOST_OSTYPE
211 .endif # !defined(HOST_OSTYPE)
213 .if ${USETOOLS} == "yes" # {
216 # Provide a default for TOOLDIR.
218 .if !defined(TOOLDIR)
219 TOOLDIR:= ${_SRC_TOP_OBJ_}/tooldir.${HOST_OSTYPE}
220 .MAKEOVERRIDES+= TOOLDIR
221 .endif
224 # This is the prefix used for the NetBSD-sourced tools.
226 _TOOL_PREFIX?= nb
229 # If an external toolchain base is specified, use it.
231 .if defined(EXTERNAL_TOOLCHAIN) # {
232 AR= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-ar
233 AS= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-as
234 LD= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-ld
235 NM= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-nm
236 OBJCOPY= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-objcopy
237 OBJDUMP= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-objdump
238 RANLIB= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-ranlib
239 SIZE= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-size
240 STRIP= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-strip
242 TOOL_CC.gcc= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-gcc
243 TOOL_CPP.gcc= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-cpp
244 TOOL_CXX.gcc= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-c++
245 TOOL_FC.gcc= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-g77
246 TOOL_OBJC.gcc= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-gcc
247 .else # } {
248 # Define default locations for common tools.
249 .if ${USETOOLS_BINUTILS:Uyes} == "yes" # {
250 AR= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ar
251 AS= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-as
252 LD= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ld
253 NM= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-nm
254 OBJCOPY= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-objcopy
255 OBJDUMP= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-objdump
256 RANLIB= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ranlib
257 SIZE= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-size
258 STRIP= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-strip
260 # GCC supports C, C++, Fortran and Objective C
261 TOOL_CC.gcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-gcc
262 TOOL_CPP.gcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-cpp
263 TOOL_CXX.gcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-c++
264 TOOL_FC.gcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-g77
265 TOOL_OBJC.gcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-gcc
266 .endif # }
268 # Clang supports C, C++ and Objective C
269 TOOL_CC.clang= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-clang
270 TOOL_CPP.clang= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-clang-cpp
271 TOOL_CXX.clang= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-clang++
272 TOOL_OBJC.clang= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-clang
274 # PCC supports C and Fortran
275 TOOL_CC.pcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-pcc
276 TOOL_CPP.pcc= ${TOOLDIR}/libexec/${MACHINE_GNU_PLATFORM}-cpp
279 # Make sure DESTDIR is set, so that builds with these tools always
280 # get appropriate -nostdinc, -nostdlib, etc. handling. The default is
281 # <empty string>, meaning start from /, the root directory.
283 DESTDIR?=
285 .if !defined(HOSTPROG) && !defined(HOSTLIB)
286 . if ${DESTDIR} != ""
287 CPPFLAGS+= --sysroot=${DESTDIR}
288 LDFLAGS+= --sysroot=${DESTDIR}
289 . else
290 CPPFLAGS+= --sysroot=/
291 LDFLAGS+= --sysroot=/
292 . endif
293 .endif
294 .endif # EXTERNAL_TOOLCHAIN # }
296 HOST_MKDEP= ${TOOLDIR}/bin/${_TOOL_PREFIX}host-mkdep
298 DBSYM= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-dbsym
299 ELF2AOUT= ${TOOLDIR}/bin/${_TOOL_PREFIX}m68k-elf2aout
300 ELF2ECOFF= ${TOOLDIR}/bin/${_TOOL_PREFIX}mips-elf2ecoff
301 INSTALL= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-install
302 LEX= ${TOOLDIR}/bin/${_TOOL_PREFIX}lex
303 LINT= CC=${CC:Q} ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-lint
304 LORDER= NM=${NM:Q} MKTEMP=${TOOL_MKTEMP:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}lorder
305 MKDEP= CC=${CC:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}mkdep
306 PAXCTL= ${TOOLDIR}/bin/${_TOOL_PREFIX}paxctl
307 TSORT= ${TOOLDIR}/bin/${_TOOL_PREFIX}tsort -q
308 YACC= ${TOOLDIR}/bin/${_TOOL_PREFIX}yacc
310 TOOL_AMIGAAOUT2BB= ${TOOLDIR}/bin/${_TOOL_PREFIX}amiga-aout2bb
311 TOOL_AMIGAELF2BB= ${TOOLDIR}/bin/${_TOOL_PREFIX}amiga-elf2bb
312 TOOL_AMIGATXLT= ${TOOLDIR}/bin/${_TOOL_PREFIX}amiga-txlt
313 TOOL_ASN1_COMPILE= ${TOOLDIR}/bin/${_TOOL_PREFIX}asn1_compile
314 TOOL_AWK= ${TOOLDIR}/bin/${_TOOL_PREFIX}awk
315 TOOL_CAP_MKDB= ${TOOLDIR}/bin/${_TOOL_PREFIX}cap_mkdb
316 TOOL_CAT= ${TOOLDIR}/bin/${_TOOL_PREFIX}cat
317 TOOL_CKSUM= ${TOOLDIR}/bin/${_TOOL_PREFIX}cksum
318 TOOL_CLANG_TBLGEN= ${TOOLDIR}/bin/${_TOOL_PREFIX}clang-tblgen
319 TOOL_COMPILE_ET= ${TOOLDIR}/bin/${_TOOL_PREFIX}compile_et
320 TOOL_CONFIG= ${TOOLDIR}/bin/${_TOOL_PREFIX}config
321 TOOL_CRUNCHGEN= MAKE=${.MAKE:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}crunchgen
322 TOOL_CTAGS= ${TOOLDIR}/bin/${_TOOL_PREFIX}ctags
323 TOOL_CTFCONVERT= ${TOOLDIR}/bin/${_TOOL_PREFIX}ctfconvert
324 TOOL_CTFMERGE= ${TOOLDIR}/bin/${_TOOL_PREFIX}ctfmerge
325 TOOL_DB= ${TOOLDIR}/bin/${_TOOL_PREFIX}db
326 TOOL_DISKLABEL= ${TOOLDIR}/bin/nbdisklabel-${MAKEWRAPPERMACHINE}
327 TOOL_EQN= ${TOOLDIR}/bin/${_TOOL_PREFIX}eqn
328 TOOL_FDISK= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-fdisk
329 TOOL_FGEN= ${TOOLDIR}/bin/${_TOOL_PREFIX}fgen
330 TOOL_GENASSYM= ${TOOLDIR}/bin/${_TOOL_PREFIX}genassym
331 TOOL_GENCAT= ${TOOLDIR}/bin/${_TOOL_PREFIX}gencat
332 TOOL_GMAKE= ${TOOLDIR}/bin/${_TOOL_PREFIX}gmake
333 TOOL_GREP= ${TOOLDIR}/bin/${_TOOL_PREFIX}grep
334 TOOL_GROFF= PATH=${TOOLDIR}/lib/groff:$${PATH} ${TOOLDIR}/bin/${_TOOL_PREFIX}groff
335 TOOL_HEXDUMP= ${TOOLDIR}/bin/${_TOOL_PREFIX}hexdump
336 TOOL_HP300MKBOOT= ${TOOLDIR}/bin/${_TOOL_PREFIX}hp300-mkboot
337 TOOL_HP700MKBOOT= ${TOOLDIR}/bin/${_TOOL_PREFIX}hp700-mkboot
338 TOOL_INDXBIB= ${TOOLDIR}/bin/${_TOOL_PREFIX}indxbib
339 TOOL_INSTALLBOOT= ${TOOLDIR}/bin/${_TOOL_PREFIX}installboot
340 TOOL_INSTALL_INFO= ${TOOLDIR}/bin/${_TOOL_PREFIX}install-info
341 TOOL_JOIN= ${TOOLDIR}/bin/${_TOOL_PREFIX}join
342 TOOL_LLVM_TBLGEN= ${TOOLDIR}/bin/${_TOOL_PREFIX}llvm-tblgen
343 TOOL_M4= ${TOOLDIR}/bin/${_TOOL_PREFIX}m4
344 TOOL_MACPPCFIXCOFF= ${TOOLDIR}/bin/${_TOOL_PREFIX}macppc-fixcoff
345 TOOL_MAKEFS= ${TOOLDIR}/bin/${_TOOL_PREFIX}makefs
346 TOOL_MAKEINFO= ${TOOLDIR}/bin/${_TOOL_PREFIX}makeinfo
347 TOOL_MAKEWHATIS= ${TOOLDIR}/bin/${_TOOL_PREFIX}makewhatis
348 TOOL_MANDOC_ASCII= ${TOOLDIR}/bin/${_TOOL_PREFIX}mandoc -Tascii
349 TOOL_MANDOC_HTML= ${TOOLDIR}/bin/${_TOOL_PREFIX}mandoc -Thtml
350 TOOL_MANDOC_LINT= ${TOOLDIR}/bin/${_TOOL_PREFIX}mandoc -Tlint
351 TOOL_MDSETIMAGE= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-mdsetimage
352 TOOL_MENUC= MENUDEF=${TOOLDIR}/share/misc ${TOOLDIR}/bin/${_TOOL_PREFIX}menuc
353 TOOL_M68KELF2AOUT= ${TOOLDIR}/bin/${_TOOL_PREFIX}m68k-elf2aout
354 TOOL_MIPSELF2ECOFF= ${TOOLDIR}/bin/${_TOOL_PREFIX}mips-elf2ecoff
355 TOOL_MKCSMAPPER= ${TOOLDIR}/bin/${_TOOL_PREFIX}mkcsmapper
356 TOOL_MKESDB= ${TOOLDIR}/bin/${_TOOL_PREFIX}mkesdb
357 TOOL_MKFSMFS= ${TOOLDIR}/bin/${_TOOL_PREFIX}mkfs.mfs
358 TOOL_MKLOCALE= ${TOOLDIR}/bin/${_TOOL_PREFIX}mklocale
359 TOOL_MKMAGIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}file
360 TOOL_MKTEMP= ${TOOLDIR}/bin/${_TOOL_PREFIX}mktemp
361 TOOL_MKUBOOTIMAGE= ${TOOLDIR}/bin/${_TOOL_PREFIX}mkubootimage
362 TOOL_MSGC= MSGDEF=${TOOLDIR}/share/misc ${TOOLDIR}/bin/${_TOOL_PREFIX}msgc
363 TOOL_MTREE= ${TOOLDIR}/bin/${_TOOL_PREFIX}mtree
364 TOOL_NBPERF= ${TOOLDIR}/bin/${_TOOL_PREFIX}perf
365 TOOL_PAX= ${TOOLDIR}/bin/${_TOOL_PREFIX}pax
366 TOOL_PIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}pic
367 TOOL_PIGZ= ${TOOLDIR}/bin/${_TOOL_PREFIX}pigz
368 TOOL_PKG_CREATE= ${TOOLDIR}/bin/${_TOOL_PREFIX}pkg_create
369 TOOL_POWERPCMKBOOTIMAGE=${TOOLDIR}/bin/${_TOOL_PREFIX}powerpc-mkbootimage
370 TOOL_PWD_MKDB= ${TOOLDIR}/bin/${_TOOL_PREFIX}pwd_mkdb
371 TOOL_REFER= ${TOOLDIR}/bin/${_TOOL_PREFIX}refer
372 TOOL_ROFF_ASCII= PATH=${TOOLDIR}/lib/groff:$${PATH} ${TOOLDIR}/bin/${_TOOL_PREFIX}nroff
373 TOOL_ROFF_DVI= ${TOOL_GROFF} -Tdvi
374 TOOL_ROFF_HTML= ${TOOL_GROFF} -Tlatin1 -mdoc2html
375 TOOL_ROFF_PS= ${TOOL_GROFF} -Tps
376 TOOL_ROFF_RAW= ${TOOL_GROFF} -Z
377 TOOL_RPCGEN= RPCGEN_CPP=${CPP:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}rpcgen
378 TOOL_SED= ${TOOLDIR}/bin/${_TOOL_PREFIX}sed
379 TOOL_SLC= ${TOOLDIR}/bin/${_TOOL_PREFIX}slc
380 TOOL_SOELIM= ${TOOLDIR}/bin/${_TOOL_PREFIX}soelim
381 TOOL_SPARKCRC= ${TOOLDIR}/bin/${_TOOL_PREFIX}sparkcrc
382 TOOL_STAT= ${TOOLDIR}/bin/${_TOOL_PREFIX}stat
383 TOOL_STRFILE= ${TOOLDIR}/bin/${_TOOL_PREFIX}strfile
384 TOOL_SUNLABEL= ${TOOLDIR}/bin/${_TOOL_PREFIX}sunlabel
385 TOOL_TBL= ${TOOLDIR}/bin/${_TOOL_PREFIX}tbl
386 TOOL_TIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}tic
387 TOOL_UUDECODE= ${TOOLDIR}/bin/${_TOOL_PREFIX}uudecode
388 TOOL_VGRIND= ${TOOLDIR}/bin/${_TOOL_PREFIX}vgrind -f
389 TOOL_ZIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}zic
391 .else # USETOOLS != yes # } {
393 # Clang supports C, C++ and Objective C
394 TOOL_CC.clang= clang
395 TOOL_CPP.clang= clang-cpp
396 TOOL_CXX.clang= clang++
397 TOOL_OBJC.clang= clang
399 # GCC supports C, C++, Fortran and Objective C
400 TOOL_CC.gcc= gcc
401 TOOL_CPP.gcc= cpp
402 TOOL_CXX.gcc= c++
403 TOOL_FC.gcc= g77
404 TOOL_OBJC.gcc= gcc
406 # PCC supports C and Fortran
407 TOOL_CC.pcc= pcc
408 TOOL_CPP.pcc= /usr/libexec/pcpp
410 TOOL_AMIGAAOUT2BB= amiga-aout2bb
411 TOOL_AMIGAELF2BB= amiga-elf2bb
412 TOOL_AMIGATXLT= amiga-txlt
413 TOOL_ASN1_COMPILE= asn1_compile
414 TOOL_AWK= awk
415 TOOL_CAP_MKDB= cap_mkdb
416 TOOL_CAT= cat
417 TOOL_CKSUM= cksum
418 TOOL_CLANG_TBLGEN= clang-tblgen
419 TOOL_COMPILE_ET= compile_et
420 TOOL_CONFIG= config
421 TOOL_CRUNCHGEN= crunchgen
422 TOOL_CTAGS= ctags
423 TOOL_CTFCONVERT= ctfconvert
424 TOOL_CTFMERGE= ctfmerge
425 TOOL_DB= db
426 TOOL_DISKLABEL= disklabel
427 TOOL_EQN= eqn
428 TOOL_FDISK= fdisk
429 TOOL_FGEN= fgen
430 TOOL_GENASSYM= genassym
431 TOOL_GENCAT= gencat
432 TOOL_GMAKE= gmake
433 TOOL_GREP= grep
434 TOOL_GROFF= groff
435 TOOL_HEXDUMP= hexdump
436 TOOL_HP300MKBOOT= hp300-mkboot
437 TOOL_HP700MKBOOT= hp700-mkboot
438 TOOL_INDXBIB= indxbib
439 TOOL_INSTALLBOOT= installboot
440 TOOL_INSTALL_INFO= install-info
441 TOOL_JOIN= join
442 TOOL_LLVM_TBLGEN= llvm-tblgen
443 TOOL_M4= m4
444 TOOL_MACPPCFIXCOFF= macppc-fixcoff
445 TOOL_MAKEFS= makefs
446 TOOL_MAKEINFO= makeinfo
447 TOOL_MAKEWHATIS= /usr/libexec/makewhatis
448 TOOL_MANDOC_ASCII= mandoc -Tascii
449 TOOL_MANDOC_HTML= mandoc -Thtml -Oman=../html%S/%N.html -Ostyle=../style.css
450 TOOL_MANDOC_LINT= mandoc -Tlint
451 TOOL_MDSETIMAGE= mdsetimage
452 TOOL_MENUC= menuc
453 TOOL_M68KELF2AOUT= m68k-elf2aout
454 TOOL_MIPSELF2ECOFF= mips-elf2ecoff
455 TOOL_MKCSMAPPER= mkcsmapper
456 TOOL_MKESDB= mkesdb
457 TOOL_MKFSMFS= mkfs.mfs
458 TOOL_MKLOCALE= mklocale
459 TOOL_MKMAGIC= file
460 TOOL_MKTEMP= mktemp
461 TOOL_MKUBOOTIMAGE= mkubootimage
462 TOOL_MSGC= msgc
463 TOOL_MTREE= mtree
464 TOOL_NBPERF= nbperf
465 TOOL_PAX= pax
466 TOOL_PIC= pic
467 TOOL_PIGZ= pigz
468 TOOL_PKG_CREATE= pkg_create
469 TOOL_POWERPCMKBOOTIMAGE= powerpc-mkbootimage
470 TOOL_PWD_MKDB= pwd_mkdb
471 TOOL_REFER= refer
472 TOOL_ROFF_ASCII= nroff
473 TOOL_ROFF_DVI= ${TOOL_GROFF} -Tdvi
474 TOOL_ROFF_HTML= ${TOOL_GROFF} -Tlatin1 -mdoc2html
475 TOOL_ROFF_PS= ${TOOL_GROFF} -Tps
476 TOOL_ROFF_RAW= ${TOOL_GROFF} -Z
477 TOOL_RPCGEN= rpcgen
478 TOOL_SED= sed
479 TOOL_SOELIM= soelim
480 TOOL_SPARKCRC= sparkcrc
481 TOOL_STAT= stat
482 TOOL_STRFILE= strfile
483 TOOL_SUNLABEL= sunlabel
484 TOOL_TBL= tbl
485 TOOL_TIC= tic
486 TOOL_UUDECODE= uudecode
487 TOOL_VGRIND= vgrind -f
488 TOOL_ZIC= zic
490 .endif # USETOOLS != yes # }
492 # Fallback to ensure that all variables are defined to something
493 TOOL_CC.false= false
494 TOOL_CPP.false= false
495 TOOL_CXX.false= false
496 TOOL_FC.false= false
497 TOOL_OBJC.false= false
499 AVAILABLE_COMPILER?= ${HAVE_PCC:Dpcc} ${HAVE_LLVM:Dclang} ${HAVE_GCC:Dgcc} false
501 .for _t in CC CPP CXX FC OBJC
502 ACTIVE_${_t}= ${AVAILABLE_COMPILER:@.c.@ ${ !defined(UNSUPPORTED_COMPILER.${.c.}) && defined(TOOL_${_t}.${.c.}) :? ${.c.} : }@:[1]}
503 SUPPORTED_${_t}=${AVAILABLE_COMPILER:Nfalse:@.c.@ ${ !defined(UNSUPPORTED_COMPILER.${.c.}) && defined(TOOL_${_t}.${.c.}) :? ${.c.} : }@}
504 .endfor
505 # make bugs prevent moving this into the .for loop
506 CC= ${TOOL_CC.${ACTIVE_CC}}
507 CPP= ${TOOL_CPP.${ACTIVE_CPP}}
508 CXX= ${TOOL_CXX.${ACTIVE_CXX}}
509 FC= ${TOOL_FC.${ACTIVE_FC}}
510 OBJC= ${TOOL_OBJC.${ACTIVE_OBJC}}
512 # OBJCOPY flags to create a.out binaries for old firmware
513 # shared among src/distrib and ${MACHINE}/conf/Makefile.${MACHINE}.inc
514 .if ${MACHINE_CPU} == "arm"
515 OBJCOPY_ELF2AOUT_FLAGS?= \
516 -O a.out-arm-netbsd \
517 -R .ident \
518 -R .ARM.attributes \
519 -R .ARM.exidx \
520 -R .arm.atpcs \
521 -R .comment \
522 -R .debug_abbrev \
523 -R .debug_info \
524 -R .debug_line \
525 -R .debug_frame \
526 -R .debug_loc \
527 -R .debug_pubnames \
528 -R .debug_aranges \
529 -R .debug_str \
530 -R .debug_pubtypes \
531 -R .note.netbsd.ident
532 .endif
535 # Targets to check if DESTDIR or RELEASEDIR is provided
537 .if !target(check_DESTDIR)
538 check_DESTDIR: .PHONY .NOTMAIN
539 .if !defined(DESTDIR)
540 @echo "setenv DESTDIR before doing that!"
541 @false
542 .else
543 @true
544 .endif
545 .endif
547 .if !target(check_RELEASEDIR)
548 check_RELEASEDIR: .PHONY .NOTMAIN
549 .if !defined(RELEASEDIR)
550 @echo "setenv RELEASEDIR before doing that!"
551 @false
552 .else
553 @true
554 .endif
555 .endif
558 # Build a dynamically linked /bin and /sbin, with the necessary shared
559 # libraries moved from /usr/lib to /lib and the shared linker moved
560 # from /usr/libexec to /lib
562 # Note that if the BINDIR is not /bin or /sbin, then we always use the
563 # non-DYNAMICROOT behavior (i.e. it is only enabled for programs in /bin
564 # and /sbin). See <bsd.shlib.mk>.
566 MKDYNAMICROOT?= yes
569 # Where the system object and source trees are kept; can be configurable
570 # by the user in case they want them in ~/foosrc and ~/fooobj (for example).
572 BSDSRCDIR?= /usr/src
573 BSDOBJDIR?= /usr/obj
574 NETBSDSRCDIR?= ${BSDSRCDIR}
576 BINGRP?= wheel
577 BINOWN?= root
578 BINMODE?= 555
579 NONBINMODE?= 444
581 # These are here mainly because we don't want suid root in case
582 # a Makefile defines BINMODE.
583 RUMPBINGRP?= wheel
584 RUMPBINOWN?= root
585 RUMPBINMODE?= 555
586 RUMPNONBINMODE?=444
588 MANDIR?= /usr/share/man
589 MANGRP?= wheel
590 MANOWN?= root
591 MANMODE?= ${NONBINMODE}
592 MANINSTALL?= ${_MANINSTALL}
594 INFODIR?= /usr/share/info
595 INFOGRP?= wheel
596 INFOOWN?= root
597 INFOMODE?= ${NONBINMODE}
599 LIBDIR?= /usr/lib
601 LINTLIBDIR?= /usr/libdata/lint
602 LIBGRP?= ${BINGRP}
603 LIBOWN?= ${BINOWN}
604 LIBMODE?= ${NONBINMODE}
606 DOCDIR?= /usr/share/doc
607 HTMLDOCDIR?= /usr/share/doc/html
608 DOCGRP?= wheel
609 DOCOWN?= root
610 DOCMODE?= ${NONBINMODE}
612 NLSDIR?= /usr/share/nls
613 NLSGRP?= wheel
614 NLSOWN?= root
615 NLSMODE?= ${NONBINMODE}
617 KMODULEGRP?= wheel
618 KMODULEOWN?= root
619 KMODULEMODE?= ${NONBINMODE}
621 LOCALEDIR?= /usr/share/locale
622 LOCALEGRP?= wheel
623 LOCALEOWN?= root
624 LOCALEMODE?= ${NONBINMODE}
626 FIRMWAREDIR?= /libdata/firmware
627 FIRMWAREGRP?= wheel
628 FIRMWAREOWN?= root
629 FIRMWAREMODE?= ${NONBINMODE}
631 DEBUGDIR?= /usr/libdata/debug
632 DEBUGGRP?= wheel
633 DEBUGOWN?= root
634 DEBUGMODE?= ${NONBINMODE}
637 # Data-driven table using make variables to control how
638 # toolchain-dependent targets and shared libraries are built
639 # for different platforms and object formats.
641 # OBJECT_FMT: currently either "ELF" or "a.out".
643 # All platforms are ELF.
645 OBJECT_FMT= ELF
648 # If this platform's toolchain is missing, we obviously cannot build it.
650 .if ${TOOLCHAIN_MISSING} != "no"
651 MKBINUTILS:= no
652 MKGDB:= no
653 MKGCC:= no
654 .endif
657 # If we are using an external toolchain, we can still build the target's
658 # binutils, but we cannot build GCC's support libraries, since those are
659 # tightly-coupled to the version of GCC being used.
661 .if defined(EXTERNAL_TOOLCHAIN)
662 MKGCC:= no
663 .endif
666 # The m68000 port is incomplete.
668 .if ${MACHINE_ARCH} == "m68000"
669 NOPIC= # defined
670 MKISCSI= no
671 # XXX GCC 4 outputs mcount() calling sequences that try to load values
672 # from over 64KB away and this fails to assemble.
673 .if defined(HAVE_GCC)
674 NOPROFILE= # defined
675 .endif
676 .endif
679 # The ia64 port is incomplete.
681 .if ${MACHINE_ARCH} == "ia64"
682 MKLINT= no
683 MKGDB= no
684 .endif
687 # On the MIPS, all libs are compiled with ABIcalls (and are thus PIC),
688 # not just shared libraries, so don't build the _pic version.
690 .if ${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb" || \
691 ${MACHINE_ARCH} == "mips64el" || ${MACHINE_ARCH} == "mips64eb"
692 MKPICLIB:= no
693 .endif
696 # On VAX using ELF, all objects are PIC, not just shared libraries,
697 # so don't build the _pic version.
699 .if ${MACHINE_ARCH} == "vax"
700 MKPICLIB= no
701 .endif
704 # Location of the file that contains the major and minor numbers of the
705 # version of a shared library. If this file exists a shared library
706 # will be built by <bsd.lib.mk>.
708 SHLIB_VERSION_FILE?= ${.CURDIR}/shlib_version
711 # GNU sources and packages sometimes see architecture names differently.
713 GNU_ARCH.coldfire=m68k
714 # MINIX/arm default
715 GNU_ARCH.earm=arm
716 GCC_CONFIG_ARCH.earm=armv7-a
717 GNU_ARCH.earmeb=armeb
718 # MINIX/intel default
719 GNU_ARCH.i386=i586
720 GCC_CONFIG_ARCH.i386=i586
721 GCC_CONFIG_TUNE.i386=nocona
722 GCC_CONFIG_TUNE.x86_64=nocona
723 GNU_ARCH.m68000=m68010
724 GNU_ARCH.sh3eb=sh
725 GNU_ARCH.sh3el=shle
726 GNU_ARCH.mips64eb=mips64
727 MACHINE_GNU_ARCH=${GNU_ARCH.${MACHINE_ARCH}:U${MACHINE_ARCH}}
730 # In order to identify NetBSD to GNU packages, we sometimes need
731 # an "elf" tag for historically a.out platforms.
733 .if ${MACHINE_ARCH} == "earm" || ${MACHINE_ARCH} == "earmeb"
734 MACHINE_GNU_PLATFORM?=${MACHINE_GNU_ARCH}--netbsdelf-eabi
735 .elif (${MACHINE_GNU_ARCH} == "arm" || \
736 ${MACHINE_GNU_ARCH} == "armeb" || \
737 ${MACHINE_ARCH} == "i386" || \
738 ${MACHINE_CPU} == "m68k" || \
739 ${MACHINE_GNU_ARCH} == "sh" || \
740 ${MACHINE_GNU_ARCH} == "shle" || \
741 ${MACHINE_ARCH} == "sparc" || \
742 ${MACHINE_ARCH} == "vax")
743 MACHINE_GNU_PLATFORM?=${MACHINE_GNU_ARCH}--netbsdelf
744 .else
745 MACHINE_GNU_PLATFORM?=${MACHINE_GNU_ARCH}--netbsd
746 .endif
748 .if defined(__MINIX)
749 # We have a simpler toolchain naming scheme
750 MACHINE_GNU_PLATFORM:=${MACHINE_GNU_ARCH}-elf32-minix
751 .endif # defined(__MINIX)
754 # Determine if arch uses native kernel modules with rump
756 .if ${MACHINE_ARCH} == "i386" || \
757 ${MACHINE_ARCH} == "x86_64"
758 RUMPKMOD= # defined
759 .endif
761 TARGETS+= all clean cleandir depend dependall includes \
762 install lint obj regress tags html analyze
763 PHONY_NOTMAIN = all clean cleandir depend dependall distclean includes \
764 install lint obj regress beforedepend afterdepend \
765 beforeinstall afterinstall realinstall realdepend realall \
766 html subdir-all subdir-install subdir-depend analyze
767 .PHONY: ${PHONY_NOTMAIN}
768 .NOTMAIN: ${PHONY_NOTMAIN}
770 .if ${NEED_OWN_INSTALL_TARGET} != "no"
771 .if !target(install)
772 install: beforeinstall .WAIT subdir-install realinstall .WAIT afterinstall
773 beforeinstall:
774 subdir-install:
775 realinstall:
776 afterinstall:
777 .endif
778 all: realall subdir-all
779 subdir-all:
780 realall:
781 depend: realdepend subdir-depend
782 subdir-depend:
783 realdepend:
784 distclean: cleandir
785 cleandir: clean
787 dependall: .NOTMAIN realdepend .MAKE
788 @cd "${.CURDIR}"; ${MAKE} realall
789 .endif
792 # Define MKxxx variables (which are either yes or no) for users
793 # to set in /etc/mk.conf and override in the make environment.
794 # These should be tested with `== "no"' or `!= "no"'.
795 # The NOxxx variables should only be set by Makefiles.
797 # Please keep etc/Makefile and share/man/man5/mk.conf.5 in sync
798 # with changes to the MK* variables here.
802 # Supported NO* options (if defined, MK* will be forced to "no",
803 # regardless of user's mk.conf setting).
805 # Source makefiles should set NO*, and not MK*, and must do so before
806 # including bsd.own.mk.
808 .for var in \
809 NOCRYPTO NODOC NOHTML NOINFO NOLINKLIB NOLINT NOMAN NONLS NOOBJ NOPIC \
810 NOPICINSTALL NOPROFILE NOSHARE NOSTATICLIB
811 .if defined(${var})
812 MK${var:S/^NO//}:= no
813 .endif
814 .endfor
817 # Older-style variables that enabled behaviour when set.
819 .for var in MANZ UNPRIVED UPDATE
820 .if defined(${var})
821 MK${var}:= yes
822 .endif
823 .endfor
826 # MK* options which have variable defaults.
828 .if ${MACHINE_ARCH} == "x86_64" || ${MACHINE_ARCH} == "sparc64" || \
829 ${MACHINE_ARCH} == "mips64eb" || ${MACHINE_ARCH} == "mips64el"
830 MKCOMPAT?= yes
831 .else
832 # Don't let this build where it really isn't supported.
833 MKCOMPAT:= no
834 .endif
836 #.if ${MACHINE_ARCH} == "x86_64" || ${MACHINE_ARCH} == "i386" || \
838 .if ${MACHINE} == "evbppc"
839 MKCOMPATMODULES?= yes
840 .else
841 MKCOMPATMODULES:= no
842 .endif
845 # Default mips64 to softfloat now.
846 # emips is always softfloat.
848 .if ${MACHINE_ARCH} == "mips64eb" || ${MACHINE_ARCH} == "mips64el" || \
849 ${MACHINE} == "emips"
850 MKSOFTFLOAT?= yes
851 .endif
853 .if ${MACHINE} == "emips"
854 SOFTFLOAT_BITS= 32
855 .endif
858 # MK* backward compatibility.
860 .if defined(MKBFD)
861 MKBINUTILS?= ${MKBFD}
862 .endif
865 # We want to build zfs only for i386 and amd64 by default for now.
867 .if ${MACHINE} == "amd64" || ${MACHINE} == "i386"
868 MKZFS?= yes
869 .endif
871 # Some tough Minix defaults
872 MKCOVERAGE?= no
873 MKPROFILE?= no
874 MKSTATICLIB:= yes
875 MKLINT:= no
877 # LSC MINIX does not support these features ATM.
878 USE_FORT:= no
879 MKYP:= no
880 MKPF:= no
881 MKNLS:= no
882 MKHESIOD:= no
883 MKPOSTFIX:= no
884 MKKMOD:= no
885 MKATF:= no
886 MKEXTSRC:= no
887 MKRUMP:= no
888 MKSKEY:= no
889 MKCRYPTO:= no
890 MKMDNS:= no
891 MKNPF:= no
892 MKISCSI:= no
893 MKLVM:= no
894 MKKERBEROS:= no
895 MKLDAP:= no
896 MKPAM:= no
897 MKIPFILTER:= no
898 MKINET6:= no
899 MKGROFF:= no
900 MKHTML:= no
903 # MK* options which default to "yes".
905 _MKVARS.yes= \
906 MKATF \
907 MKBINUTILS \
908 MKCRYPTO MKCOMPLEX MKCVS MKCXX \
909 MKDOC \
910 MKGCC MKGCCCMDS MKGDB MKGROFF \
911 MKHESIOD MKHTML \
912 MKIEEEFP MKINET6 MKINFO MKIPFILTER MKISCSI \
913 MKKERBEROS \
914 MKKMOD \
915 MKLDAP MKLINKLIB MKLINT MKLVM \
916 MKMAN MKMANDOC \
917 MKMDNS \
918 MKMAKEMANDB \
919 MKNLS \
920 MKNPF \
921 MKOBJ \
922 MKPAM MKPERFUSE \
923 MKPF MKPIC MKPICINSTALL MKPICLIB MKPOSTFIX MKPROFILE \
924 MKRUMP \
925 MKSHARE MKSKEY MKSTATICLIB \
926 MKX11FONTS \
927 MKYP
929 #MINIX-specific vars
930 _MKVARS.yes+= \
931 MKMCONTEXT MKSYSDEBUG MKLIVEUPDATE MKSTATECTL MKTRACE
932 .if (${MACHINE_ARCH} == "i386")
933 _MKVARS.yes+= \
934 MKWATCHDOG MKACPI MKAPIC MKDEBUGREG MKINSTALLBOOT MKPCI
935 .endif
937 .for var in ${_MKVARS.yes}
938 ${var}?= yes
939 .endfor
942 # Exceptions to the above:
944 #.if ${MACHINE} == "evbppc"
945 #MKKMOD= no
946 #.endif
949 # MK* options which default to "no". Note that MKZFS has a different
950 # default for some platforms, see above.
952 _MKVARS.no= \
953 MKBSDGREP MKBSDTAR \
954 MKCATPAGES MKCRYPTO_RC5 MKDEBUG \
955 MKDEBUGLIB MKDTRACE MKEXTSRC \
956 MKMANZ MKOBJDIRS \
957 MKLLVM MKPCC \
958 MKPIGZGZIP \
959 MKREPRO \
960 MKSOFTFLOAT MKSTRIPIDENT \
961 MKUNPRIVED MKUPDATE MKX11 MKZFS
963 #MINIX-specific vars
964 _MKVARS.no+= \
965 MKIMAGEONLY MKSMALL
966 .if (${MACHINE_ARCH} == "earm")
967 _MKVARS.no+= \
968 MKWATCHDOG MKACPI MKAPIC MKDEBUGREG MKINSTALLBOOT MKPCI
969 .endif
971 .for var in ${_MKVARS.no}
972 ${var}?=no
973 .endfor
976 # Do we default to XFree86 or Xorg for this platform?
978 .if \
979 ${MACHINE} == "acorn32" || \
980 ${MACHINE} == "alpha" || \
981 ${MACHINE} == "amiga" || \
982 ${MACHINE} == "ews4800mips" || \
983 ${MACHINE} == "mac68k" || \
984 ${MACHINE} == "newsmips" || \
985 ${MACHINE} == "pmax" || \
986 ${MACHINE} == "sun3" || \
987 ${MACHINE} == "x68k"
988 X11FLAVOUR?= XFree86
989 .else
990 X11FLAVOUR?= Xorg
991 .endif
994 # Force some options off if their dependencies are off.
997 .if ${MKCXX} == "no"
998 MKATF:= no
999 MKGROFF:= no
1000 .endif
1002 .if ${MKCRYPTO} == "no"
1003 MKKERBEROS:= no
1004 MKLDAP:= no
1005 .endif
1007 .if ${MKMAN} == "no"
1008 MKCATPAGES:= no
1009 MKHTML:= no
1010 .endif
1012 _MANINSTALL= maninstall
1013 .if ${MKCATPAGES} != "no"
1014 _MANINSTALL+= catinstall
1015 .endif
1016 .if ${MKHTML} != "no"
1017 _MANINSTALL+= htmlinstall
1018 .endif
1020 .if ${MKLINKLIB} == "no"
1021 MKLINT:= no
1022 MKPICINSTALL:= no
1023 MKPROFILE:= no
1024 .endif
1026 .if ${MKPIC} == "no"
1027 MKPICLIB:= no
1028 .endif
1030 .if ${MKOBJ} == "no"
1031 MKOBJDIRS:= no
1032 .endif
1034 .if ${MKSHARE} == "no"
1035 MKCATPAGES:= no
1036 MKDOC:= no
1037 MKINFO:= no
1038 MKHTML:= no
1039 MKMAN:= no
1040 MKNLS:= no
1041 .endif
1043 # MINIX
1044 .if ${MKSMALL} == "yes"
1045 MKWATCHDOG:= no
1046 MKACPI:= no
1047 MKAPIC:= no
1048 MKMCONTEXT:= no
1049 MKDEBUGREG:= no
1050 MKSYSDEBUG:= no
1051 MKLIVEUPDATE:= no
1052 MKSTATECTL:= no
1053 MKTRACE:= no
1054 .endif
1057 # install(1) parameters.
1059 COPY?= -c
1060 .if ${HOST_OSTYPE:C/\-.*//} != "Minix"
1061 .if ${MKUPDATE} == "no"
1062 PRESERVE?=
1063 .else
1064 #LSC: Not supported by MINIX install
1065 PRESERVE?= -p
1066 .endif
1067 #XXX: Not supported by MINIX install
1068 RENAME?= -r
1069 .endif # != "Minix"
1070 HRDLINK?= -l h
1071 SYMLINK?= -l s
1073 METALOG?= ${DESTDIR}/METALOG
1074 METALOG.add?= ${TOOL_CAT} -l >> ${METALOG}
1075 .if (${_SRC_TOP_} != "") # only set INSTPRIV if inside ${NETBSDSRCDIR}
1076 .if ${MKUNPRIVED} != "no"
1077 INSTPRIV.unpriv=-U -M ${METALOG} -D ${DESTDIR} -h sha256
1078 .else
1079 INSTPRIV.unpriv=
1080 .endif
1081 INSTPRIV?= ${INSTPRIV.unpriv} -N ${NETBSDSRCDIR}/etc
1082 .endif
1083 STRIPFLAG?=
1085 .if ${NEED_OWN_INSTALL_TARGET} != "no"
1086 INSTALL_DIR?= ${INSTALL} ${INSTPRIV} -d
1087 INSTALL_FILE?= ${INSTALL} ${INSTPRIV} ${COPY} ${PRESERVE} ${RENAME}
1088 INSTALL_LINK?= ${INSTALL} ${INSTPRIV} ${HRDLINK} ${RENAME}
1089 INSTALL_SYMLINK?= ${INSTALL} ${INSTPRIV} ${SYMLINK} ${RENAME}
1090 HOST_INSTALL_FILE?= ${INSTALL} ${COPY} ${PRESERVE} ${RENAME}
1091 HOST_INSTALL_DIR?= ${INSTALL} -d
1092 HOST_INSTALL_SYMLINK?= ${INSTALL} ${SYMLINK} ${RENAME}
1093 .endif
1096 # Set defaults for the USE_xxx variables.
1100 # USE_* options which default to "no" and will be forced to "no" if their
1101 # corresponding MK* variable is set to "no".
1103 .for var in USE_SKEY
1104 .if (${${var:S/USE_/MK/}} == "no")
1105 ${var}:= no
1106 .else
1107 ${var}?= no
1108 .endif
1109 .endfor
1112 # USE_* options which default to "yes" unless their corresponding MK*
1113 # variable is set to "no".
1115 .for var in USE_HESIOD USE_INET6 USE_KERBEROS USE_LDAP USE_PAM USE_YP
1116 .if (${${var:S/USE_/MK/}} == "no")
1117 ${var}:= no
1118 .else
1119 ${var}?= yes
1120 .endif
1121 .endfor
1123 #MINIX-specific vars
1124 .for var in \
1125 USE_WATCHDOG USE_ACPI USE_APIC USE_MCONTEXT USE_DEBUGREG USE_SYSDEBUG \
1126 USE_LIVEUPDATE USE_STATECTL USE_TRACE USE_PCI
1127 .if (${${var:S/USE_/MK/}} == "no")
1128 ${var}:= no
1129 .else
1130 ${var}?= yes
1131 .endif
1132 .endfor
1135 # USE_* options which default to "yes".
1137 .for var in USE_JEMALLOC
1138 ${var}?= yes
1139 .endfor
1142 # USE_* options which default to "no".
1144 # For now, disable pigz as compressor by default
1145 .for var in USE_PIGZGZIP USE_LIBTRE
1146 ${var}?= no
1147 .endfor
1149 .if ${USE_PIGZGZIP} != "no"
1150 TOOL_GZIP= ${TOOL_PIGZ}
1151 .else
1152 TOOL_GZIP= gzip
1153 .endif
1156 # Where X11 sources are and where it is installed to.
1158 .if !defined(X11SRCDIR)
1159 .if exists(${NETBSDSRCDIR}/../xsrc)
1160 X11SRCDIR!= cd "${NETBSDSRCDIR}/../xsrc" && pwd
1161 .else
1162 X11SRCDIR= /usr/xsrc
1163 .endif
1164 .endif # !defined(X11SRCDIR)
1166 X11SRCDIR.xc?= ${X11SRCDIR}/xfree/xc
1167 X11SRCDIR.local?= ${X11SRCDIR}/local
1168 .if ${X11FLAVOUR} == "Xorg"
1169 X11ROOTDIR?= /usr/X11R7
1170 .else
1171 X11ROOTDIR?= /usr/X11R6
1172 .endif
1173 X11BINDIR?= ${X11ROOTDIR}/bin
1174 X11ETCDIR?= /etc/X11
1175 X11FONTDIR?= ${X11ROOTDIR}/lib/X11/fonts
1176 X11INCDIR?= ${X11ROOTDIR}/include
1177 X11LIBDIR?= ${X11ROOTDIR}/lib/X11
1178 X11MANDIR?= ${X11ROOTDIR}/man
1179 X11SHAREDIR?= ${X11ROOTDIR}/share
1180 X11USRLIBDIR?= ${X11ROOTDIR}/lib
1183 # New modular-xorg based builds
1185 X11SRCDIRMIT?= ${X11SRCDIR}/external/mit
1186 .for _lib in \
1187 FS ICE SM X11 XScrnSaver XTrap Xau Xcomposite Xcursor Xdamage \
1188 Xdmcp Xevie Xext Xfixes Xfont Xft Xi Xinerama Xmu Xpm \
1189 Xrandr Xrender Xres Xt Xtst Xv XvMC Xxf86dga Xxf86misc Xxf86vm drm \
1190 fontenc xkbfile xkbui Xaw lbxutil Xfontcache pciaccess xcb
1191 X11SRCDIR.${_lib}?= ${X11SRCDIRMIT}/lib${_lib}/dist
1192 .endfor
1194 .for _proto in \
1195 xcmisc xext xf86bigfont bigreqs input kb x fonts fixes scrnsaver \
1196 xinerama dri2 render resource record video xf86dga xf86misc \
1197 xf86vidmode composite damage trap gl randr fontcache xf86dri \
1198 xcb-
1199 X11SRCDIR.${_proto}proto?= ${X11SRCDIRMIT}/${_proto}proto/dist
1200 .endfor
1202 .for _dir in \
1203 xtrans fontconfig expat freetype evieext mkfontscale bdftopcf \
1204 xkbcomp xorg-cf-files imake xorg-server xbiff xkbdata xkeyboard-config \
1205 xbitmaps appres xeyes xev xedit sessreg pixman \
1206 beforelight bitmap editres makedepend fonttosfnt fslsfonts \
1207 fstobdf MesaDemos MesaGLUT MesaLib ico iceauth lbxproxy listres lndir \
1208 luit xproxymanagementprotocol mkfontdir oclock proxymngr rgb \
1209 setxkbmap smproxy twm viewres x11perf xauth xcalc xclipboard \
1210 xclock xcmsdb xconsole xcutsel xditview xdpyinfo xdriinfo xdm \
1211 xfd xf86dga xfindproxy xfontsel xfwp xgamma xgc xhost xinit \
1212 xkill xload xlogo xlsatoms xlsclients xlsfonts xmag xmessage \
1213 xmh xmodmap xmore xman xprop xrandr xrdb xrefresh xset \
1214 xsetmode xsetpointer xsetroot xsm xstdcmap xvidtune xvinfo \
1215 xwininfo xwud xprehashprinterlist xplsprinters xkbprint xkbevd \
1216 xterm xwd xfs xfsinfo xphelloworld xtrap xkbutils xkbcomp \
1217 xkeyboard-config xinput xcb-util \
1218 font-adobe-100dpi font-adobe-75dpi font-adobe-utopia-100dpi \
1219 font-adobe-utopia-75dpi font-adobe-utopia-type1 \
1220 font-alias \
1221 font-bh-100dpi font-bh-75dpi font-bh-lucidatypewriter-100dpi \
1222 font-bh-lucidatypewriter-75dpi font-bh-ttf font-bh-type1 \
1223 font-bitstream-100dpi font-bitstream-75dpi font-bitstream-type1 \
1224 font-cursor-misc font-daewoo-misc font-dec-misc font-ibm-type1 \
1225 font-isas-misc font-jis-misc font-misc-misc font-mutt-misc \
1226 font-sony-misc font-util ttf-bitstream-vera encodings
1227 X11SRCDIR.${_dir}?= ${X11SRCDIRMIT}/${_dir}/dist
1228 .endfor
1230 .for _i in \
1231 elographics keyboard mouse synaptics vmmouse void ws
1232 X11SRCDIR.xf86-input-${_i}?= ${X11SRCDIRMIT}/xf86-input-${_i}/dist
1233 .endfor
1235 .for _v in \
1236 ag10e apm ark ast ati chips cirrus crime \
1237 geode glint i128 i740 igs imstt intel mach64 mga \
1238 neomagic newport nsc nv nvxbox openchrome pnozz \
1239 r128 radeonhd rendition \
1240 s3 s3virge savage siliconmotion sis suncg14 \
1241 suncg6 sunffb sunleo suntcx \
1242 tdfx tga trident tseng vesa vga via vmware wsfb xgi
1243 X11SRCDIR.xf86-video-${_v}?= ${X11SRCDIRMIT}/xf86-video-${_v}/dist
1244 .endfor
1246 .if ${X11FLAVOUR} == "Xorg"
1247 X11DRI?= yes
1248 .endif
1250 X11DRI?= no
1251 X11LOADABLE?= yes
1255 # Where extsrc sources are and where it is installed to.
1257 .if !defined(EXTSRCSRCDIR)
1258 .if exists(${NETBSDSRCDIR}/../extsrc)
1259 EXTSRCSRCDIR!= cd "${NETBSDSRCDIR}/../extsrc" && pwd
1260 .else
1261 EXTSRCSRCDIR= /usr/extsrc
1262 .endif
1263 .endif # !defined(EXTSRCSRCDIR)
1265 EXTSRCROOTDIR?= /usr/ext
1266 EXTSRCBINDIR?= ${EXTSRCROOTDIR}/bin
1267 EXTSRCETCDIR?= /etc/ext
1268 EXTSRCINCDIR?= ${EXTSRCROOTDIR}/include
1269 EXTSRCLIBDIR?= ${EXTSRCROOTDIR}/lib/ext
1270 EXTSRCMANDIR?= ${EXTSRCROOTDIR}/man
1271 EXTSRCUSRLIBDIR?= ${EXTSRCROOTDIR}/lib
1274 # MAKEDIRTARGET dir target [extra make(1) params]
1275 # run "cd $${dir} && ${MAKEDIRTARGETENV} ${MAKE} [params] $${target}", with a pretty message
1277 MAKEDIRTARGETENV?=
1278 MAKEDIRTARGET=\
1279 @_makedirtarget() { \
1280 dir="$$1"; shift; \
1281 target="$$1"; shift; \
1282 case "$${dir}" in \
1283 /*) this="$${dir}/"; \
1284 real="$${dir}" ;; \
1285 .) this="${_THISDIR_}"; \
1286 real="${.CURDIR}" ;; \
1287 *) this="${_THISDIR_}$${dir}/"; \
1288 real="${.CURDIR}/$${dir}" ;; \
1289 esac; \
1290 show=$${this:-.}; \
1291 echo "$${target} ===> $${show%/}$${1:+ (with: $$@)}"; \
1292 cd "$${real}" \
1293 && ${MAKEDIRTARGETENV} ${MAKE} _THISDIR_="$${this}" "$$@" $${target}; \
1294 }; \
1295 _makedirtarget
1298 # MAKEVERBOSE support. Levels are:
1299 # 0 Minimal output ("quiet")
1300 # 1 Describe what is occurring
1301 # 2 Describe what is occurring and echo the actual command
1302 # 3 Ignore the effect of the "@" prefix in make commands
1303 # 4 Trace shell commands using the shell's -x flag
1305 MAKEVERBOSE?= 2
1307 .if ${MAKEVERBOSE} == 0
1308 _MKMSG?= @\#
1309 _MKSHMSG?= : echo
1310 _MKSHECHO?= : echo
1311 .SILENT:
1312 .elif ${MAKEVERBOSE} == 1
1313 _MKMSG?= @echo ' '
1314 _MKSHMSG?= echo ' '
1315 _MKSHECHO?= : echo
1316 .SILENT:
1317 .else # MAKEVERBOSE >= 2
1318 _MKMSG?= @echo '\# '
1319 _MKSHMSG?= echo '\# '
1320 _MKSHECHO?= echo
1321 .SILENT: __makeverbose_dummy_target__
1322 .endif # MAKEVERBOSE >= 2
1323 .if ${MAKEVERBOSE} >= 3
1324 .MAKEFLAGS: -dl
1325 .endif # ${MAKEVERBOSE} >= 3
1326 .if ${MAKEVERBOSE} >= 4
1327 .MAKEFLAGS: -dx
1328 .endif # ${MAKEVERBOSE} >= 4
1330 _MKMSG_BUILD?= ${_MKMSG} " build "
1331 _MKMSG_CREATE?= ${_MKMSG} " create "
1332 _MKMSG_COMPILE?= ${_MKMSG} "compile "
1333 _MKMSG_FORMAT?= ${_MKMSG} " format "
1334 _MKMSG_INSTALL?= ${_MKMSG} "install "
1335 _MKMSG_LINK?= ${_MKMSG} " link "
1336 _MKMSG_LEX?= ${_MKMSG} " lex "
1337 _MKMSG_REMOVE?= ${_MKMSG} " remove "
1338 _MKMSG_YACC?= ${_MKMSG} " yacc "
1340 _MKSHMSG_CREATE?= ${_MKSHMSG} " create "
1341 _MKSHMSG_INSTALL?= ${_MKSHMSG} "install "
1343 _MKTARGET_BUILD?= ${_MKMSG_BUILD} ${.CURDIR:T}/${.TARGET}
1344 _MKTARGET_CREATE?= ${_MKMSG_CREATE} ${.CURDIR:T}/${.TARGET}
1345 _MKTARGET_COMPILE?= ${_MKMSG_COMPILE} ${.CURDIR:T}/${.TARGET}
1346 _MKTARGET_FORMAT?= ${_MKMSG_FORMAT} ${.CURDIR:T}/${.TARGET}
1347 _MKTARGET_INSTALL?= ${_MKMSG_INSTALL} ${.TARGET}
1348 _MKTARGET_LINK?= ${_MKMSG_LINK} ${.CURDIR:T}/${.TARGET}
1349 _MKTARGET_LEX?= ${_MKMSG_LEX} ${.CURDIR:T}/${.TARGET}
1350 _MKTARGET_REMOVE?= ${_MKMSG_REMOVE} ${.TARGET}
1351 _MKTARGET_YACC?= ${_MKMSG_YACC} ${.CURDIR:T}/${.TARGET}
1353 .if ${MKMANDOC} == "yes"
1354 TARGETS+= lintmanpages
1355 .endif
1357 TESTSBASE= /usr/tests
1359 .endif # !defined(_BSD_OWN_MK_)