Annotation of src/share/mk/bsd.own.mk, Revision 1.1049
1.1049 ! mrg 1: # $NetBSD: bsd.own.mk,v 1.1048 2018/03/11 07:18:49 mrg Exp $
1.611 mrg 2:
3: # This needs to be before bsd.init.mk
4: .if defined(BSD_MK_COMPAT_FILE)
5: .include <${BSD_MK_COMPAT_FILE}>
6: .endif
1.64 lukem 7:
8: .if !defined(_BSD_OWN_MK_)
9: _BSD_OWN_MK_=1
1.24 thorpej 10:
1.169 tv 11: MAKECONF?= /etc/mk.conf
1.205 tv 12: .-include "${MAKECONF}"
1.13 mycroft 13:
1.341 lukem 14: #
1.310 thorpej 15: # CPU model, derived from MACHINE_ARCH
1.341 lukem 16: #
1.835 matt 17: 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/}
1.310 thorpej 18:
1.341 lukem 19: #
1.418 cl 20: # Subdirectory used below ${RELEASEDIR} when building a release
21: #
22: RELEASEMACHINEDIR?= ${MACHINE}
23:
24: #
25: # Subdirectory or path component used for the following paths:
26: # distrib/${RELEASEMACHINE}
27: # distrib/notes/${RELEASEMACHINE}
28: # etc/etc.${RELEASEMACHINE}
29: # Used when building a release.
30: #
31: RELEASEMACHINE?= ${MACHINE}
32:
33: #
1.209 tv 34: # NEED_OWN_INSTALL_TARGET is set to "no" by pkgsrc/mk/bsd.pkg.mk to
35: # ensure that things defined by <bsd.own.mk> (default targets,
36: # INSTALL_FILE, etc.) are not conflicting with bsd.pkg.mk.
1.341 lukem 37: #
1.209 tv 38: NEED_OWN_INSTALL_TARGET?= yes
39:
1.341 lukem 40: #
1.644 skrll 41: # This lists the platforms which do not have working in-tree toolchains. For
42: # the in-tree gcc toolchain, this list is empty.
43: #
44: # If some future port is not supported by the in-tree toolchain, this should
45: # be set to "yes" for that port only.
1.341 lukem 46: #
1.911 martin 47: # .if ${MACHINE} == "playstation2"
48: # TOOLCHAIN_MISSING?= yes
49: # .endif
1.817 mrg 50:
1.448 mrg 51: TOOLCHAIN_MISSING?= no
1.221 thorpej 52:
1.831 justin 53: .if ${MACHINE_CPU} == "aarch64" && !defined(EXTERNAL_TOOLCHAIN) && ${MKLLVM:Uyes} != "no"
1.827 matt 54: MKLLVM?= yes
55: HAVE_LLVM?= yes
56: MKGCC?= no
57: .endif
58:
1.676 mrg 59: #
1.770 mrg 60: # GCC Using platforms.
61: #
62: .if ${MKGCC:Uyes} != "no"
63:
1.916 mrg 64: #
65: # What GCC is used?
66: #
1.1041 mrg 67: .if \
68: ${MACHINE_CPU} == "aarch64"
1.908 christos 69: HAVE_GCC?= 0
1.1034 mrg 70: .elif \
1.1045 mrg 71: ${MACHINE_CPU} == "m68000" || \
72: ${MACHINE_CPU} == "m68k" || \
73: ${MACHINE_CPU} == "vax"
74: HAVE_GCC?= 5
75: .else
1.1033 christos 76: HAVE_GCC?= 6
1.699 abs 77: .endif
1.676 mrg 78:
1.768 mrg 79: #
1.840 mrg 80: # Platforms that can't run a modern GCC natively
81: .if ${MACHINE_ARCH} == "m68000"
82: MKGCCCMDS?= no
83: .endif
84:
85: #
1.768 mrg 86: # We import the old gcc as "gcc.old" when upgrading. EXTERNAL_GCC_SUBDIR is
87: # set to the relevant subdirectory in src/external/gpl3 for his HAVE_GCC.
88: #
1.1030 mrg 89: .if ${HAVE_GCC} == 6
90: EXTERNAL_GCC_SUBDIR?= gcc
91: .elif ${HAVE_GCC} == 5
1.1025 mrg 92: EXTERNAL_GCC_SUBDIR?= gcc.old
1.768 mrg 93: .else
1.1025 mrg 94: EXTERNAL_GCC_SUBDIR=? /does/not/exist
1.768 mrg 95: .endif
1.859 matt 96: .else
97: MKGCCCMDS?= no
1.770 mrg 98: .endif
99:
1.1031 christos 100: #
101: # What OpenSSL is used?
102: #
1.1032 christos 103: HAVE_OPENSSL?= 11
1.1031 christos 104:
105: .if ${HAVE_OPENSSL} == 11
106: EXTERNAL_OPENSSL_SUBDIR=openssl
107: .elif ${HAVE_OPENSSL} == 10
108: EXTERNAL_OPENSSL_SUBDIR=openssl.old
109: .else
110: EXTERNAL_OPENSSL_SUBDIR=/does/not/exist
111: .endif
112:
1.805 joerg 113: .if !empty(MACHINE_ARCH:Mearm*)
1.806 joerg 114: _LIBC_COMPILER_RT.${MACHINE_ARCH}= yes
1.805 joerg 115: .endif
116:
1.827 matt 117: _LIBC_COMPILER_RT.aarch64= yes
1.977 mrg 118: _LIBC_COMPILER_RT.aarch64eb= yes
1.805 joerg 119: _LIBC_COMPILER_RT.i386= yes
1.828 joerg 120: _LIBC_COMPILER_RT.powerpc= yes
1.832 joerg 121: _LIBC_COMPILER_RT.powerpc64= yes
1.903 joerg 122: _LIBC_COMPILER_RT.sparc= yes
123: _LIBC_COMPILER_RT.sparc64= yes
1.805 joerg 124: _LIBC_COMPILER_RT.x86_64= yes
125:
1.836 apb 126: .if ${HAVE_LLVM:Uno} == "yes" && ${_LIBC_COMPILER_RT.${MACHINE_ARCH}:Uno} == "yes"
1.753 joerg 127: HAVE_LIBGCC?= no
1.752 joerg 128: .else
1.753 joerg 129: HAVE_LIBGCC?= yes
1.752 joerg 130: .endif
131:
1.827 matt 132:
1.810 joerg 133: # ia64 is not support
1.836 apb 134: .if ${HAVE_LLVM:Uno} == "yes" || !empty(MACHINE_ARCH:Mearm*)
1.763 joerg 135: HAVE_LIBGCC_EH?= no
136: .else
137: HAVE_LIBGCC_EH?= yes
138: .endif
139:
1.1027 christos 140: # Coverity does not like SSP
141: .if defined(COVERITY_TOP_CONFIG) || \
142: ${MACHINE} == "alpha" || \
1.916 mrg 143: ${MACHINE} == "hppa" || \
144: ${MACHINE} == "ia64" || \
145: ${MACHINE_CPU} == "mips"
1.721 christos 146: HAVE_SSP?= no
147: .else
148: HAVE_SSP?= yes
1.907 christos 149: .if !defined(NOFORT) && ${USE_FORT:Uno} != "no"
1.721 christos 150: USE_SSP?= yes
151: .endif
152: .endif
153:
1.916 mrg 154: #
155: # What GDB is used?
156: #
1.1024 christos 157: HAVE_GDB?= 801
1.886 christos 158:
1.1020 christos 159: .if ${HAVE_GDB} == 801
1.967 christos 160: EXTERNAL_GDB_SUBDIR= gdb
1.1020 christos 161: .elif ${HAVE_GDB} == 712
1.969 christos 162: EXTERNAL_GDB_SUBDIR= gdb.old
1.894 christos 163: .else
1.967 christos 164: EXTERNAL_GDB_SUBDIR= /does/not/exist
1.886 christos 165: .endif
166:
1.916 mrg 167: #
168: # What binutils is used?
169: #
1.983 christos 170: HAVE_BINUTILS?= 227
1.886 christos 171:
1.999 christos 172: .if ${HAVE_BINUTILS} == 227
173: EXTERNAL_BINUTILS_SUBDIR= binutils
1.886 christos 174: .else
175: EXTERNAL_BINUTILS_SUBDIR= /does/not/exist
176: .endif
177:
1.713 apb 178: .if empty(.MAKEFLAGS:tW:M*-V .OBJDIR*)
1.489 dsl 179: .if defined(MAKEOBJDIRPREFIX) || defined(MAKEOBJDIR)
180: PRINTOBJDIR= ${MAKE} -r -V .OBJDIR -f /dev/null xxx
181: .else
1.488 drochner 182: PRINTOBJDIR= ${MAKE} -V .OBJDIR
1.489 dsl 183: .endif
1.222 perry 184: .else
1.713 apb 185: PRINTOBJDIR= echo /error/bsd.own.mk/PRINTOBJDIR # avoid infinite recursion
1.222 perry 186: .endif
187:
1.341 lukem 188: #
1.286 lukem 189: # Determine if running in the NetBSD source tree by checking for the
190: # existence of build.sh and tools/ in the current or a parent directory,
191: # and setting _SRC_TOP_ to the result.
192: #
1.287 lukem 193: .if !defined(_SRC_TOP_) # {
1.615 christos 194: _SRC_TOP_!= cd "${.CURDIR}"; while :; do \
1.200 jmc 195: here=`pwd`; \
1.199 jmc 196: [ -f build.sh ] && [ -d tools ] && { echo $$here; break; }; \
197: case $$here in /) echo ""; break;; esac; \
1.341 lukem 198: cd ..; done
1.199 jmc 199:
200: .MAKEOVERRIDES+= _SRC_TOP_
201:
1.287 lukem 202: .endif # }
1.222 perry 203:
1.341 lukem 204: #
1.707 apb 205: # If _SRC_TOP_ != "", we're within the NetBSD source tree.
206: # * Set defaults for NETBSDSRCDIR and _SRC_TOP_OBJ_.
207: # * Define _NETBSD_VERSION_DEPENDS. Targets that depend on the
208: # NetBSD version, or on variables defined at build time, can
209: # declare a dependency on ${_NETBSD_VERSION_DEPENDS}.
1.287 lukem 210: #
211: .if (${_SRC_TOP_} != "") # {
212:
1.288 lukem 213: NETBSDSRCDIR?= ${_SRC_TOP_}
1.180 tv 214:
1.287 lukem 215: .if !defined(_SRC_TOP_OBJ_)
1.615 christos 216: _SRC_TOP_OBJ_!= cd "${_SRC_TOP_}" && ${PRINTOBJDIR}
1.287 lukem 217: .MAKEOVERRIDES+= _SRC_TOP_OBJ_
1.286 lukem 218: .endif
219:
1.707 apb 220: _NETBSD_VERSION_DEPENDS= ${_SRC_TOP_OBJ_}/params
221: _NETBSD_VERSION_DEPENDS+= ${NETBSDSRCDIR}/sys/sys/param.h
222: _NETBSD_VERSION_DEPENDS+= ${NETBSDSRCDIR}/sys/conf/newvers.sh
223: _NETBSD_VERSION_DEPENDS+= ${NETBSDSRCDIR}/sys/conf/osrelease.sh
224: ${_SRC_TOP_OBJ_}/params: .NOTMAIN .OPTIONAL # created by top level "make build"
225:
1.322 lukem 226: .endif # _SRC_TOP_ != "" # }
1.286 lukem 227:
228:
1.310 thorpej 229: .if (${_SRC_TOP_} != "") && \
1.406 lukem 230: (${TOOLCHAIN_MISSING} == "no" || defined(EXTERNAL_TOOLCHAIN))
1.287 lukem 231: USETOOLS?= yes
1.286 lukem 232: .endif
1.287 lukem 233: USETOOLS?= no
234:
1.286 lukem 235:
1.468 matt 236: .if ${MACHINE_ARCH} == "mips" || ${MACHINE_ARCH} == "mips64" || \
1.495 scw 237: ${MACHINE_ARCH} == "sh3"
1.180 tv 238: .BEGIN:
239: @echo "Must set MACHINE_ARCH to one of ${MACHINE_ARCH}eb or ${MACHINE_ARCH}el"
240: @false
1.310 thorpej 241: .elif defined(REQUIRETOOLS) && \
1.406 lukem 242: (${TOOLCHAIN_MISSING} == "no" || defined(EXTERNAL_TOOLCHAIN)) && \
1.310 thorpej 243: ${USETOOLS} == "no"
1.180 tv 244: .BEGIN:
1.203 tv 245: @echo "USETOOLS=no, but this component requires a version-specific host toolchain"
1.180 tv 246: @false
247: .endif
248:
1.341 lukem 249: #
1.204 tv 250: # Host platform information; may be overridden
1.341 lukem 251: #
1.762 christos 252: .include <bsd.host.mk>
1.204 tv 253:
1.275 lukem 254: .if ${USETOOLS} == "yes" # {
255:
1.341 lukem 256: #
1.204 tv 257: # Provide a default for TOOLDIR.
1.341 lukem 258: #
1.199 jmc 259: .if !defined(TOOLDIR)
1.339 lukem 260: TOOLDIR:= ${_SRC_TOP_OBJ_}/tooldir.${HOST_OSTYPE}
1.204 tv 261: .MAKEOVERRIDES+= TOOLDIR
1.199 jmc 262: .endif
1.180 tv 263:
1.341 lukem 264: #
1.320 thorpej 265: # This is the prefix used for the NetBSD-sourced tools.
1.341 lukem 266: #
1.320 thorpej 267: _TOOL_PREFIX?= nb
268:
1.341 lukem 269: #
1.318 thorpej 270: # If an external toolchain base is specified, use it.
1.341 lukem 271: #
272: .if defined(EXTERNAL_TOOLCHAIN) # {
1.318 thorpej 273: AR= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-ar
274: AS= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-as
275: LD= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-ld
276: NM= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-nm
277: OBJCOPY= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-objcopy
278: OBJDUMP= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-objdump
279: RANLIB= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-ranlib
1.854 pooka 280: READELF= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-readelf
1.318 thorpej 281: SIZE= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-size
1.854 pooka 282: STRINGS= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-strings
1.318 thorpej 283: STRIP= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-strip
284:
1.667 joerg 285: TOOL_CC.gcc= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-gcc
286: TOOL_CPP.gcc= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-cpp
287: TOOL_CXX.gcc= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-c++
288: TOOL_FC.gcc= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-g77
289: TOOL_OBJC.gcc= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-gcc
1.714 pooka 290:
291: TOOL_CC.clang= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-clang
292: TOOL_CPP.clang= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-clang-cpp
293: TOOL_CXX.clang= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-clang++
294: TOOL_OBJC.clang= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-clang
1.341 lukem 295: .else # } {
1.204 tv 296: # Define default locations for common tools.
1.341 lukem 297: .if ${USETOOLS_BINUTILS:Uyes} == "yes" # {
1.232 tv 298: AR= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ar
299: AS= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-as
1.234 thorpej 300: LD= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ld
301: NM= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-nm
302: OBJCOPY= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-objcopy
303: OBJDUMP= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-objdump
304: RANLIB= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ranlib
1.854 pooka 305: READELF= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-readelf
1.234 thorpej 306: SIZE= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-size
1.854 pooka 307: STRINGS= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-strings
1.234 thorpej 308: STRIP= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-strip
309:
1.667 joerg 310: # GCC supports C, C++, Fortran and Objective C
311: TOOL_CC.gcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-gcc
312: TOOL_CPP.gcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-cpp
313: TOOL_CXX.gcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-c++
314: TOOL_FC.gcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-g77
315: TOOL_OBJC.gcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-gcc
1.341 lukem 316: .endif # }
1.519 gmcgarry 317:
1.667 joerg 318: # Clang supports C, C++ and Objective C
319: TOOL_CC.clang= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-clang
320: TOOL_CPP.clang= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-clang-cpp
321: TOOL_CXX.clang= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-clang++
322: TOOL_OBJC.clang= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-clang
323:
324: # PCC supports C and Fortran
325: TOOL_CC.pcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-pcc
1.900 plunky 326: TOOL_CPP.pcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-pcpp
1.824 plunky 327: TOOL_CXX.pcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-p++
1.519 gmcgarry 328:
1.662 joerg 329: #
330: # Make sure DESTDIR is set, so that builds with these tools always
331: # get appropriate -nostdinc, -nostdlib, etc. handling. The default is
332: # <empty string>, meaning start from /, the root directory.
333: #
334: DESTDIR?=
335:
1.1029 christos 336: # Don't append another copy of sysroot (coming from COMPATCPPFLAGS etc.
337: # because it confuses Coverity. Still we need to cov-configure specially
338: # for each specific sysroot argument.
1.662 joerg 339: .if !defined(HOSTPROG) && !defined(HOSTLIB)
340: . if ${DESTDIR} != ""
1.1029 christos 341: . if empty(CPPFLAGS:M*--sysroot=*)
1.659 mrg 342: CPPFLAGS+= --sysroot=${DESTDIR}
1.1027 christos 343: . endif
1.657 christos 344: LDFLAGS+= --sysroot=${DESTDIR}
1.662 joerg 345: . else
1.1029 christos 346: . if empty(CPPFLAGS:M*--sysroot=*)
1.661 christos 347: CPPFLAGS+= --sysroot=/
1.1027 christos 348: . endif
1.661 christos 349: LDFLAGS+= --sysroot=/
1.662 joerg 350: . endif
1.657 christos 351: .endif
1.341 lukem 352: .endif # EXTERNAL_TOOLCHAIN # }
1.234 thorpej 353:
1.210 thorpej 354: DBSYM= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-dbsym
1.675 tsutsui 355: ELF2AOUT= ${TOOLDIR}/bin/${_TOOL_PREFIX}m68k-elf2aout
1.320 thorpej 356: ELF2ECOFF= ${TOOLDIR}/bin/${_TOOL_PREFIX}mips-elf2ecoff
1.496 joerg 357: INSTALL= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-install
1.320 thorpej 358: LEX= ${TOOLDIR}/bin/${_TOOL_PREFIX}lex
1.215 tv 359: LINT= CC=${CC:Q} ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-lint
1.338 lukem 360: LORDER= NM=${NM:Q} MKTEMP=${TOOL_MKTEMP:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}lorder
1.320 thorpej 361: MKDEP= CC=${CC:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}mkdep
1.754 mrg 362: MKDEPCXX= CC=${CXX:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}mkdep
1.483 christos 363: PAXCTL= ${TOOLDIR}/bin/${_TOOL_PREFIX}paxctl
1.320 thorpej 364: TSORT= ${TOOLDIR}/bin/${_TOOL_PREFIX}tsort -q
365: YACC= ${TOOLDIR}/bin/${_TOOL_PREFIX}yacc
1.338 lukem 366:
1.426 jmc 367: TOOL_AMIGAAOUT2BB= ${TOOLDIR}/bin/${_TOOL_PREFIX}amiga-aout2bb
368: TOOL_AMIGAELF2BB= ${TOOLDIR}/bin/${_TOOL_PREFIX}amiga-elf2bb
369: TOOL_AMIGATXLT= ${TOOLDIR}/bin/${_TOOL_PREFIX}amiga-txlt
1.338 lukem 370: TOOL_ASN1_COMPILE= ${TOOLDIR}/bin/${_TOOL_PREFIX}asn1_compile
1.535 apb 371: TOOL_AWK= ${TOOLDIR}/bin/${_TOOL_PREFIX}awk
1.338 lukem 372: TOOL_CAP_MKDB= ${TOOLDIR}/bin/${_TOOL_PREFIX}cap_mkdb
373: TOOL_CAT= ${TOOLDIR}/bin/${_TOOL_PREFIX}cat
374: TOOL_CKSUM= ${TOOLDIR}/bin/${_TOOL_PREFIX}cksum
1.684 joerg 375: TOOL_CLANG_TBLGEN= ${TOOLDIR}/bin/${_TOOL_PREFIX}clang-tblgen
1.338 lukem 376: TOOL_COMPILE_ET= ${TOOLDIR}/bin/${_TOOL_PREFIX}compile_et
377: TOOL_CONFIG= ${TOOLDIR}/bin/${_TOOL_PREFIX}config
378: TOOL_CRUNCHGEN= MAKE=${.MAKE:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}crunchgen
379: TOOL_CTAGS= ${TOOLDIR}/bin/${_TOOL_PREFIX}ctags
1.620 darran 380: TOOL_CTFCONVERT= ${TOOLDIR}/bin/${_TOOL_PREFIX}ctfconvert
381: TOOL_CTFMERGE= ${TOOLDIR}/bin/${_TOOL_PREFIX}ctfmerge
1.885 christos 382: TOOL_CVSLATEST= ${TOOLDIR}/bin/${_TOOL_PREFIX}cvslatest
1.338 lukem 383: TOOL_DB= ${TOOLDIR}/bin/${_TOOL_PREFIX}db
1.730 matt 384: TOOL_DISKLABEL= ${TOOLDIR}/bin/nbdisklabel
1.1010 christos 385: TOOL_DTC= ${TOOLDIR}/bin/${_TOOL_PREFIX}dtc
1.338 lukem 386: TOOL_EQN= ${TOOLDIR}/bin/${_TOOL_PREFIX}eqn
1.532 apb 387: TOOL_FDISK= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-fdisk
1.338 lukem 388: TOOL_FGEN= ${TOOLDIR}/bin/${_TOOL_PREFIX}fgen
1.439 thorpej 389: TOOL_GENASSYM= ${TOOLDIR}/bin/${_TOOL_PREFIX}genassym
1.338 lukem 390: TOOL_GENCAT= ${TOOLDIR}/bin/${_TOOL_PREFIX}gencat
1.446 jmc 391: TOOL_GMAKE= ${TOOLDIR}/bin/${_TOOL_PREFIX}gmake
1.947 nonaka 392: TOOL_GPT= ${TOOLDIR}/bin/${_TOOL_PREFIX}gpt
1.881 joerg 393: # grep exists in src/tools, but is not hooked up into the build.
394: #TOOL_GREP= ${TOOLDIR}/bin/${_TOOL_PREFIX}grep
395: TOOL_GREP= grep
1.338 lukem 396: TOOL_GROFF= PATH=${TOOLDIR}/lib/groff:$${PATH} ${TOOLDIR}/bin/${_TOOL_PREFIX}groff
397: TOOL_HEXDUMP= ${TOOLDIR}/bin/${_TOOL_PREFIX}hexdump
1.427 jmc 398: TOOL_HP300MKBOOT= ${TOOLDIR}/bin/${_TOOL_PREFIX}hp300-mkboot
1.767 skrll 399: TOOL_HPPAMKBOOT= ${TOOLDIR}/bin/${_TOOL_PREFIX}hppa-mkboot
1.338 lukem 400: TOOL_INDXBIB= ${TOOLDIR}/bin/${_TOOL_PREFIX}indxbib
401: TOOL_INSTALLBOOT= ${TOOLDIR}/bin/${_TOOL_PREFIX}installboot
402: TOOL_INSTALL_INFO= ${TOOLDIR}/bin/${_TOOL_PREFIX}install-info
1.492 apb 403: TOOL_JOIN= ${TOOLDIR}/bin/${_TOOL_PREFIX}join
1.684 joerg 404: TOOL_LLVM_TBLGEN= ${TOOLDIR}/bin/${_TOOL_PREFIX}llvm-tblgen
1.338 lukem 405: TOOL_M4= ${TOOLDIR}/bin/${_TOOL_PREFIX}m4
1.405 matt 406: TOOL_MACPPCFIXCOFF= ${TOOLDIR}/bin/${_TOOL_PREFIX}macppc-fixcoff
1.338 lukem 407: TOOL_MAKEFS= ${TOOLDIR}/bin/${_TOOL_PREFIX}makefs
408: TOOL_MAKEINFO= ${TOOLDIR}/bin/${_TOOL_PREFIX}makeinfo
1.858 matt 409: TOOL_MAKEKEYS= ${TOOLDIR}/bin/${_TOOL_PREFIX}makekeys
410: TOOL_MAKESTRS= ${TOOLDIR}/bin/${_TOOL_PREFIX}makestrs
1.338 lukem 411: TOOL_MAKEWHATIS= ${TOOLDIR}/bin/${_TOOL_PREFIX}makewhatis
1.588 joerg 412: TOOL_MANDOC_ASCII= ${TOOLDIR}/bin/${_TOOL_PREFIX}mandoc -Tascii
1.653 njoly 413: TOOL_MANDOC_HTML= ${TOOLDIR}/bin/${_TOOL_PREFIX}mandoc -Thtml
1.588 joerg 414: TOOL_MANDOC_LINT= ${TOOLDIR}/bin/${_TOOL_PREFIX}mandoc -Tlint
1.338 lukem 415: TOOL_MDSETIMAGE= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-mdsetimage
416: TOOL_MENUC= MENUDEF=${TOOLDIR}/share/misc ${TOOLDIR}/bin/${_TOOL_PREFIX}menuc
1.675 tsutsui 417: TOOL_M68KELF2AOUT= ${TOOLDIR}/bin/${_TOOL_PREFIX}m68k-elf2aout
1.425 jmc 418: TOOL_MIPSELF2ECOFF= ${TOOLDIR}/bin/${_TOOL_PREFIX}mips-elf2ecoff
1.338 lukem 419: TOOL_MKCSMAPPER= ${TOOLDIR}/bin/${_TOOL_PREFIX}mkcsmapper
420: TOOL_MKESDB= ${TOOLDIR}/bin/${_TOOL_PREFIX}mkesdb
421: TOOL_MKLOCALE= ${TOOLDIR}/bin/${_TOOL_PREFIX}mklocale
422: TOOL_MKMAGIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}file
1.723 jmcneill 423: TOOL_MKNOD= ${TOOLDIR}/bin/${_TOOL_PREFIX}mknod
1.338 lukem 424: TOOL_MKTEMP= ${TOOLDIR}/bin/${_TOOL_PREFIX}mktemp
1.650 matt 425: TOOL_MKUBOOTIMAGE= ${TOOLDIR}/bin/${_TOOL_PREFIX}mkubootimage
1.712 jkunz 426: TOOL_ELFTOSB= ${TOOLDIR}/bin/${_TOOL_PREFIX}elftosb
1.338 lukem 427: TOOL_MSGC= MSGDEF=${TOOLDIR}/share/misc ${TOOLDIR}/bin/${_TOOL_PREFIX}msgc
428: TOOL_MTREE= ${TOOLDIR}/bin/${_TOOL_PREFIX}mtree
1.690 joerg 429: TOOL_NBPERF= ${TOOLDIR}/bin/${_TOOL_PREFIX}perf
1.803 phx 430: TOOL_NCDCS= ${TOOLDIR}/bin/${_TOOL_PREFIX}ibmnws-ncdcs
1.338 lukem 431: TOOL_PAX= ${TOOLDIR}/bin/${_TOOL_PREFIX}pax
432: TOOL_PIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}pic
1.632 mrg 433: TOOL_PIGZ= ${TOOLDIR}/bin/${_TOOL_PREFIX}pigz
1.599 uebayasi 434: TOOL_PKG_CREATE= ${TOOLDIR}/bin/${_TOOL_PREFIX}pkg_create
1.506 garbled 435: TOOL_POWERPCMKBOOTIMAGE=${TOOLDIR}/bin/${_TOOL_PREFIX}powerpc-mkbootimage
1.338 lukem 436: TOOL_PWD_MKDB= ${TOOLDIR}/bin/${_TOOL_PREFIX}pwd_mkdb
437: TOOL_REFER= ${TOOLDIR}/bin/${_TOOL_PREFIX}refer
438: TOOL_ROFF_ASCII= PATH=${TOOLDIR}/lib/groff:$${PATH} ${TOOLDIR}/bin/${_TOOL_PREFIX}nroff
1.818 dholland 439: TOOL_ROFF_DOCASCII= ${TOOL_GROFF} -Tascii
440: TOOL_ROFF_DOCHTML= ${TOOL_GROFF} -Thtml
1.338 lukem 441: TOOL_ROFF_DVI= ${TOOL_GROFF} -Tdvi
1.340 lukem 442: TOOL_ROFF_HTML= ${TOOL_GROFF} -Tlatin1 -mdoc2html
1.338 lukem 443: TOOL_ROFF_PS= ${TOOL_GROFF} -Tps
444: TOOL_ROFF_RAW= ${TOOL_GROFF} -Z
1.501 nakayama 445: TOOL_RPCGEN= RPCGEN_CPP=${CPP:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}rpcgen
1.454 gdamore 446: TOOL_SED= ${TOOLDIR}/bin/${_TOOL_PREFIX}sed
1.656 elric 447: TOOL_SLC= ${TOOLDIR}/bin/${_TOOL_PREFIX}slc
1.338 lukem 448: TOOL_SOELIM= ${TOOLDIR}/bin/${_TOOL_PREFIX}soelim
1.882 christos 449: TOOL_SORTINFO= ${TOOLDIR}/bin/${_TOOL_PREFIX}sortinfo
1.532 apb 450: TOOL_SPARKCRC= ${TOOLDIR}/bin/${_TOOL_PREFIX}sparkcrc
1.342 lukem 451: TOOL_STAT= ${TOOLDIR}/bin/${_TOOL_PREFIX}stat
1.530 apb 452: TOOL_STRFILE= ${TOOLDIR}/bin/${_TOOL_PREFIX}strfile
1.338 lukem 453: TOOL_SUNLABEL= ${TOOLDIR}/bin/${_TOOL_PREFIX}sunlabel
454: TOOL_TBL= ${TOOLDIR}/bin/${_TOOL_PREFIX}tbl
1.616 roy 455: TOOL_TIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}tic
1.338 lukem 456: TOOL_UUDECODE= ${TOOLDIR}/bin/${_TOOL_PREFIX}uudecode
457: TOOL_VGRIND= ${TOOLDIR}/bin/${_TOOL_PREFIX}vgrind -f
1.823 christos 458: TOOL_VFONTEDPR= ${TOOLDIR}/libexec/${_TOOL_PREFIX}vfontedpr
1.338 lukem 459: TOOL_ZIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}zic
1.180 tv 460:
1.538 apb 461: .else # USETOOLS != yes # } {
462:
1.667 joerg 463: # Clang supports C, C++ and Objective C
464: TOOL_CC.clang= clang
465: TOOL_CPP.clang= clang-cpp
466: TOOL_CXX.clang= clang++
467: TOOL_OBJC.clang= clang
468:
469: # GCC supports C, C++, Fortran and Objective C
470: TOOL_CC.gcc= gcc
471: TOOL_CPP.gcc= cpp
472: TOOL_CXX.gcc= c++
473: TOOL_FC.gcc= g77
474: TOOL_OBJC.gcc= gcc
475:
476: # PCC supports C and Fortran
477: TOOL_CC.pcc= pcc
1.900 plunky 478: TOOL_CPP.pcc= pcpp
1.824 plunky 479: TOOL_CXX.pcc= p++
1.667 joerg 480:
1.538 apb 481: TOOL_AMIGAAOUT2BB= amiga-aout2bb
482: TOOL_AMIGAELF2BB= amiga-elf2bb
483: TOOL_AMIGATXLT= amiga-txlt
484: TOOL_ASN1_COMPILE= asn1_compile
485: TOOL_AWK= awk
486: TOOL_CAP_MKDB= cap_mkdb
487: TOOL_CAT= cat
488: TOOL_CKSUM= cksum
1.684 joerg 489: TOOL_CLANG_TBLGEN= clang-tblgen
1.538 apb 490: TOOL_COMPILE_ET= compile_et
491: TOOL_CONFIG= config
492: TOOL_CRUNCHGEN= crunchgen
493: TOOL_CTAGS= ctags
1.620 darran 494: TOOL_CTFCONVERT= ctfconvert
495: TOOL_CTFMERGE= ctfmerge
1.885 christos 496: TOOL_CVSLATEST= cvslatest
1.538 apb 497: TOOL_DB= db
498: TOOL_DISKLABEL= disklabel
499: TOOL_EQN= eqn
500: TOOL_FDISK= fdisk
501: TOOL_FGEN= fgen
502: TOOL_GENASSYM= genassym
503: TOOL_GENCAT= gencat
504: TOOL_GMAKE= gmake
1.947 nonaka 505: TOOL_GPT= gpt
1.557 sketch 506: TOOL_GREP= grep
1.538 apb 507: TOOL_GROFF= groff
508: TOOL_HEXDUMP= hexdump
509: TOOL_HP300MKBOOT= hp300-mkboot
1.767 skrll 510: TOOL_HPPAMKBOOT= hppa-mkboot
1.538 apb 511: TOOL_INDXBIB= indxbib
512: TOOL_INSTALLBOOT= installboot
513: TOOL_INSTALL_INFO= install-info
514: TOOL_JOIN= join
1.684 joerg 515: TOOL_LLVM_TBLGEN= llvm-tblgen
1.538 apb 516: TOOL_M4= m4
517: TOOL_MACPPCFIXCOFF= macppc-fixcoff
518: TOOL_MAKEFS= makefs
519: TOOL_MAKEINFO= makeinfo
1.858 matt 520: TOOL_MAKEKEYS= makekeys
521: TOOL_MAKESTRS= makestrs
1.538 apb 522: TOOL_MAKEWHATIS= /usr/libexec/makewhatis
1.629 joerg 523: TOOL_MANDOC_ASCII= mandoc -Tascii
1.716 joerg 524: TOOL_MANDOC_HTML= mandoc -Thtml
1.629 joerg 525: TOOL_MANDOC_LINT= mandoc -Tlint
1.538 apb 526: TOOL_MDSETIMAGE= mdsetimage
527: TOOL_MENUC= menuc
1.675 tsutsui 528: TOOL_M68KELF2AOUT= m68k-elf2aout
1.538 apb 529: TOOL_MIPSELF2ECOFF= mips-elf2ecoff
530: TOOL_MKCSMAPPER= mkcsmapper
531: TOOL_MKESDB= mkesdb
532: TOOL_MKLOCALE= mklocale
533: TOOL_MKMAGIC= file
1.723 jmcneill 534: TOOL_MKNOD= mknod
1.538 apb 535: TOOL_MKTEMP= mktemp
1.650 matt 536: TOOL_MKUBOOTIMAGE= mkubootimage
1.712 jkunz 537: TOOL_ELFTOSB= elftosb
1.538 apb 538: TOOL_MSGC= msgc
539: TOOL_MTREE= mtree
1.616 roy 540: TOOL_NBPERF= nbperf
1.803 phx 541: TOOL_NCDCS= ncdcs
1.538 apb 542: TOOL_PAX= pax
543: TOOL_PIC= pic
1.632 mrg 544: TOOL_PIGZ= pigz
1.599 uebayasi 545: TOOL_PKG_CREATE= pkg_create
1.538 apb 546: TOOL_POWERPCMKBOOTIMAGE= powerpc-mkbootimage
547: TOOL_PWD_MKDB= pwd_mkdb
548: TOOL_REFER= refer
549: TOOL_ROFF_ASCII= nroff
1.818 dholland 550: TOOL_ROFF_DOCASCII= ${TOOL_GROFF} -Tascii
551: TOOL_ROFF_DOCHTML= ${TOOL_GROFF} -Thtml
1.538 apb 552: TOOL_ROFF_DVI= ${TOOL_GROFF} -Tdvi
553: TOOL_ROFF_HTML= ${TOOL_GROFF} -Tlatin1 -mdoc2html
554: TOOL_ROFF_PS= ${TOOL_GROFF} -Tps
555: TOOL_ROFF_RAW= ${TOOL_GROFF} -Z
556: TOOL_RPCGEN= rpcgen
557: TOOL_SED= sed
558: TOOL_SOELIM= soelim
1.883 wiz 559: TOOL_SORTINFO= sortinfo
1.538 apb 560: TOOL_SPARKCRC= sparkcrc
561: TOOL_STAT= stat
562: TOOL_STRFILE= strfile
563: TOOL_SUNLABEL= sunlabel
564: TOOL_TBL= tbl
1.616 roy 565: TOOL_TIC= tic
1.538 apb 566: TOOL_UUDECODE= uudecode
567: TOOL_VGRIND= vgrind -f
1.822 christos 568: TOOL_VFONTEDPR= /usr/libexec/vfontedpr
1.538 apb 569: TOOL_ZIC= zic
570:
571: .endif # USETOOLS != yes # }
1.272 lukem 572:
1.890 christos 573: # Standalone code should not be compiled with PIE or CTF
574: # Should create a better test
575: .if defined(BINDIR) && ${BINDIR} == "/usr/mdec"
576: NOPIE= # defined
577: NOCTF= # defined
1.946 christos 578: .elif ${MACHINE} == "sun2"
579: NOPIE= # we don't have PIC, so no PIE
1.890 christos 580: .endif
581:
1.667 joerg 582: # Fallback to ensure that all variables are defined to something
583: TOOL_CC.false= false
584: TOOL_CPP.false= false
585: TOOL_CXX.false= false
586: TOOL_FC.false= false
587: TOOL_OBJC.false= false
588:
1.817 mrg 589: AVAILABLE_COMPILER?= ${HAVE_PCC:Dpcc} ${HAVE_LLVM:Dclang} ${HAVE_GCC:Dgcc} ${EXTERNAL_TOOLCHAIN:Dgcc} false
1.667 joerg 590:
591: .for _t in CC CPP CXX FC OBJC
592: ACTIVE_${_t}= ${AVAILABLE_COMPILER:@.c.@ ${ !defined(UNSUPPORTED_COMPILER.${.c.}) && defined(TOOL_${_t}.${.c.}) :? ${.c.} : }@:[1]}
593: SUPPORTED_${_t}=${AVAILABLE_COMPILER:Nfalse:@.c.@ ${ !defined(UNSUPPORTED_COMPILER.${.c.}) && defined(TOOL_${_t}.${.c.}) :? ${.c.} : }@}
594: .endfor
595: # make bugs prevent moving this into the .for loop
596: CC= ${TOOL_CC.${ACTIVE_CC}}
597: CPP= ${TOOL_CPP.${ACTIVE_CPP}}
598: CXX= ${TOOL_CXX.${ACTIVE_CXX}}
599: FC= ${TOOL_FC.${ACTIVE_FC}}
600: OBJC= ${TOOL_OBJC.${ACTIVE_OBJC}}
601:
1.756 matt 602: # For each ${MACHINE_CPU}, list the ports that use it.
1.827 matt 603: MACHINES.aarch64= evbarm64
1.756 matt 604: MACHINES.alpha= alpha
1.1028 skrll 605: MACHINES.arm= acorn32 cats epoc32 evbarm hpcarm \
1.756 matt 606: iyonix netwinder shark zaurus
607: MACHINES.coldfire= evbcf
608: MACHINES.i386= i386
609: MACHINES.ia64= ia64
1.767 skrll 610: MACHINES.hppa= hppa
1.756 matt 611: MACHINES.m68000= sun2
612: MACHINES.m68k= amiga atari cesfic hp300 luna68k mac68k \
613: news68k next68k sun3 x68k
614: MACHINES.mips= arc cobalt algor cobalt emips evbmips ews4800mips \
615: hpcmips mipsco newsmips pmax sbmips sgimips
1.835 matt 616: MACHINES.or1k= or1k
1.756 matt 617: MACHINES.powerpc= amigappc bebox evbppc ibmnws macppc mvmeppc \
618: ofppc prep rs6000 sandpoint
1.835 matt 619: MACHINES.riscv= riscv
1.756 matt 620: MACHINES.sh3= dreamcast evbsh3 hpcsh landisk mmeye
1.757 matt 621: MACHINES.sparc= sparc sparc64
1.756 matt 622: MACHINES.sparc64= sparc64
623: MACHINES.vax= vax
624: MACHINES.x86_64= amd64
625:
1.775 matt 626: # for crunchide & ldd, define the OBJECT_FMTS used by a MACHINE_ARCH
627: #
628: OBJECT_FMTS=
1.939 scole 629: .if ${MACHINE_ARCH} != "alpha" && ${MACHINE_ARCH} != "ia64"
1.775 matt 630: OBJECT_FMTS+= elf32
631: .endif
632: .if ${MACHINE_ARCH} == "alpha" || ${MACHINE_ARCH:M*64*} != ""
633: OBJECT_FMTS+= elf64
634: .endif
635:
1.674 tsutsui 636: # OBJCOPY flags to create a.out binaries for old firmware
637: # shared among src/distrib and ${MACHINE}/conf/Makefile.${MACHINE}.inc
638: .if ${MACHINE_CPU} == "arm"
639: OBJCOPY_ELF2AOUT_FLAGS?= \
640: -O a.out-arm-netbsd \
641: -R .ident \
642: -R .ARM.attributes \
1.704 matt 643: -R .ARM.exidx \
1.748 martin 644: -R .ARM.extab \
1.899 skrll 645: -R .SUNW_ctf \
1.674 tsutsui 646: -R .arm.atpcs \
647: -R .comment \
648: -R .debug_abbrev \
1.735 matt 649: -R .debug_aranges \
1.674 tsutsui 650: -R .debug_info \
651: -R .debug_line \
652: -R .debug_frame \
653: -R .debug_loc \
654: -R .debug_pubnames \
1.735 matt 655: -R .debug_pubtypes \
1.837 skrll 656: -R .debug_ranges \
1.674 tsutsui 657: -R .debug_str \
1.1016 joerg 658: -R .debug_macinfo \
1.745 joerg 659: -R .eh_frame \
1.674 tsutsui 660: -R .note.netbsd.ident
661: .endif
662:
1.341 lukem 663: #
1.272 lukem 664: # Targets to check if DESTDIR or RELEASEDIR is provided
665: #
666: .if !target(check_DESTDIR)
667: check_DESTDIR: .PHONY .NOTMAIN
668: .if !defined(DESTDIR)
669: @echo "setenv DESTDIR before doing that!"
670: @false
671: .else
672: @true
673: .endif
674: .endif
675:
676: .if !target(check_RELEASEDIR)
677: check_RELEASEDIR: .PHONY .NOTMAIN
678: .if !defined(RELEASEDIR)
679: @echo "setenv RELEASEDIR before doing that!"
680: @false
681: .else
682: @true
683: .endif
684: .endif
685:
1.341 lukem 686: #
1.287 lukem 687: # Where the system object and source trees are kept; can be configurable
688: # by the user in case they want them in ~/foosrc and ~/fooobj (for example).
689: #
690: BSDSRCDIR?= /usr/src
691: BSDOBJDIR?= /usr/obj
1.288 lukem 692: NETBSDSRCDIR?= ${BSDSRCDIR}
1.1 cgd 693:
1.61 lukem 694: BINGRP?= wheel
695: BINOWN?= root
1.1 cgd 696: BINMODE?= 555
1.4 mycroft 697: NONBINMODE?= 444
1.17 brezak 698:
1.646 pooka 699: # These are here mainly because we don't want suid root in case
700: # a Makefile defines BINMODE.
701: RUMPBINGRP?= wheel
702: RUMPBINOWN?= root
703: RUMPBINMODE?= 555
704: RUMPNONBINMODE?=444
705:
1.31 christos 706: MANDIR?= /usr/share/man
1.61 lukem 707: MANGRP?= wheel
708: MANOWN?= root
1.4 mycroft 709: MANMODE?= ${NONBINMODE}
1.697 joerg 710: MANINSTALL?= ${_MANINSTALL}
1.115 tv 711:
712: INFODIR?= /usr/share/info
713: INFOGRP?= wheel
714: INFOOWN?= root
715: INFOMODE?= ${NONBINMODE}
1.4 mycroft 716:
717: LIBDIR?= /usr/lib
1.315 thorpej 718:
1.4 mycroft 719: LINTLIBDIR?= /usr/libdata/lint
720: LIBGRP?= ${BINGRP}
721: LIBOWN?= ${BINOWN}
722: LIBMODE?= ${NONBINMODE}
723:
1.135 simonb 724: DOCDIR?= /usr/share/doc
1.61 lukem 725: DOCGRP?= wheel
726: DOCOWN?= root
1.135 simonb 727: DOCMODE?= ${NONBINMODE}
1.15 jtc 728:
729: NLSDIR?= /usr/share/nls
1.61 lukem 730: NLSGRP?= wheel
731: NLSOWN?= root
1.15 jtc 732: NLSMODE?= ${NONBINMODE}
1.25 explorer 733:
1.508 ad 734: KMODULEGRP?= wheel
735: KMODULEOWN?= root
736: KMODULEMODE?= ${NONBINMODE}
737:
1.155 itojun 738: LOCALEDIR?= /usr/share/locale
739: LOCALEGRP?= wheel
740: LOCALEOWN?= root
741: LOCALEMODE?= ${NONBINMODE}
1.1 cgd 742:
1.453 rpaulo 743: FIRMWAREDIR?= /libdata/firmware
744: FIRMWAREGRP?= wheel
745: FIRMWAREOWN?= root
746: FIRMWAREMODE?= ${NONBINMODE}
747:
1.465 lukem 748: DEBUGDIR?= /usr/libdata/debug
749: DEBUGGRP?= wheel
750: DEBUGOWN?= root
751: DEBUGMODE?= ${NONBINMODE}
752:
1.1004 christos 753: MKDIRMODE?= 0755
1.1005 christos 754: MKDIRPERM?= -m ${MKDIRMODE}
1.1004 christos 755:
1.341 lukem 756: #
757: # Data-driven table using make variables to control how
1.264 thorpej 758: # toolchain-dependent targets and shared libraries are built
759: # for different platforms and object formats.
760: #
1.296 thorpej 761: # OBJECT_FMT: currently either "ELF" or "a.out".
1.264 thorpej 762: #
1.499 simonb 763: # All platforms are ELF.
1.341 lukem 764: #
1.264 thorpej 765: OBJECT_FMT= ELF
766:
1.341 lukem 767: #
1.310 thorpej 768: # If this platform's toolchain is missing, we obviously cannot build it.
1.341 lukem 769: #
1.406 lukem 770: .if ${TOOLCHAIN_MISSING} != "no"
1.572 skrll 771: MKBINUTILS:= no
1.310 thorpej 772: MKGDB:= no
773: MKGCC:= no
774: .endif
775:
1.341 lukem 776: #
1.310 thorpej 777: # If we are using an external toolchain, we can still build the target's
1.572 skrll 778: # binutils, but we cannot build GCC's support libraries, since those are
1.310 thorpej 779: # tightly-coupled to the version of GCC being used.
1.341 lukem 780: #
1.310 thorpej 781: .if defined(EXTERNAL_TOOLCHAIN)
782: MKGCC:= no
783: .endif
784:
1.830 matt 785: # No GDB support for aarch64
786: MKGDB.aarch64= no
1.977 mrg 787: MKGDB.aarch64eb=no
1.834 matt 788: MKGDB.or1k= no
1.835 matt 789: MKGDB.riscv32= no
790: MKGDB.riscv64= no
1.834 matt 791:
792: # No kernel modules for or1k (yet)
793: MKKMOD.or1k= no
1.835 matt 794: MKKMOD.riscv32= no
795: MKKMOD.riscv64= no
1.834 matt 796:
797: # No profiling for or1k (yet)
798: MKPROFILE.or1k= no
1.835 matt 799: MKPROFILE.riscv32=no
800: MKPROFILE.riscv64=no
1.830 matt 801:
1.341 lukem 802: #
1.165 fredette 803: # The m68000 port is incomplete.
1.341 lukem 804: #
1.165 fredette 805: .if ${MACHINE_ARCH} == "m68000"
1.230 tv 806: NOPIC= # defined
1.458 mrg 807: MKISCSI= no
808: # XXX GCC 4 outputs mcount() calling sequences that try to load values
809: # from over 64KB away and this fails to assemble.
1.671 mrg 810: .if defined(HAVE_GCC)
1.458 mrg 811: NOPROFILE= # defined
812: .endif
1.32 thorpej 813: .endif
1.122 simonb 814:
1.341 lukem 815: #
1.441 skrll 816: # The ia64 port is incomplete.
817: #
1.830 matt 818: MKLINT.ia64= no
819: MKGDB.ia64= no
1.441 skrll 820:
821: #
1.327 thorpej 822: # On VAX using ELF, all objects are PIC, not just shared libraries,
1.1011 joerg 823: # so don't build the _pic version. VAX has no native TLS support either,
824: # so differences between TLS models are not relevant.
1.341 lukem 825: #
1.830 matt 826: MKPICLIB.vax= no
1.327 thorpej 827:
1.341 lukem 828: #
1.122 simonb 829: # Location of the file that contains the major and minor numbers of the
830: # version of a shared library. If this file exists a shared library
831: # will be built by <bsd.lib.mk>.
1.341 lukem 832: #
1.122 simonb 833: SHLIB_VERSION_FILE?= ${.CURDIR}/shlib_version
1.69 tv 834:
1.341 lukem 835: #
1.69 tv 836: # GNU sources and packages sometimes see architecture names differently.
1.341 lukem 837: #
1.827 matt 838: GNU_ARCH.aarch64eb=aarch64_be
1.739 matt 839: GNU_ARCH.coldfire=m5407
1.702 matt 840: GNU_ARCH.earm=arm
1.741 matt 841: GNU_ARCH.earmhf=arm
1.702 matt 842: GNU_ARCH.earmeb=armeb
1.722 matt 843: GNU_ARCH.earmhfeb=armeb
1.741 matt 844: GNU_ARCH.earmv4=armv4
1.742 matt 845: GNU_ARCH.earmv4eb=armv4eb
846: GNU_ARCH.earmv5=arm
847: GNU_ARCH.earmv5eb=armeb
848: GNU_ARCH.earmv6=armv6
849: GNU_ARCH.earmv6hf=armv6
850: GNU_ARCH.earmv6eb=armv6eb
851: GNU_ARCH.earmv6hfeb=armv6eb
852: GNU_ARCH.earmv7=armv7
853: GNU_ARCH.earmv7hf=armv7
1.741 matt 854: GNU_ARCH.earmv7eb=armv7eb
855: GNU_ARCH.earmv7hfeb=armv7eb
1.560 drochner 856: GNU_ARCH.i386=i486
857: GCC_CONFIG_ARCH.i386=i486
1.563 ad 858: GCC_CONFIG_TUNE.i386=nocona
859: GCC_CONFIG_TUNE.x86_64=nocona
1.261 thorpej 860: GNU_ARCH.m68000=m68010
1.150 itojun 861: GNU_ARCH.sh3eb=sh
1.236 thorpej 862: GNU_ARCH.sh3el=shle
1.468 matt 863: GNU_ARCH.mips64eb=mips64
1.172 tv 864: MACHINE_GNU_ARCH=${GNU_ARCH.${MACHINE_ARCH}:U${MACHINE_ARCH}}
1.161 tv 865:
1.341 lukem 866: #
1.161 tv 867: # In order to identify NetBSD to GNU packages, we sometimes need
868: # an "elf" tag for historically a.out platforms.
1.341 lukem 869: #
1.729 matt 870: .if (!empty(MACHINE_ARCH:Mearm*))
1.742 matt 871: MACHINE_GNU_PLATFORM?=${MACHINE_GNU_ARCH}--netbsdelf-${MACHINE_ARCH:C/eb//:C/v[4-7]//:S/earm/eabi/}
1.702 matt 872: .elif (${MACHINE_GNU_ARCH} == "arm" || \
1.294 thorpej 873: ${MACHINE_GNU_ARCH} == "armeb" || \
1.168 matt 874: ${MACHINE_ARCH} == "i386" || \
1.494 matt 875: ${MACHINE_CPU} == "m68k" || \
1.235 thorpej 876: ${MACHINE_GNU_ARCH} == "sh" || \
1.236 thorpej 877: ${MACHINE_GNU_ARCH} == "shle" || \
1.168 matt 878: ${MACHINE_ARCH} == "sparc" || \
879: ${MACHINE_ARCH} == "vax")
1.318 thorpej 880: MACHINE_GNU_PLATFORM?=${MACHINE_GNU_ARCH}--netbsdelf
1.161 tv 881: .else
1.318 thorpej 882: MACHINE_GNU_PLATFORM?=${MACHINE_GNU_ARCH}--netbsd
1.161 tv 883: .endif
1.153 itojun 884:
1.759 skrll 885: .if !empty(MACHINE_ARCH:M*arm*)
1.758 joerg 886: # Flags to pass to CC for using the old APCS ABI on ARM for compat or stand.
887: ARM_APCS_FLAGS= -mabi=apcs-gnu -mfloat-abi=soft
1.850 matt 888: ARM_APCS_FLAGS+=${${ACTIVE_CC} == "gcc":? -marm :}
1.758 joerg 889: ARM_APCS_FLAGS+=${${ACTIVE_CC} == "clang":? -target ${MACHINE_GNU_ARCH}--netbsdelf -B ${TOOLDIR}/${MACHINE_GNU_PLATFORM}/bin :}
890: .endif
891:
1.776 joerg 892: GENASSYM_CPPFLAGS+= ${${ACTIVE_CC} == "clang":? -no-integrated-as :}
893:
1.160 tv 894: TARGETS+= all clean cleandir depend dependall includes \
1.880 pooka 895: install lint obj regress tags html analyze describe \
896: rumpdescribe
1.485 dsl 897: PHONY_NOTMAIN = all clean cleandir depend dependall distclean includes \
1.669 drochner 898: install lint obj regress beforedepend afterdepend \
1.142 phil 899: beforeinstall afterinstall realinstall realdepend realall \
1.880 pooka 900: html subdir-all subdir-install subdir-depend analyze describe \
901: rumpdescribe
1.485 dsl 902: .PHONY: ${PHONY_NOTMAIN}
903: .NOTMAIN: ${PHONY_NOTMAIN}
1.58 agc 904:
1.406 lukem 905: .if ${NEED_OWN_INSTALL_TARGET} != "no"
1.56 drochner 906: .if !target(install)
1.485 dsl 907: install: beforeinstall .WAIT subdir-install realinstall .WAIT afterinstall
908: beforeinstall:
909: subdir-install:
910: realinstall:
911: afterinstall:
912: .endif
913: all: realall subdir-all
914: subdir-all:
915: realall:
916: depend: realdepend subdir-depend
917: subdir-depend:
918: realdepend:
919: distclean: cleandir
920: cleandir: clean
1.205 tv 921:
922: dependall: .NOTMAIN realdepend .MAKE
1.615 christos 923: @cd "${.CURDIR}"; ${MAKE} realall
1.132 mycroft 924: .endif
1.116 lukem 925:
1.341 lukem 926: #
1.116 lukem 927: # Define MKxxx variables (which are either yes or no) for users
1.350 lukem 928: # to set in /etc/mk.conf and override in the make environment.
1.116 lukem 929: # These should be tested with `== "no"' or `!= "no"'.
1.340 lukem 930: # The NOxxx variables should only be set by Makefiles.
1.116 lukem 931: #
1.466 lukem 932: # Please keep etc/Makefile and share/man/man5/mk.conf.5 in sync
933: # with changes to the MK* variables here.
934: #
1.116 lukem 935:
1.341 lukem 936: #
1.230 tv 937: # Supported NO* options (if defined, MK* will be forced to "no",
938: # regardless of user's mk.conf setting).
1.341 lukem 939: #
1.503 dholland 940: # Source makefiles should set NO*, and not MK*, and must do so before
941: # including bsd.own.mk.
942: #
1.422 lukem 943: .for var in \
1.534 apb 944: NOCRYPTO NODOC NOHTML NOINFO NOLINKLIB NOLINT NOMAN NONLS NOOBJ NOPIC \
1.984 christos 945: NOPICINSTALL NOPROFILE NOSHARE NOSTATICLIB NODEBUGLIB
1.503 dholland 946: .if defined(${var})
947: MK${var:S/^NO//}:= no
1.230 tv 948: .endif
949: .endfor
1.268 ross 950:
1.341 lukem 951: #
952: # Older-style variables that enabled behaviour when set.
953: #
954: .for var in MANZ UNPRIVED UPDATE
955: .if defined(${var})
956: MK${var}:= yes
1.268 ross 957: .endif
1.341 lukem 958: .endfor
1.230 tv 959:
1.536 mrg 960: #
961: # MK* options which have variable defaults.
962: #
1.978 mrg 963: # aarch64eb is not yet supported.
964: #
1.779 matt 965: .if ${MACHINE_ARCH} == "x86_64" || ${MACHINE_ARCH} == "sparc64" \
966: || ${MACHINE_ARCH} == "mips64eb" || ${MACHINE_ARCH} == "mips64el" \
1.978 mrg 967: || ${MACHINE_ARCH} == "powerpc64" || ${MACHINE_ARCH} == "aarch64" \
1.929 mrg 968: || ${MACHINE_ARCH} == "riscv64" || !empty(MACHINE_ARCH:Mearm*)
1.852 martin 969: MKCOMPAT?= yes
1.536 mrg 970: .else
971: # Don't let this build where it really isn't supported.
972: MKCOMPAT:= no
1.934 mrg 973: .endif
974:
975: .if ${MKCOMPAT} == "no"
1.859 matt 976: MKCOMPATTESTS:= no
977: MKCOMPATX11:= no
1.536 mrg 978: .endif
979:
1.856 matt 980: .if ${MACHINE_ARCH} == "x86_64" || ${MACHINE_ARCH} == "i386" \
981: || ${MACHINE_ARCH} == "mips64eb" || ${MACHINE_ARCH} == "mips64el" \
982: || (${MACHINE} == "evbppc" && ${MACHINE_ARCH} == "powerpc")
1.670 mrg 983: MKCOMPATMODULES?= yes
984: .else
985: MKCOMPATMODULES:= no
986: .endif
987:
1.341 lukem 988: #
1.1007 chs 989: # These platforms use softfloat by default.
1.647 matt 990: #
1.1007 chs 991: .if ${MACHINE_ARCH} == "mips64eb" || ${MACHINE_ARCH} == "mips64el"
992: MKSOFTFLOAT?= yes
993: .endif
994:
995: #
996: # These platforms always use softfloat.
997: #
998: .if (${MACHINE_CPU} == "arm" && ${MACHINE_ARCH:M*hf*} == "") || \
1.834 matt 999: ${MACHINE_ARCH} == "coldfire" || ${MACHINE_CPU} == "or1k" || \
1.1007 chs 1000: ${MACHINE} == "emips" || ${MACHINE_CPU} == "sh3"
1001: MKSOFTFLOAT= yes
1.647 matt 1002: .endif
1003:
1.649 pooka 1004: .if ${MACHINE} == "emips"
1005: SOFTFLOAT_BITS= 32
1006: .endif
1007:
1.572 skrll 1008: #
1.846 pooka 1009: # We want to build zfs only for amd64 by default for now.
1.603 uebayasi 1010: #
1.846 pooka 1011: .if ${MACHINE} == "amd64"
1.621 he 1012: MKZFS?= yes
1.603 uebayasi 1013: .endif
1014:
1015: #
1.884 riz 1016: # DTrace works on amd64, i386 and earm*
1017: #
1018: .if ${MACHINE_ARCH} == "i386" || \
1019: ${MACHINE_ARCH} == "x86_64" || \
1020: !empty(MACHINE_ARCH:Mearm*)
1021: MKDTRACE?= yes
1022: MKCTF?= yes
1023: .endif
1.1007 chs 1024:
1.884 riz 1025: #
1.1007 chs 1026: # PIE is enabled on many platforms by default.
1.919 christos 1027: #
1.1027 christos 1028: # Coverity does not like PIE
1029: .if !defined(COVERITY_TOP_CONFIG) && \
1030: (${MACHINE_ARCH} == "i386" || \
1.925 christos 1031: ${MACHINE_ARCH} == "x86_64" || \
1.948 christos 1032: ${MACHINE_CPU} == "arm" || \
1.957 christos 1033: ${MACHINE_CPU} == "m68k" || \
1.966 christos 1034: ${MACHINE_CPU} == "mips" || \
1.948 christos 1035: ${MACHINE_CPU} == "sh3" || \
1.1027 christos 1036: ${MACHINE} == "sparc64")
1.919 christos 1037: MKPIE?= yes
1.920 martin 1038: .else
1039: MKPIE?= no
1040: .endif
1041:
1.919 christos 1042: #
1.936 christos 1043: # RELRO is enabled on i386 and amd64 by default
1044: #
1045: .if ${MACHINE_ARCH} == "i386" || \
1046: ${MACHINE_ARCH} == "x86_64"
1047: MKRELRO?= partial
1048: .else
1049: MKRELRO?= no
1050: .endif
1051:
1.1018 christos 1052: .if ${MACHINE_ARCH} == "x86_64"
1.1019 christos 1053: MKSTATICPIE?= no
1.1018 christos 1054: .else
1055: MKSTATICPIE?= no
1056: .endif
1057:
1.936 christos 1058: #
1.230 tv 1059: # MK* options which default to "yes".
1.341 lukem 1060: #
1.600 uebayasi 1061: _MKVARS.yes= \
1.514 gmcgarry 1062: MKATF \
1.572 skrll 1063: MKBINUTILS \
1.1009 riastrad 1064: MKCOMPLEX MKCVS MKCXX \
1.1010 christos 1065: MKDOC MKDTC \
1.1001 christos 1066: MKDYNAMICROOT \
1.764 matt 1067: MKGCC MKGDB MKGROFF \
1.524 lukem 1068: MKHESIOD MKHTML \
1.504 lukem 1069: MKIEEEFP MKINET6 MKINFO MKIPFILTER MKISCSI \
1070: MKKERBEROS \
1.570 dyoung 1071: MKKMOD \
1.749 matt 1072: MKLDAP MKLIBSTDCXX MKLINKLIB MKLVM \
1.695 joerg 1073: MKMAN MKMANDOC \
1.583 tsarna 1074: MKMDNS \
1.694 joerg 1075: MKMAKEMANDB \
1.525 christos 1076: MKNLS \
1.640 rmind 1077: MKNPF \
1.504 lukem 1078: MKOBJ \
1.664 haad 1079: MKPAM MKPERFUSE \
1.519 gmcgarry 1080: MKPF MKPIC MKPICINSTALL MKPICLIB MKPOSTFIX MKPROFILE \
1.703 christos 1081: MKRUMP \
1.504 lukem 1082: MKSHARE MKSKEY MKSTATICLIB \
1.945 christos 1083: MKUNBOUND \
1.567 mrg 1084: MKX11FONTS \
1.504 lukem 1085: MKYP
1.600 uebayasi 1086: .for var in ${_MKVARS.yes}
1.830 matt 1087: ${var}?= ${${var}.${MACHINE_ARCH}:Uyes}
1.230 tv 1088: .endfor
1089:
1.341 lukem 1090: #
1.764 matt 1091: # MKGCCCMDS is only valid if we are building GCC so make it dependent on that.
1092: #
1.765 matt 1093: _MKVARS.yes += MKGCCCMDS
1.764 matt 1094: MKGCCCMDS?= ${MKGCC}
1095:
1096: #
1.606 he 1097: # Exceptions to the above:
1098: #
1099:
1.939 scole 1100: # Rump doesn't work yet on ia64
1101: .if ${MACHINE} == "ia64"
1102: MKRUMP= no
1103: .endif
1104:
1.1027 christos 1105: # RUMP uses -nostdinc which coverity does not like
1106: # It also does not use many new files, so disable it
1107: .if defined(COVERITY_TOP_CONFIG)
1108: MKRUMP= no
1109: .endif
1110:
1.606 he 1111: #
1.1001 christos 1112: # Build a dynamically linked /bin and /sbin, with the necessary shared
1113: # libraries moved from /usr/lib to /lib and the shared linker moved
1114: # from /usr/libexec to /lib
1115: #
1116: # Note that if the BINDIR is not /bin or /sbin, then we always use the
1117: # non-DYNAMICROOT behavior (i.e. it is only enabled for programs in /bin
1118: # and /sbin). See <bsd.shlib.mk>.
1119: #
1120: # For ia64, ld.elf_so not yet implemented
1121: .if ${MACHINE_ARCH} == "ia64"
1122: MKDYNAMICROOT= no
1123: .endif
1124:
1125: .if defined(MKREPRO)
1126: MKARZERO ?= ${MKREPRO}
1127: .endif
1128:
1129: #
1.623 mrg 1130: # MK* options which default to "no". Note that MKZFS has a different
1.1003 matt 1131: # default for some platforms, see above. Please keep alphabetically
1132: # sorted with at most one letter per line.
1.341 lukem 1133: #
1.600 uebayasi 1134: _MKVARS.no= \
1.1001 christos 1135: MKARZERO \
1.695 joerg 1136: MKBSDGREP MKBSDTAR \
1.1008 riastrad 1137: MKCATPAGES MKCOMPATTESTS MKCOMPATX11 MKCTF \
1.1003 matt 1138: MKDEBUG MKDEBUGLIB MKDTRACE \
1139: MKEXTSRC \
1140: MKGROFFHTMLDOC \
1141: MKKYUA \
1142: MKLIBCXX MKLLD MKLLDB MKLLVM MKLINT \
1143: MKMANZ MKMCLINKER \
1144: MKNSD \
1145: MKOBJDIRS \
1146: MKPCC MKPIGZGZIP \
1147: MKRADEONFIRMWARE MKREPRO \
1148: MKSLJIT MKSOFTFLOAT MKSTRIPIDENT \
1.1026 jmcneill 1149: MKTEGRAFIRMWARE MKTPM \
1.1003 matt 1150: MKUNPRIVED MKUPDATE \
1151: MKX11 MKX11MOTIF MKXORG_SERVER \
1152: MKZFS
1.600 uebayasi 1153: .for var in ${_MKVARS.no}
1.830 matt 1154: ${var}?= ${${var}.${MACHINE_ARCH}:Uno}
1.230 tv 1155: .endfor
1156:
1.1001 christos 1157: .if ${MACHINE_ARCH} == "i386" || \
1158: ${MACHINE_ARCH} == "x86_64" || \
1159: ${MACHINE_ARCH} == "sparc"
1160: MKSLJIT= yes
1161: .endif
1162:
1.341 lukem 1163: #
1.733 mrg 1164: # Which platforms build the xorg-server drivers (as opposed
1165: # to just Xnest and Xvfb.)
1166: #
1.862 mrg 1167: .if ${MACHINE} == "alpha" || \
1.734 mrg 1168: ${MACHINE} == "amd64" || \
1.878 phx 1169: ${MACHINE} == "amiga" || \
1.734 mrg 1170: ${MACHINE} == "bebox" || \
1171: ${MACHINE} == "cats" || \
1172: ${MACHINE} == "dreamcast" || \
1173: ${MACHINE} == "ews4800mips" || \
1174: ${MACHINE} == "evbarm" || \
1175: ${MACHINE} == "evbmips" || \
1176: ${MACHINE} == "hp300" || \
1177: ${MACHINE} == "hpcarm" || \
1178: ${MACHINE} == "hpcmips" || \
1179: ${MACHINE} == "hpcsh" || \
1180: ${MACHINE} == "i386" || \
1.876 rjs 1181: ${MACHINE} == "ibmnws" || \
1.734 mrg 1182: ${MACHINE} == "luna68k" || \
1.874 rjs 1183: ${MACHINE} == "mac68k" || \
1.734 mrg 1184: ${MACHINE} == "macppc" || \
1185: ${MACHINE} == "netwinder" || \
1186: ${MACHINE} == "newsmips" || \
1187: ${MACHINE} == "prep" || \
1188: ${MACHINE} == "ofppc" || \
1189: ${MACHINE} == "sgimips" || \
1190: ${MACHINE} == "shark" || \
1191: ${MACHINE} == "sparc" || \
1192: ${MACHINE} == "sparc64" || \
1193: ${MACHINE} == "vax" || \
1.862 mrg 1194: ${MACHINE} == "zaurus"
1.1001 christos 1195: MKXORG_SERVER=yes
1.733 mrg 1196: .else
1.1001 christos 1197: .endif
1198:
1199: # Only install the radeon firmware on DRM-happy systems.
1200: .if ${MACHINE_ARCH} == "x86_64" || ${MACHINE_ARCH} == "i386"
1201: MKRADEONFIRMWARE= yes
1.733 mrg 1202: .endif
1203:
1.1026 jmcneill 1204: # Only install the tegra firmware on evbarm and evbarm64.
1205: .if ${MACHINE} == "evbarm" || ${MACHINE} == "evbarm64"
1206: MKTEGRAFIRMWARE= yes
1207: .endif
1208:
1.733 mrg 1209: #
1.230 tv 1210: # Force some options off if their dependencies are off.
1.341 lukem 1211: #
1212:
1.613 matt 1213: .if ${MKCXX} == "no"
1214: MKATF:= no
1215: MKGROFF:= no
1.724 jmmv 1216: MKKYUA:= no
1.613 matt 1217: .endif
1218:
1.340 lukem 1219: .if ${MKMAN} == "no"
1.341 lukem 1220: MKCATPAGES:= no
1.340 lukem 1221: MKHTML:= no
1.116 lukem 1222: .endif
1223:
1.697 joerg 1224: _MANINSTALL= maninstall
1225: .if ${MKCATPAGES} != "no"
1226: _MANINSTALL+= catinstall
1227: .endif
1228: .if ${MKHTML} != "no"
1229: _MANINSTALL+= htmlinstall
1230: .endif
1231:
1.117 lukem 1232: .if ${MKLINKLIB} == "no"
1.507 lukem 1233: MKLINT:= no
1.230 tv 1234: MKPICINSTALL:= no
1235: MKPROFILE:= no
1.327 thorpej 1236: .endif
1237:
1238: .if ${MKPIC} == "no"
1239: MKPICLIB:= no
1.116 lukem 1240: .endif
1241:
1.230 tv 1242: .if ${MKOBJ} == "no"
1243: MKOBJDIRS:= no
1.116 lukem 1244: .endif
1245:
1.117 lukem 1246: .if ${MKSHARE} == "no"
1.230 tv 1247: MKCATPAGES:= no
1248: MKDOC:= no
1249: MKINFO:= no
1.341 lukem 1250: MKHTML:= no
1.230 tv 1251: MKMAN:= no
1252: MKNLS:= no
1.116 lukem 1253: .endif
1.276 thorpej 1254:
1.812 joerg 1255: .if !empty(MACHINE_ARCH:Mearm*)
1256: _NEEDS_LIBCXX.${MACHINE_ARCH}= yes
1257: .endif
1.903 joerg 1258: _NEEDS_LIBCXX.aarch64= yes
1.977 mrg 1259: _NEEDS_LIBCXX.aarch64eb= yes
1.832 joerg 1260: _NEEDS_LIBCXX.i386= yes
1261: _NEEDS_LIBCXX.powerpc= yes
1262: _NEEDS_LIBCXX.powerpc64= yes
1.903 joerg 1263: _NEEDS_LIBCXX.sparc= yes
1264: _NEEDS_LIBCXX.sparc64= yes
1.832 joerg 1265: _NEEDS_LIBCXX.x86_64= yes
1.812 joerg 1266:
1267: .if ${MKLLVM} == "yes" && ${_NEEDS_LIBCXX.${MACHINE_ARCH}:Uno} == "yes"
1268: MKLIBCXX:= yes
1269: .endif
1270:
1.341 lukem 1271: #
1272: # install(1) parameters.
1273: #
1274: COPY?= -c
1275: .if ${MKUPDATE} == "no"
1276: PRESERVE?=
1277: .else
1278: PRESERVE?= -p
1279: .endif
1280: RENAME?= -r
1281: HRDLINK?= -l h
1.444 christos 1282: SYMLINK?= -l s
1.341 lukem 1283:
1284: METALOG?= ${DESTDIR}/METALOG
1285: METALOG.add?= ${TOOL_CAT} -l >> ${METALOG}
1286: .if (${_SRC_TOP_} != "") # only set INSTPRIV if inside ${NETBSDSRCDIR}
1287: .if ${MKUNPRIVED} != "no"
1.562 apb 1288: INSTPRIV.unpriv=-U -M ${METALOG} -D ${DESTDIR} -h sha256
1.341 lukem 1289: .else
1290: INSTPRIV.unpriv=
1291: .endif
1292: INSTPRIV?= ${INSTPRIV.unpriv} -N ${NETBSDSRCDIR}/etc
1293: .endif
1.410 lukem 1294: STRIPFLAG?=
1.341 lukem 1295:
1.406 lukem 1296: .if ${NEED_OWN_INSTALL_TARGET} != "no"
1.341 lukem 1297: INSTALL_DIR?= ${INSTALL} ${INSTPRIV} -d
1298: INSTALL_FILE?= ${INSTALL} ${INSTPRIV} ${COPY} ${PRESERVE} ${RENAME}
1299: INSTALL_LINK?= ${INSTALL} ${INSTPRIV} ${HRDLINK} ${RENAME}
1300: INSTALL_SYMLINK?= ${INSTALL} ${INSTPRIV} ${SYMLINK} ${RENAME}
1301: .endif
1302:
1303: #
1.351 lukem 1304: # Set defaults for the USE_xxx variables.
1305: #
1306:
1307: #
1.433 lukem 1308: # USE_* options which default to "no" and will be forced to "no" if their
1309: # corresponding MK* variable is set to "no".
1310: #
1.505 lukem 1311: .for var in USE_SKEY
1312: .if (${${var:S/USE_/MK/}} == "no")
1313: ${var}:= no
1314: .else
1315: ${var}?= no
1316: .endif
1317: .endfor
1.433 lukem 1318:
1319: #
1.351 lukem 1320: # USE_* options which default to "yes" unless their corresponding MK*
1321: # variable is set to "no".
1.341 lukem 1322: #
1.512 lukem 1323: .for var in USE_HESIOD USE_INET6 USE_KERBEROS USE_LDAP USE_PAM USE_YP
1.504 lukem 1324: .if (${${var:S/USE_/MK/}} == "no")
1325: ${var}:= no
1.276 thorpej 1326: .else
1.504 lukem 1327: ${var}?= yes
1.276 thorpej 1328: .endif
1.351 lukem 1329: .endfor
1330:
1331: #
1332: # USE_* options which default to "yes".
1333: #
1.504 lukem 1334: .for var in USE_JEMALLOC
1335: ${var}?= yes
1.497 ad 1336: .endfor
1.300 tron 1337:
1.341 lukem 1338: #
1.445 jmc 1339: # USE_* options which default to "no".
1340: #
1.639 mrg 1341: # For now, disable pigz as compressor by default
1.641 ahoka 1342: .for var in USE_PIGZGZIP USE_LIBTRE
1.639 mrg 1343: ${var}?= no
1344: .endfor
1.357 lukem 1345:
1.825 apb 1346: #
1.826 apb 1347: # TOOL_GZIP and friends. These might refer to TOOL_PIGZ or to the host gzip.
1.825 apb 1348: #
1.672 matt 1349: .if ${USE_PIGZGZIP} != "no"
1350: TOOL_GZIP= ${TOOL_PIGZ}
1.825 apb 1351: GZIP_N_FLAG?= -nT
1.672 matt 1352: .else
1353: TOOL_GZIP= gzip
1.825 apb 1354: GZIP_N_FLAG?= -n
1.672 matt 1355: .endif
1.825 apb 1356: TOOL_GZIP_N= ${TOOL_GZIP} ${GZIP_N_FLAG}
1.672 matt 1357:
1.357 lukem 1358: #
1.522 mrg 1359: # Where X11 sources are and where it is installed to.
1.357 lukem 1360: #
1.587 apb 1361: .if !defined(X11SRCDIR)
1362: .if exists(${NETBSDSRCDIR}/../xsrc)
1.615 christos 1363: X11SRCDIR!= cd "${NETBSDSRCDIR}/../xsrc" && pwd
1.587 apb 1364: .else
1365: X11SRCDIR= /usr/xsrc
1366: .endif
1367: .endif # !defined(X11SRCDIR)
1368:
1.357 lukem 1369: X11SRCDIR.local?= ${X11SRCDIR}/local
1.522 mrg 1370: X11ROOTDIR?= /usr/X11R7
1.357 lukem 1371: X11BINDIR?= ${X11ROOTDIR}/bin
1.417 lukem 1372: X11ETCDIR?= /etc/X11
1.357 lukem 1373: X11FONTDIR?= ${X11ROOTDIR}/lib/X11/fonts
1374: X11INCDIR?= ${X11ROOTDIR}/include
1375: X11LIBDIR?= ${X11ROOTDIR}/lib/X11
1376: X11MANDIR?= ${X11ROOTDIR}/man
1.635 mrg 1377: X11SHAREDIR?= ${X11ROOTDIR}/share
1.858 matt 1378: X11USRLIBDIR?= ${X11ROOTDIR}/lib${MLIBDIR:D/${MLIBDIR}}
1.417 lukem 1379:
1.516 mrg 1380: #
1381: # New modular-xorg based builds
1382: #
1383: X11SRCDIRMIT?= ${X11SRCDIR}/external/mit
1384: .for _lib in \
1385: FS ICE SM X11 XScrnSaver XTrap Xau Xcomposite Xcursor Xdamage \
1.1012 mrg 1386: Xdmcp Xevie Xext Xfixes Xfont Xfont2 Xft Xi Xinerama Xmu Xpresent Xpm \
1.516 mrg 1387: Xrandr Xrender Xres Xt Xtst Xv XvMC Xxf86dga Xxf86misc Xxf86vm drm \
1.1048 mrg 1388: epoxy fontenc xkbfile xkbui Xaw pciaccess xcb xshmfence \
1.789 mrg 1389: pthread-stubs
1.516 mrg 1390: X11SRCDIR.${_lib}?= ${X11SRCDIRMIT}/lib${_lib}/dist
1391: .endfor
1392:
1393: .for _proto in \
1394: xcmisc xext xf86bigfont bigreqs input kb x fonts fixes scrnsaver \
1.788 mrg 1395: xinerama dri2 dri3 render resource record video xf86dga xf86misc \
1.635 mrg 1396: xf86vidmode composite damage trap gl randr fontcache xf86dri \
1.1049 ! mrg 1397: present xcb- xorg
1.516 mrg 1398: X11SRCDIR.${_proto}proto?= ${X11SRCDIRMIT}/${_proto}proto/dist
1399: .endfor
1400:
1.931 mrg 1401: # During transition from xorg-server 1.10 to 1.18
1.956 mrg 1402: .if \
1.980 mrg 1403: ${MACHINE} == "alpha" || \
1404: ${MACHINE} == "amiga" || \
1405: ${MACHINE} == "ews4800mips" || \
1406: ${MACHINE} == "hpcarm" || \
1407: ${MACHINE} == "hpcmips" || \
1408: ${MACHINE} == "hpcsh" || \
1409: ${MACHINE} == "mac68k" || \
1410: ${MACHINE} == "netwinder" || \
1411: ${MACHINE} == "newsmips" || \
1412: ${MACHINE} == "sgimips" || \
1413: ${MACHINE} == "vax" || \
1414: ${MACHINE} == "zaurus"
1415: HAVE_XORG_SERVER_VER?=110
1416: .else
1.952 jakllsch 1417: HAVE_XORG_SERVER_VER?=118
1418: .endif
1.941 mrg 1419:
1.944 mrg 1420: .if ${HAVE_XORG_SERVER_VER} == "118"
1.931 mrg 1421: XORG_SERVER_SUBDIR?=xorg-server
1.943 mrg 1422: . if ${MACHINE} == "amd64" || ${MACHINE} == "i386"
1423: HAVE_XORG_GLAMOR?= yes
1424: . endif
1.931 mrg 1425: .else
1426: XORG_SERVER_SUBDIR?=xorg-server.old
1427: .endif
1428:
1429: X11SRCDIR.xorg-server?= ${X11SRCDIRMIT}/${XORG_SERVER_SUBDIR}/dist
1.943 mrg 1430: HAVE_XORG_GLAMOR?= no
1431:
1432: # Build glamor extension?
1.931 mrg 1433:
1.516 mrg 1434: .for _dir in \
1.843 snj 1435: xtrans fontconfig freetype evieext mkfontscale bdftopcf \
1.1006 snj 1436: xorg-cf-files imake xbiff xkeyboard-config \
1.517 mrg 1437: xbitmaps appres xeyes xev xedit sessreg pixman \
1.838 mrg 1438: beforelight bitmap editres makedepend fonttosfnt fslsfonts fstobdf \
1.843 snj 1439: glu glw mesa-demos MesaGLUT MesaLib MesaLib7 \
1440: ico iceauth listres lndir \
1.516 mrg 1441: luit xproxymanagementprotocol mkfontdir oclock proxymngr rgb \
1.861 mrg 1442: rstart setxkbmap showfont smproxy twm viewres \
1443: x11perf xauth xcalc xclipboard \
1.843 snj 1444: xclock xcmsdb xconsole xditview xdpyinfo xdriinfo xdm \
1.516 mrg 1445: xfd xf86dga xfindproxy xfontsel xfwp xgamma xgc xhost xinit \
1446: xkill xload xlogo xlsatoms xlsclients xlsfonts xmag xmessage \
1447: xmh xmodmap xmore xman xprop xrandr xrdb xrefresh xset \
1448: xsetmode xsetpointer xsetroot xsm xstdcmap xvidtune xvinfo \
1.843 snj 1449: xwininfo xwud xkbprint xkbevd \
1450: xterm xwd xfs xfsinfo xtrap xkbutils xkbcomp \
1.1006 snj 1451: xinput xcb-util xorg-docs \
1.516 mrg 1452: font-adobe-100dpi font-adobe-75dpi font-adobe-utopia-100dpi \
1453: font-adobe-utopia-75dpi font-adobe-utopia-type1 \
1454: font-alias \
1455: font-bh-100dpi font-bh-75dpi font-bh-lucidatypewriter-100dpi \
1456: font-bh-lucidatypewriter-75dpi font-bh-ttf font-bh-type1 \
1457: font-bitstream-100dpi font-bitstream-75dpi font-bitstream-type1 \
1458: font-cursor-misc font-daewoo-misc font-dec-misc font-ibm-type1 \
1459: font-isas-misc font-jis-misc font-misc-misc font-mutt-misc \
1.554 tron 1460: font-sony-misc font-util ttf-bitstream-vera encodings
1.516 mrg 1461: X11SRCDIR.${_dir}?= ${X11SRCDIRMIT}/${_dir}/dist
1462: .endfor
1463:
1.518 mrg 1464: .for _i in \
1.652 mrg 1465: elographics keyboard mouse synaptics vmmouse void ws
1.518 mrg 1466: X11SRCDIR.xf86-input-${_i}?= ${X11SRCDIRMIT}/xf86-input-${_i}/dist
1467: .endfor
1468:
1.963 mrg 1469: # xf86-video-modesetting move into the server build.
1470: EXTRA_DRIVERS=
1471: .if ${HAVE_XORG_SERVER_VER} == "118"
1472: X11SRCDIR.xf86-video-modesetting=${X11SRCDIR.xorg-server}/hw/xfree86/drivers/modesetting
1473: .else
1474: EXTRA_DRIVERS= modesetting
1475: .endif
1476:
1.518 mrg 1477: .for _v in \
1.942 mrg 1478: ag10e amdgpu apm ark ast ati ati-kms chips cirrus crime \
1.879 jmcneill 1479: geode glint i128 i740 igs imstt intel intel-old \
1.963 mrg 1480: ${EXTRA_DRIVERS} mach64 mga \
1.988 snj 1481: neomagic newport nouveau nsc nv openchrome pnozz \
1.942 mrg 1482: r128 rendition \
1.626 mrg 1483: s3 s3virge savage siliconmotion sis suncg14 \
1484: suncg6 sunffb sunleo suntcx \
1.843 snj 1485: tdfx tga trident tseng vesa vga vmware wsfb xgi
1.518 mrg 1486: X11SRCDIR.xf86-video-${_v}?= ${X11SRCDIRMIT}/xf86-video-${_v}/dist
1487: .endfor
1488:
1.847 mrg 1489:
1.516 mrg 1490: X11DRI?= yes
1491: X11LOADABLE?= yes
1.374 lukem 1492:
1493:
1494: #
1.598 uebayasi 1495: # Where extsrc sources are and where it is installed to.
1496: #
1497: .if !defined(EXTSRCSRCDIR)
1498: .if exists(${NETBSDSRCDIR}/../extsrc)
1.615 christos 1499: EXTSRCSRCDIR!= cd "${NETBSDSRCDIR}/../extsrc" && pwd
1.598 uebayasi 1500: .else
1501: EXTSRCSRCDIR= /usr/extsrc
1502: .endif
1503: .endif # !defined(EXTSRCSRCDIR)
1504:
1505: EXTSRCROOTDIR?= /usr/ext
1506: EXTSRCBINDIR?= ${EXTSRCROOTDIR}/bin
1507: EXTSRCETCDIR?= /etc/ext
1508: EXTSRCINCDIR?= ${EXTSRCROOTDIR}/include
1509: EXTSRCLIBDIR?= ${EXTSRCROOTDIR}/lib/ext
1510: EXTSRCMANDIR?= ${EXTSRCROOTDIR}/man
1511: EXTSRCUSRLIBDIR?= ${EXTSRCROOTDIR}/lib
1512:
1513: #
1.414 lukem 1514: # MAKEDIRTARGET dir target [extra make(1) params]
1.612 mrg 1515: # run "cd $${dir} && ${MAKEDIRTARGETENV} ${MAKE} [params] $${target}", with a pretty message
1.414 lukem 1516: #
1.612 mrg 1517: MAKEDIRTARGETENV?=
1.414 lukem 1518: MAKEDIRTARGET=\
1519: @_makedirtarget() { \
1520: dir="$$1"; shift; \
1521: target="$$1"; shift; \
1522: case "$${dir}" in \
1523: /*) this="$${dir}/"; \
1524: real="$${dir}" ;; \
1525: .) this="${_THISDIR_}"; \
1526: real="${.CURDIR}" ;; \
1527: *) this="${_THISDIR_}$${dir}/"; \
1528: real="${.CURDIR}/$${dir}" ;; \
1529: esac; \
1530: show=$${this:-.}; \
1531: echo "$${target} ===> $${show%/}$${1:+ (with: $$@)}"; \
1532: cd "$${real}" \
1.612 mrg 1533: && ${MAKEDIRTARGETENV} ${MAKE} _THISDIR_="$${this}" "$$@" $${target}; \
1.414 lukem 1534: }; \
1535: _makedirtarget
1536:
1537: #
1.374 lukem 1538: # MAKEVERBOSE support. Levels are:
1.549 apb 1539: # 0 Minimal output ("quiet")
1540: # 1 Describe what is occurring
1541: # 2 Describe what is occurring and echo the actual command
1542: # 3 Ignore the effect of the "@" prefix in make commands
1543: # 4 Trace shell commands using the shell's -x flag
1.374 lukem 1544: #
1545: MAKEVERBOSE?= 2
1546:
1547: .if ${MAKEVERBOSE} == 0
1548: _MKMSG?= @\#
1549: _MKSHMSG?= : echo
1550: _MKSHECHO?= : echo
1.380 lukem 1551: .SILENT:
1.374 lukem 1552: .elif ${MAKEVERBOSE} == 1
1553: _MKMSG?= @echo ' '
1554: _MKSHMSG?= echo ' '
1555: _MKSHECHO?= : echo
1.380 lukem 1556: .SILENT:
1.549 apb 1557: .else # MAKEVERBOSE >= 2
1.374 lukem 1558: _MKMSG?= @echo '\# '
1559: _MKSHMSG?= echo '\# '
1560: _MKSHECHO?= echo
1.380 lukem 1561: .SILENT: __makeverbose_dummy_target__
1.549 apb 1562: .endif # MAKEVERBOSE >= 2
1563: .if ${MAKEVERBOSE} >= 3
1564: .MAKEFLAGS: -dl
1565: .endif # ${MAKEVERBOSE} >= 3
1566: .if ${MAKEVERBOSE} >= 4
1567: .MAKEFLAGS: -dx
1568: .endif # ${MAKEVERBOSE} >= 4
1.374 lukem 1569:
1570: _MKMSG_BUILD?= ${_MKMSG} " build "
1571: _MKMSG_CREATE?= ${_MKMSG} " create "
1572: _MKMSG_COMPILE?= ${_MKMSG} "compile "
1573: _MKMSG_FORMAT?= ${_MKMSG} " format "
1574: _MKMSG_INSTALL?= ${_MKMSG} "install "
1575: _MKMSG_LINK?= ${_MKMSG} " link "
1576: _MKMSG_LEX?= ${_MKMSG} " lex "
1577: _MKMSG_REMOVE?= ${_MKMSG} " remove "
1578: _MKMSG_YACC?= ${_MKMSG} " yacc "
1.391 lukem 1579:
1580: _MKSHMSG_CREATE?= ${_MKSHMSG} " create "
1581: _MKSHMSG_INSTALL?= ${_MKSHMSG} "install "
1.374 lukem 1582:
1.394 lukem 1583: _MKTARGET_BUILD?= ${_MKMSG_BUILD} ${.CURDIR:T}/${.TARGET}
1584: _MKTARGET_CREATE?= ${_MKMSG_CREATE} ${.CURDIR:T}/${.TARGET}
1585: _MKTARGET_COMPILE?= ${_MKMSG_COMPILE} ${.CURDIR:T}/${.TARGET}
1586: _MKTARGET_FORMAT?= ${_MKMSG_FORMAT} ${.CURDIR:T}/${.TARGET}
1587: _MKTARGET_INSTALL?= ${_MKMSG_INSTALL} ${.TARGET}
1588: _MKTARGET_LINK?= ${_MKMSG_LINK} ${.CURDIR:T}/${.TARGET}
1589: _MKTARGET_LEX?= ${_MKMSG_LEX} ${.CURDIR:T}/${.TARGET}
1590: _MKTARGET_REMOVE?= ${_MKMSG_REMOVE} ${.TARGET}
1591: _MKTARGET_YACC?= ${_MKMSG_YACC} ${.CURDIR:T}/${.TARGET}
1.64 lukem 1592:
1.592 joerg 1593: .if ${MKMANDOC} == "yes"
1594: TARGETS+= lintmanpages
1595: .endif
1596:
1.855 matt 1597: TESTSBASE= /usr/tests${MLIBDIR:D/${MLIBDIR}}
1.638 jmmv 1598:
1.897 riz 1599: # Override with tools versions if needed
1600: .if ${MKCTF:Uno} != "no" && !defined(NOCTF)
1601: CTFCONVERT= ${TOOL_CTFCONVERT}
1602: CTFMERGE= ${TOOL_CTFMERGE}
1603: .endif
1604:
1.347 lukem 1605: .endif # !defined(_BSD_OWN_MK_)
CVSweb <webmaster@jp.NetBSD.org>