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