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

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

CVSweb <webmaster@jp.NetBSD.org>