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

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

CVSweb <webmaster@jp.NetBSD.org>