[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.927

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

CVSweb <webmaster@jp.NetBSD.org>