[BACK]Return to bsd.own.mk CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / share / mk

Annotation of src/share/mk/bsd.own.mk, Revision 1.902

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

CVSweb <webmaster@jp.NetBSD.org>