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